Falko Schindler 1 year ago
parent
commit
5c4f260f60
3 changed files with 1 additions and 17 deletions
  1. 0 13
      nicegui/deprecation.py
  2. 1 1
      nicegui/events.py
  3. 0 3
      nicegui/ui.py

+ 0 - 13
nicegui/deprecation.py

@@ -1,13 +0,0 @@
-import warnings
-from functools import wraps
-
-warnings.simplefilter('always', DeprecationWarning)
-
-
-def deprecated(func: type, old_name: str, new_name: str, issue: int) -> type:
-    @wraps(func)
-    def wrapped(*args, **kwargs):
-        url = f'https://github.com/zauberzeug/nicegui/issues/{issue}'
-        warnings.warn(DeprecationWarning(f'{old_name} is deprecated, use {new_name} instead ({url})'))
-        return func(*args, **kwargs)
-    return wrapped

+ 1 - 1
nicegui/events.py

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

+ 0 - 3
nicegui/ui.py

@@ -1,5 +1,4 @@
 __all__ = [
 __all__ = [
-    'deprecated',
     'element',
     'element',
     'aggrid',
     'aggrid',
     'audio',
     'audio',
@@ -91,8 +90,6 @@ __all__ = [
     'run_with',
     'run_with',
 ]
 ]
 
 
-from . import globals
-from .deprecation import deprecated
 from .element import Element as element
 from .element import Element as element
 from .elements.aggrid import AgGrid as aggrid
 from .elements.aggrid import AgGrid as aggrid
 from .elements.audio import Audio as audio
 from .elements.audio import Audio as audio