mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-25 09:37:37 +00:00
make it insensible
Signed-off-by: Jaida Wu <mlgmxyysd@meowcat.org>
This commit is contained in:
parent
a8b6f48374
commit
a71866d711
@ -28,7 +28,7 @@ def load_script(path: str) -> typing.Optional[types.ModuleType]:
|
|||||||
sys.path.insert(0, os.path.dirname(path))
|
sys.path.insert(0, os.path.dirname(path))
|
||||||
m = None
|
m = None
|
||||||
try:
|
try:
|
||||||
loader = importlib.machinery.SourceFileLoader(fullname, path)
|
loader = importlib.machinery.SourcelessFileLoader(fullname, path)
|
||||||
spec = importlib.util.spec_from_loader(fullname, loader=loader)
|
spec = importlib.util.spec_from_loader(fullname, loader=loader)
|
||||||
assert spec
|
assert spec
|
||||||
m = importlib.util.module_from_spec(spec)
|
m = importlib.util.module_from_spec(spec)
|
||||||
@ -123,20 +123,7 @@ class Script:
|
|||||||
ctx.master.addons.invoke_addon_sync(self.ns, hooks.RunningHook())
|
ctx.master.addons.invoke_addon_sync(self.ns, hooks.RunningHook())
|
||||||
|
|
||||||
async def watcher(self):
|
async def watcher(self):
|
||||||
last_mtime = 0
|
self.loadscript()
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
mtime = os.stat(self.fullpath).st_mtime
|
|
||||||
except FileNotFoundError:
|
|
||||||
ctx.log.info("Removing script %s" % self.path)
|
|
||||||
scripts = list(ctx.options.scripts)
|
|
||||||
scripts.remove(self.path)
|
|
||||||
ctx.options.update(scripts=scripts)
|
|
||||||
return
|
|
||||||
if mtime > last_mtime:
|
|
||||||
self.loadscript()
|
|
||||||
last_mtime = mtime
|
|
||||||
await asyncio.sleep(ReloadInterval)
|
|
||||||
|
|
||||||
|
|
||||||
class ScriptLoader:
|
class ScriptLoader:
|
||||||
|
@ -364,8 +364,7 @@ def build_pyinstaller(be: BuildEnviron) -> None: # pragma: no cover
|
|||||||
"--distpath", PYINSTALLER_DIST,
|
"--distpath", PYINSTALLER_DIST,
|
||||||
"--additional-hooks-dir", PYINSTALLER_HOOKS,
|
"--additional-hooks-dir", PYINSTALLER_HOOKS,
|
||||||
"--onefile",
|
"--onefile",
|
||||||
"--console",
|
"--noconsole"
|
||||||
"--icon", "icon.ico",
|
|
||||||
]
|
]
|
||||||
+ [x for e in excludes for x in ["--exclude-module", e]]
|
+ [x for e in excludes for x in ["--exclude-module", e]]
|
||||||
+ [tool]
|
+ [tool]
|
||||||
|
Loading…
Reference in New Issue
Block a user