Jelajahi Sumber

keep run.py in nicegui module

Falko Schindler 2 bulan lalu
induk
melakukan
31b6262d77
6 mengubah file dengan 5 tambahan dan 11 penghapusan
  1. 2 3
      nicegui/__init__.py
  2. 1 2
      nicegui/native/native.py
  3. 1 3
      nicegui/nicegui.py
  4. 0 0
      nicegui/run.py
  5. 1 3
      nicegui/welcome.py
  6. 0 0
      nicegui_run/__init__.py

+ 2 - 3
nicegui/__init__.py

@@ -32,6 +32,7 @@ if os.environ.get('NICEGUI_HOST'):
     sys.modules['nicegui.binding'] = WhateverModule('nicegui.binding')
     sys.modules['nicegui.elements'] = WhateverModule('nicegui.elements')
     sys.modules['nicegui.html'] = WhateverModule('nicegui.html')
+    # NOTE: keep importing the run module
     sys.modules['nicegui.storage'] = WhateverModule('nicegui.storage')
     sys.modules['nicegui.ui'] = WhateverModule('nicegui.ui')
     sys.modules['nicegui.api_router'] = WhateverModule('nicegui.api_router')
@@ -43,9 +44,7 @@ if os.environ.get('NICEGUI_HOST'):
     sys.modules['nicegui.tailwind'] = WhateverModule('nicegui.tailwind')
     sys.modules['nicegui.version'] = WhateverModule('nicegui.version')
 
-from nicegui_run import run
-
-from . import binding, elements, html, storage, ui
+from . import binding, elements, html, run, storage, ui
 from .api_router import APIRouter
 from .app.app import App
 from .client import Client

+ 1 - 2
nicegui/native/native.py

@@ -4,8 +4,7 @@ import warnings
 from multiprocessing import Queue
 from typing import Any, Callable, Tuple
 
-from nicegui_run import run
-
+from .. import run
 from ..logging import log
 
 method_queue: Queue = Queue()

+ 1 - 3
nicegui/nicegui.py

@@ -9,9 +9,7 @@ import socketio
 from fastapi import HTTPException, Request
 from fastapi.responses import FileResponse, Response
 
-from nicegui_run import run
-
-from . import air, background_tasks, binding, core, favicon, helpers, json, welcome
+from . import air, background_tasks, binding, core, favicon, helpers, json, run, welcome
 from .app import App
 from .client import Client
 from .dependencies import js_components, libraries, resources

+ 0 - 0
nicegui_run/run.py → nicegui/run.py


+ 1 - 3
nicegui/welcome.py

@@ -3,9 +3,7 @@ from typing import List
 
 import ifaddr
 
-from nicegui_run import run
-
-from . import core
+from . import core, run
 
 
 def _get_all_ips() -> List[str]:

+ 0 - 0
nicegui_run/__init__.py