瀏覽代碼

code review

Falko Schindler 3 年之前
父節點
當前提交
b41fe95636
共有 4 個文件被更改,包括 5 次插入6 次删除
  1. 2 2
      nicegui/config.py
  2. 2 2
      nicegui/elements/open.py
  3. 0 1
      nicegui/elements/scene_object3d.py
  4. 1 1
      nicegui/ui.py

+ 2 - 2
nicegui/config.py

@@ -12,9 +12,9 @@ class Config(BaseModel):
     favicon: str = 'favicon.ico'
     favicon: str = 'favicon.ico'
     reload: bool = True
     reload: bool = True
     show: bool = True
     show: bool = True
-    uvicorn_logging_level = 'warning'
+    uvicorn_logging_level: str = 'warning'
     interactive: bool = False
     interactive: bool = False
-    main_page_classes = 'q-ma-md column items-start'
+    main_page_classes: str = 'q-ma-md column items-start'
 
 
 
 
 excluded_endings = (
 excluded_endings = (

+ 2 - 2
nicegui/elements/open.py

@@ -11,7 +11,7 @@ def open(self, path: str, socket: WebSocket):
     :param path: string that is a relative url path or an absolute url
     :param path: string that is a relative url path or an absolute url
     :param socket: WebSocket defining the target client
     :param socket: WebSocket defining the target client
     """
     """
-    create_task(open_async(path, socket))
+    create_task(open_async(self, path, socket))
 
 
-async def open_async(path: str, socket: WebSocket):
+async def open_async(self, path: str, socket: WebSocket):
     await socket.send_json({'type': 'page_update', 'page_options': {'redirect': path}})
     await socket.send_json({'type': 'page_update', 'page_options': {'redirect': path}})

+ 0 - 1
nicegui/elements/scene_object3d.py

@@ -1,5 +1,4 @@
 from __future__ import annotations
 from __future__ import annotations
-import asyncio
 from typing import List, Optional
 from typing import List, Optional
 import uuid
 import uuid
 import numpy as np
 import numpy as np

+ 1 - 1
nicegui/ui.py

@@ -4,6 +4,7 @@ class Ui:
 
 
     from .elements.button import Button as button
     from .elements.button import Button as button
     from .elements.checkbox import Checkbox as checkbox
     from .elements.checkbox import Checkbox as checkbox
+    from .elements.colors import Colors as colors
     from .elements.custom_example import CustomExample as custom_example
     from .elements.custom_example import CustomExample as custom_example
     from .elements.dialog import Dialog as dialog
     from .elements.dialog import Dialog as dialog
     from .elements.icon import Icon as icon
     from .elements.icon import Icon as icon
@@ -30,7 +31,6 @@ class Ui:
     from .elements.switch import Switch as switch
     from .elements.switch import Switch as switch
     from .elements.toggle import Toggle as toggle
     from .elements.toggle import Toggle as toggle
     from .elements.upload import Upload as upload
     from .elements.upload import Upload as upload
-    from .elements.colors import Colors as colors
 
 
     from .elements.plot import Plot as plot
     from .elements.plot import Plot as plot
     from .elements.line_plot import LinePlot as line_plot
     from .elements.line_plot import LinePlot as line_plot