فهرست منبع

remove deprecated APIs (fixes #1711)

Falko Schindler 1 سال پیش
والد
کامیت
81e5de00ff
6فایلهای تغییر یافته به همراه7 افزوده شده و 26 حذف شده
  1. 0 6
      nicegui/elements/audio.py
  2. 0 6
      nicegui/elements/video.py
  3. 0 7
      nicegui/events.py
  4. 2 2
      nicegui/page_layout.py
  5. 3 3
      nicegui/run.py
  6. 2 2
      nicegui/run_with.py

+ 0 - 6
nicegui/elements/audio.py

@@ -1,4 +1,3 @@
-import warnings
 from pathlib import Path
 from typing import Union
 
@@ -13,7 +12,6 @@ class Audio(Element, component='audio.js'):
                  autoplay: bool = False,
                  muted: bool = False,
                  loop: bool = False,
-                 type: str = '',  # DEPRECATED, pylint: disable=redefined-builtin
                  ) -> None:
         """Audio
 
@@ -37,10 +35,6 @@ class Audio(Element, component='audio.js'):
         self._props['muted'] = muted
         self._props['loop'] = loop
 
-        if type:
-            url = 'https://github.com/zauberzeug/nicegui/pull/624'
-            warnings.warn(DeprecationWarning(f'The type parameter for ui.audio is deprecated and ineffective ({url}).'))
-
     def seek(self, seconds: float) -> None:
         """Seek to a specific position in the audio.
 

+ 0 - 6
nicegui/elements/video.py

@@ -1,4 +1,3 @@
-import warnings
 from pathlib import Path
 from typing import Union
 
@@ -13,7 +12,6 @@ class Video(Element, component='video.js'):
                  autoplay: bool = False,
                  muted: bool = False,
                  loop: bool = False,
-                 type: str = '',  # DEPRECATED, pylint: disable=redefined-builtin
                  ) -> None:
         """Video
 
@@ -37,10 +35,6 @@ class Video(Element, component='video.js'):
         self._props['muted'] = muted
         self._props['loop'] = loop
 
-        if type:
-            url = 'https://github.com/zauberzeug/nicegui/pull/624'
-            warnings.warn(DeprecationWarning(f'The type parameter for ui.video is deprecated and ineffective ({url}).'))
-
     def seek(self, seconds: float) -> None:
         """Seek to a specific position in the video.
 

+ 0 - 7
nicegui/events.py

@@ -35,13 +35,6 @@ class UiEventArguments(EventArguments):
 class GenericEventArguments(UiEventArguments):
     args: Any
 
-    def __getitem__(self, key: str) -> Any:
-        if key == 'args':
-            globals.log.warning('msg["args"] is deprecated, use e.args instead '
-                                '(see https://github.com/zauberzeug/nicegui/pull/1095)')  # DEPRECATED
-            return self.args
-        raise KeyError(key)
-
 
 @dataclass(**KWONLY_SLOTS)
 class ClickEventArguments(UiEventArguments):

+ 2 - 2
nicegui/page_layout.py

@@ -26,7 +26,7 @@ class Header(ValueElement):
                  fixed: bool = True,
                  bordered: bool = False,
                  elevated: bool = False,
-                 add_scroll_padding: bool = False,  # DEPRECATED: will be True in v1.4
+                 add_scroll_padding: bool = True,
                  ) -> None:
         """Header
 
@@ -39,7 +39,7 @@ class Header(ValueElement):
         :param fixed: whether the header should be fixed to the top of the page (default: `True`)
         :param bordered: whether the header should have a border (default: `False`)
         :param elevated: whether the header should have a shadow (default: `False`)
-        :param add_scroll_padding: whether to automatically prevent link targets from being hidden behind the header (default: `False`, will be `True` in v1.4)
+        :param add_scroll_padding: whether to automatically prevent link targets from being hidden behind the header (default: `True`)
         """
         with globals.get_client().layout:
             super().__init__(tag='q-header', value=value, on_value_change=None)

+ 3 - 3
nicegui/run.py

@@ -11,9 +11,9 @@ from starlette.routing import Route
 from uvicorn.main import STARTUP_FAILURE
 from uvicorn.supervisors import ChangeReload, Multiprocess
 
+from . import native_mode  # pylint: disable=redefined-builtin
 from . import globals, helpers  # pylint: disable=redefined-builtin
 from . import native as native_module
-from . import native_mode  # pylint: disable=redefined-builtin
 from .air import Air
 from .language import Language
 
@@ -49,7 +49,7 @@ def run(*,
         dark: Optional[bool] = False,
         language: Language = 'en-US',
         binding_refresh_interval: float = 0.1,
-        reconnect_timeout: float = 0.0,  # NOTE: the value of 0.0 is DEPRECATED, change to 3.0 in 1.4 release
+        reconnect_timeout: float = 3.0,
         show: bool = True,
         on_air: Optional[Union[str, Literal[True]]] = None,
         native: bool = False,
@@ -79,7 +79,7 @@ def run(*,
     :param dark: whether to use Quasar's dark mode (default: `False`, use `None` for "auto" mode)
     :param language: language for Quasar elements (default: `'en-US'`)
     :param binding_refresh_interval: time between binding updates (default: `0.1` seconds, bigger is more CPU friendly)
-    :param reconnect_timeout: maximum time the server waits for the browser to reconnect (default: 0.0 seconds, i.e. no reconnect)
+    :param reconnect_timeout: maximum time the server waits for the browser to reconnect (default: 3.0 seconds)
     :param show: automatically open the UI in a browser tab (default: `True`)
     :param on_air: tech preview: `allows temporary remote access <https://nicegui.io/documentation#nicegui_on_air>`_ if set to `True` (default: disabled)
     :param native: open the UI in a native window of size 800x600 (default: `False`, deactivates `show`, automatically finds an open port)

+ 2 - 2
nicegui/run_with.py

@@ -17,7 +17,7 @@ def run_with(
     dark: Optional[bool] = False,
     language: Language = 'en-US',
     binding_refresh_interval: float = 0.1,
-    reconnect_timeout: float = 0.0,  # NOTE: the value of 0.0 is DEPRECATED, change to 3.0 in 1.4 release
+    reconnect_timeout: float = 3.0,
     mount_path: str = '/',
     tailwind: bool = True,
     prod_js: bool = True,
@@ -32,7 +32,7 @@ def run_with(
     :param dark: whether to use Quasar's dark mode (default: `False`, use `None` for "auto" mode)
     :param language: language for Quasar elements (default: `'en-US'`)
     :param binding_refresh_interval: time between binding updates (default: `0.1` seconds, bigger is more CPU friendly)
-    :param reconnect_timeout: maximum time the server waits for the browser to reconnect (default: 0.0 seconds, i.e. no reconnect)
+    :param reconnect_timeout: maximum time the server waits for the browser to reconnect (default: 3.0 seconds)
     :param mount_path: mount NiceGUI at this path (default: `'/'`)
     :param tailwind: whether to use Tailwind CSS (experimental, default: `True`)
     :param prod_js: whether to use the production version of Vue and Quasar dependencies (default: `True`)