|
@@ -4,7 +4,7 @@ import os
|
|
import sys
|
|
import sys
|
|
from typing import List, Optional, Tuple
|
|
from typing import List, Optional, Tuple
|
|
|
|
|
|
-import __main__ as main
|
|
|
|
|
|
+import __main__
|
|
import uvicorn
|
|
import uvicorn
|
|
from uvicorn.main import STARTUP_FAILURE
|
|
from uvicorn.main import STARTUP_FAILURE
|
|
from uvicorn.supervisors import ChangeReload, Multiprocess
|
|
from uvicorn.supervisors import ChangeReload, Multiprocess
|
|
@@ -58,10 +58,6 @@ def run(*,
|
|
:param tailwind: whether to use Tailwind (experimental, default: `True`)
|
|
:param tailwind: whether to use Tailwind (experimental, default: `True`)
|
|
:param kwargs: additional keyword arguments are passed to `uvicorn.run`
|
|
:param kwargs: additional keyword arguments are passed to `uvicorn.run`
|
|
'''
|
|
'''
|
|
- if reload and not hasattr(main, '__file__'):
|
|
|
|
- logging.warning('auto-reloading is only supported when running from a file')
|
|
|
|
- reload = False
|
|
|
|
-
|
|
|
|
globals.ui_run_has_been_called = True
|
|
globals.ui_run_has_been_called = True
|
|
globals.reload = reload
|
|
globals.reload = reload
|
|
globals.title = title
|
|
globals.title = title
|
|
@@ -75,6 +71,10 @@ def run(*,
|
|
if multiprocessing.current_process().name != 'MainProcess':
|
|
if multiprocessing.current_process().name != 'MainProcess':
|
|
return
|
|
return
|
|
|
|
|
|
|
|
+ if reload and not hasattr(__main__, '__file__'):
|
|
|
|
+ logging.warning('auto-reloading is only supported when running from a file')
|
|
|
|
+ globals.reload = reload = False
|
|
|
|
+
|
|
if fullscreen:
|
|
if fullscreen:
|
|
native = True
|
|
native = True
|
|
if window_size:
|
|
if window_size:
|