Browse Source

code review

Falko Schindler 3 năm trước cách đây
mục cha
commit
b41fe95636
4 tập tin đã thay đổi với 5 bổ sung6 xóa
  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'
     reload: bool = True
     show: bool = True
-    uvicorn_logging_level = 'warning'
+    uvicorn_logging_level: str = 'warning'
     interactive: bool = False
-    main_page_classes = 'q-ma-md column items-start'
+    main_page_classes: str = 'q-ma-md column items-start'
 
 
 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 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}})

+ 0 - 1
nicegui/elements/scene_object3d.py

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

+ 1 - 1
nicegui/ui.py

@@ -4,6 +4,7 @@ class Ui:
 
     from .elements.button import Button as button
     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.dialog import Dialog as dialog
     from .elements.icon import Icon as icon
@@ -30,7 +31,6 @@ class Ui:
     from .elements.switch import Switch as switch
     from .elements.toggle import Toggle as toggle
     from .elements.upload import Upload as upload
-    from .elements.colors import Colors as colors
 
     from .elements.plot import Plot as plot
     from .elements.line_plot import LinePlot as line_plot