Răsfoiți Sursa

add version information

Falko Schindler 2 săptămâni în urmă
părinte
comite
f980b69b75

+ 4 - 1
nicegui/background_tasks.py

@@ -54,7 +54,10 @@ F = TypeVar('F', bound=Callable)
 
 
 
 
 def await_on_shutdown(func: F) -> F:
 def await_on_shutdown(func: F) -> F:
-    """Tag a coroutine function so tasks created from it won't be cancelled during shutdown."""
+    """Tag a coroutine function so tasks created from it won't be cancelled during shutdown.
+
+    *Added in version 2.16.0*
+    """
     functions_awaited_on_shutdown.add(func)
     functions_awaited_on_shutdown.add(func)
     return func
     return func
 
 

+ 4 - 1
nicegui/element.py

@@ -534,5 +534,8 @@ class Element(Visibility):
 
 
     @property
     @property
     def html_id(self) -> str:
     def html_id(self) -> str:
-        """The ID of the element in the HTML DOM."""
+        """The ID of the element in the HTML DOM.
+
+        *Added in version 2.16.0*
+        """
         return f'c{self.id}'
         return f'c{self.id}'

+ 3 - 3
website/documentation/content/section_configuration_deployment.py

@@ -122,13 +122,13 @@ def env_var_demo():
 @doc.demo('Background Tasks', '''
 @doc.demo('Background Tasks', '''
     `background_tasks.create()` allows you to run an async function in the background and return a task object.
     `background_tasks.create()` allows you to run an async function in the background and return a task object.
     By default the task will be automatically cancelled during shutdown.
     By default the task will be automatically cancelled during shutdown.
-    You can prevent this by using the `@background_tasks.await_on_shutdown` decorator.
+    You can prevent this by using the `@background_tasks.await_on_shutdown` decorator (added in version 2.16.0).
     This is useful for tasks that need to be completed even when the app is shutting down.
     This is useful for tasks that need to be completed even when the app is shutting down.
 ''')
 ''')
 def background_tasks_demo():
 def background_tasks_demo():
-    from nicegui import background_tasks
+    # import aiofiles
     import asyncio
     import asyncio
-    import aiofiles
+    from nicegui import background_tasks
 
 
     results = {'answer': '?'}
     results = {'answer': '?'}