mirror of
https://github.com/LorenEteval/Furious.git
synced 2026-10-02 11:57:55 +03:00
Use functools.partial in core launcher
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
@@ -26,6 +26,7 @@ from typing import Union
|
||||
|
||||
import time
|
||||
import logging
|
||||
import functools
|
||||
import multiprocessing
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -47,7 +48,9 @@ def startHysteria1(jsonString, rule, mmdb, msgQueue: multiprocessing.Queue):
|
||||
redirect = True
|
||||
|
||||
StdoutRedirectHelper.launch(
|
||||
msgQueue, lambda: hysteria.startFromJSON(jsonString, rule, mmdb), redirect
|
||||
msgQueue,
|
||||
functools.partial(hysteria.startFromJSON, jsonString, rule, mmdb),
|
||||
redirect,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ from typing import Union
|
||||
|
||||
import time
|
||||
import logging
|
||||
import functools
|
||||
import multiprocessing
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -47,7 +48,9 @@ def startHysteria2(jsonString: str, msgQueue: multiprocessing.Queue):
|
||||
redirect = True
|
||||
|
||||
StdoutRedirectHelper.launch(
|
||||
msgQueue, lambda: hysteria2.startFromJSON(jsonString), redirect
|
||||
msgQueue,
|
||||
functools.partial(hysteria2.startFromJSON, jsonString),
|
||||
redirect,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ from Furious.Library import *
|
||||
from Furious.Utility import *
|
||||
|
||||
import time
|
||||
import functools
|
||||
import multiprocessing
|
||||
|
||||
__all__ = ['Tun2socks']
|
||||
@@ -42,7 +43,9 @@ def startTun2socks(msgQueue: multiprocessing.Queue, *args):
|
||||
redirect = True
|
||||
|
||||
StdoutRedirectHelper.launch(
|
||||
msgQueue, lambda: tun2socks.startFromArgs(*args), redirect
|
||||
msgQueue,
|
||||
functools.partial(tun2socks.startFromArgs, *args),
|
||||
redirect,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ from typing import Union
|
||||
import io
|
||||
import time
|
||||
import threading
|
||||
import functools
|
||||
import multiprocessing
|
||||
|
||||
__all__ = ['XrayCore']
|
||||
@@ -48,7 +49,9 @@ def startXrayCore(jsonString: str, msgQueue: multiprocessing.Queue):
|
||||
|
||||
if not isPythonw():
|
||||
return StdoutRedirectHelper.launch(
|
||||
msgQueue, lambda: xray.startFromJSON(jsonString), redirect
|
||||
msgQueue,
|
||||
functools.partial(xray.startFromJSON, jsonString),
|
||||
redirect,
|
||||
)
|
||||
|
||||
if not redirect:
|
||||
|
||||
Reference in New Issue
Block a user