Forráskód Böngészése

Merge branch 'main' into feature/clicky_image

Falko Schindler 3 éve
szülő
commit
b39200180a

+ 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,

+ 1 - 1
nicegui/elements/joystick.py

@@ -51,7 +51,7 @@ class Joystick(Element):
 
         Create a joystick based on `nipple.js <https://yoannmoi.net/nipplejs/>`_.
 
-        :param on_start: callback for when the user toches the joystick
+        :param on_start: callback for when the user touches the joystick
         :param on_move: callback for when the user moves the joystick
         :param on_end: callback for when the user releases the joystick
         :param options: arguments like `color` which should be passed to the `underlying nipple.js library <https://github.com/yoannmoinet/nipplejs#options>`_

+ 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.js

@@ -17,7 +17,7 @@ Vue.component("log", {
       send_to_server(event, "event");
       clearInterval(connectInterval);
     };
-    connectInterval = setInterval(sendConnectEvent, 100);
+    const connectInterval = setInterval(sendConnectEvent, 100);
   },
   methods: {
     push(line) {

+ 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/scene.js

@@ -98,7 +98,7 @@ Vue.component("scene", {
       send_to_server(event, "event");
       clearInterval(connectInterval);
     };
-    connectInterval = setInterval(sendConnectEvent, 100);
+    const connectInterval = setInterval(sendConnectEvent, 100);
   },
 
   updated() {},

+ 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

+ 0 - 1
nicegui/nicegui.py

@@ -1,6 +1,5 @@
 #!/usr/bin/env python3
 from typing import Awaitable, Callable
-import asyncio
 
 from .ui import Ui  # NOTE: before justpy
 import justpy as jp

+ 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]