Ver Fonte

a bit more consistency in the parameter documentation

Falko Schindler há 3 anos atrás
pai
commit
589c8debd1

+ 1 - 1
nicegui/elements/checkbox.py

@@ -13,7 +13,7 @@ class Checkbox(BoolElement):
         """Checkbox Element
 
         :param text: the label to display next to the checkbox
-        :param value: set to `True` if it should be checked initally; default is `False`
+        :param value: whether it should be checked initally (default: `False`)
         :param on_change: callback to execute when value changes
         """
         view = jp.QCheckbox(text=text, input=self.handle_change)

+ 1 - 1
nicegui/elements/dialog.py

@@ -11,7 +11,7 @@ class Dialog(Group):
 
         Creates a modal dialog.
 
-        :param value: whether the dialog is already opened (default: False)
+        :param value: whether the dialog is already opened (default: `False`)
         """
         view = jp.QDialog(
             value=value,

+ 2 - 2
nicegui/elements/keyboard.py

@@ -30,8 +30,8 @@ class Keyboard(Element):
         Adds global keyboard event tracking.
 
         :param handle_keys: callback to be executed when keyboard events occur.
-        :param active: boolean flag indicating whether the callback should be executed or not (default: True)
-        :param repeating: boolean flag indicating whether held keys should be sent repeatedly (default: True)
+        :param active: boolean flag indicating whether the callback should be executed or not (default: `True`)
+        :param repeating: boolean flag indicating whether held keys should be sent repeatedly (default: `True`)
         """
         super().__init__(KeyboardView(on_key=self.handle_key, repeating=repeating))
         self.active = active

+ 1 - 1
nicegui/elements/line_plot.py

@@ -18,7 +18,7 @@ class LinePlot(Plot):
         :param n: number of lines
         :param limit: maximum number of datapoints per line (new points will displace the oldest)
         :param update_every: update plot only after pushing new data multiple times to save CPU and bandwidth
-        :param close: whether the figure should be closed after exiting the context; set to `False` if you want to update it later, default is `True`
+        :param close: whether the figure should be closed after exiting the context; set to `False` if you want to update it later (default: `True`)
         :param kwargs: arguments like `figsize` which should be passed to `pyplot.figure <https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html>`_
         """
         super().__init__(close=close, **kwargs)

+ 1 - 1
nicegui/elements/log.py

@@ -35,7 +35,7 @@ class Log(Element):
 
         Create a log view that allows to add new lines without re-transmitting the whole history to the client.
 
-        :param max_lines: maximum number of lines before dropping oldest ones (default: None)
+        :param max_lines: maximum number of lines before dropping oldest ones (default: `None`)
         """
         self.lines = deque(maxlen=max_lines)
         super().__init__(LogView(lines=self.lines, max_lines=max_lines))

+ 1 - 1
nicegui/elements/menu.py

@@ -11,7 +11,7 @@ class Menu(Group):
 
         Creates a menu.
 
-        :param value: whether the menu is already opened (default: False)
+        :param value: whether the menu is already opened (default: `False`)
         """
         view = jp.QMenu(value=value)
 

+ 1 - 1
nicegui/elements/menu_item.py

@@ -19,7 +19,7 @@ class MenuItem(Element):
 
         :param text: label of the menu item
         :param on_click: callback to be executed when selecting the menu item
-        :param auto_close: whether the menu should be closed after a click event (default: True)
+        :param auto_close: whether the menu should be closed after a click event (default: `True`)
         """
         view = jp.QItem(text=text, clickable=True)
 

+ 1 - 1
nicegui/elements/notify.py

@@ -17,7 +17,7 @@ class Notify(Element):
 
         :param message: content of the notification
         :param position: position on the screen ("top-left", "top-right", "bottom-left","bottom-right, "top", "bottom", "left", "right" or "center", default: "bottom")
-        :param close_button: optional label of a button to dismiss the notification (default: None)
+        :param close_button: optional label of a button to dismiss the notification (default: `None`)
         """
         view = jp.QNotify(message=message, position=position, closeBtn=close_button)
 

+ 1 - 1
nicegui/elements/plot.py

@@ -13,7 +13,7 @@ class Plot(Element):
 
         Create a context to configure a `Matplotlib <https://matplotlib.org/>`_ plot.
 
-        :param close: whether the figure should be closed after exiting the context; set to `False` if you want to update it later, default is `True`
+        :param close: whether the figure should be closed after exiting the context; set to `False` if you want to update it later (default: `True`)
         :param kwargs: arguments like `figsize` which should be passed to `pyplot.figure <https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.figure.html>`_
         """
         self.close = close

+ 1 - 1
nicegui/elements/switch.py

@@ -13,7 +13,7 @@ class Switch(BoolElement):
         """Switch Element
 
         :param text: the label to display next to the switch
-        :param value: set to `True` if initally it should be active; default is `False`
+        :param value: whether it should be active initally (default: `False`)
         :param on_click: callback which is invoked when state is changed by the user
         """
         view = jp.QToggle(text=text, input=self.handle_change)

+ 1 - 1
nicegui/elements/upload.py

@@ -15,7 +15,7 @@ class Upload(Element):
                  ):
         """File Upload Element
 
-        :param multiple: allow uploading multiple files at once (default: False)
+        :param multiple: allow uploading multiple files at once (default: `False`)
         :param on_upload: callback to execute when a file is uploaded (list of bytearrays)
         """
         self.upload_handler = on_upload

+ 1 - 1
nicegui/timer.py

@@ -25,7 +25,7 @@ class Timer:
         :param interval: the interval in which the timer is called
         :param callback: function or coroutine to execute when interval elapses (can return `False` to prevent view update)
         :param active: whether the callback should be executed or not
-        :param once: whether the callback is only executed once after a delay specified by `interval`; default is `False`
+        :param once: whether the callback is only executed once after a delay specified by `interval` (default: `False`)
         """
 
         parent = view_stack[-1]