瀏覽代碼

Merge branch 'main' into feature/dependencies

Falko Schindler 1 年之前
父節點
當前提交
3085efd536
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      nicegui/app.py
  2. 1 1
      nicegui/elements/link.py
  3. 2 2
      nicegui/native.py

+ 1 - 1
nicegui/app.py

@@ -133,7 +133,7 @@ class App(FastAPI):
                 return {'detail': 'Not Found'}, 404
             return helpers.get_streaming_response(filepath, request)
 
-    def add_media_file(self, *, local_file: Union[str, Path], url_path: Optional[str] = None) -> None:
+    def add_media_file(self, *, local_file: Union[str, Path], url_path: Optional[str] = None) -> str:
         """Add a single media file.
 
         Allows a local file to be streamed.

+ 1 - 1
nicegui/elements/link.py

@@ -32,7 +32,7 @@ class Link(TextElement):
             self._props['href'] = target
         elif isinstance(target, Element):
             self._props['href'] = f'#{target.id}'
-        elif isinstance(target, Callable):
+        elif callable(target):
             self._props['href'] = globals.page_routes[target]
         self._props['target'] = '_blank' if new_tab else '_self'
         self._classes = ['nicegui-link']

+ 2 - 2
nicegui/native.py

@@ -9,8 +9,8 @@ from typing import Any, Callable, Dict, Optional, Tuple
 
 from .helpers import KWONLY_SLOTS
 
-method_queue = Queue()
-response_queue = Queue()
+method_queue: Queue = Queue()
+response_queue: Queue = Queue()
 
 try:
     with warnings.catch_warnings():