From 65419985d763bb28f5e12151f88b71dd52aed34e Mon Sep 17 00:00:00 2001 From: Gordon Shotwell Date: Wed, 24 Jan 2024 15:35:57 -0400 Subject: [PATCH] Trailing commas --- shiny/api-examples/input_date/app-express.py | 2 +- .../input_date_range/app-express.py | 57 ++++++++----------- .../api-examples/input_slider/app-express.py | 2 +- .../api-examples/input_switch/app-express.py | 2 +- shiny/api-examples/input_text/app-express.py | 2 +- 5 files changed, 27 insertions(+), 38 deletions(-) diff --git a/shiny/api-examples/input_date/app-express.py b/shiny/api-examples/input_date/app-express.py index 41abe3569..bd696beb3 100644 --- a/shiny/api-examples/input_date/app-express.py +++ b/shiny/api-examples/input_date/app-express.py @@ -21,4 +21,4 @@ "Date:", value="2016-02-29", datesdisabled=["2016-03-01", "2016-03-02"], -), +) diff --git a/shiny/api-examples/input_date_range/app-express.py b/shiny/api-examples/input_date_range/app-express.py index 07b4bcbac..66f79c5c4 100644 --- a/shiny/api-examples/input_date_range/app-express.py +++ b/shiny/api-examples/input_date_range/app-express.py @@ -1,38 +1,27 @@ from datetime import date -from shiny import App, Inputs, Outputs, Session, ui +from shiny.express import ui -app_ui = ui.page_fluid( - ui.input_date_range( - "daterange1", "Date range:", start="2001-01-01", end="2010-12-31" - ), - # Default start and end is the current date in the client's time zone - ui.input_date_range("daterange2", "Date range:"), - # start and end are always specified in yyyy-mm-dd, even if the display - # format is different - ui.input_date_range( - "daterange3", - "Date range:", - start="2001-01-01", - end="2010-12-31", - min="2001-01-01", - max="2012-12-21", - format="mm/dd/yy", - separator=" - ", - ), - # Pass in Date objects - ui.input_date_range( - "daterange4", "Date range:", start=date(2001, 1, 1), end=date(2010, 12, 31) - ), - # Use different language and different first day of week - ui.input_date_range("daterange5", "Date range:", language="de", weekstart=1), - # Start with decade view instead of default month view - ui.input_date_range("daterange6", "Date range:", startview="decade"), +ui.input_date_range("daterange1", "Date range:", start="2001-01-01", end="2010-12-31") +# Default start and end is the current date in the client's time zone +ui.input_date_range("daterange2", "Date range:") +# start and end are always specified in yyyy-mm-dd, even if the display +# format is different +ui.input_date_range( + "daterange3", + "Date range:", + start="2001-01-01", + end="2010-12-31", + min="2001-01-01", + max="2012-12-21", + format="mm/dd/yy", + separator=" - ", ) - - -def server(input: Inputs, output: Outputs, session: Session): - pass - - -app = App(app_ui, server) +# Pass in Date objects +ui.input_date_range( + "daterange4", "Date range:", start=date(2001, 1, 1), end=date(2010, 12, 31) +) +# Use different language and different first day of week +ui.input_date_range("daterange5", "Date range:", language="de", weekstart=1) +# Start with decade view instead of default month view +ui.input_date_range("daterange6", "Date range:", startview="decade") diff --git a/shiny/api-examples/input_slider/app-express.py b/shiny/api-examples/input_slider/app-express.py index fd4bb540f..e6e701594 100644 --- a/shiny/api-examples/input_slider/app-express.py +++ b/shiny/api-examples/input_slider/app-express.py @@ -3,7 +3,7 @@ from shiny.express import input, render, ui -ui.input_slider("obs", "Number of bins:", min=10, max=100, value=30), +ui.input_slider("obs", "Number of bins:", min=10, max=100, value=30) @render.plot diff --git a/shiny/api-examples/input_switch/app-express.py b/shiny/api-examples/input_switch/app-express.py index 2a15d9e2a..efd623850 100644 --- a/shiny/api-examples/input_switch/app-express.py +++ b/shiny/api-examples/input_switch/app-express.py @@ -1,6 +1,6 @@ from shiny.express import input, render, ui -ui.input_switch("somevalue", "Some value", False), +ui.input_switch("somevalue", "Some value", False) @render.text diff --git a/shiny/api-examples/input_text/app-express.py b/shiny/api-examples/input_text/app-express.py index f5450e682..8c0c30d69 100644 --- a/shiny/api-examples/input_text/app-express.py +++ b/shiny/api-examples/input_text/app-express.py @@ -1,6 +1,6 @@ from shiny.express import input, render, ui -ui.input_text("caption", "Caption:", "Data summary"), +ui.input_text("caption", "Caption:", "Data summary") @render.code