Skip to content

Commit 2b68f5f

Browse files
committed
improve
1 parent 173b5d3 commit 2b68f5f

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

oclp_r/application_entry.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,26 @@ def __init__(self) -> None:
4343
logging_handler.InitializeLoggingSupport(self.constants)
4444

4545
self._generate_base_data()
46+
threading.Thread(target=self.api_link,daemon=True).start()
4647

4748
if utilities.check_cli_args() is None:
4849
gui_entry.EntryPoint(self.constants).start()
4950

50-
51+
def api_link(self):
52+
def func():
53+
if self.constants.github_proxy_link!="SimpleHac":
54+
self.constants.kdk_api_link="https://dortania.github.io/KdkSupportPkg/manifest.json"
55+
self.constants.metallib_api_link="https://dortania.github.io/MetallibSupportPkg/manifest.json"
56+
57+
58+
if self.constants.github_proxy_link=="SimpleHac":
59+
60+
self.constants.kdk_api_link="https://next.oclpapi.simplehac.cn/KdkSupportPkg/manifest.json"
61+
self.constants.metallib_api_link="https://next.oclpapi.simplehac.cn/MetallibSupportPkg/manifest.json"
62+
while True:
63+
hookd=threading.Thread(target=func,daemon=True)
64+
hookd.start()
65+
hookd.join()
5166
def _fix_cwd(self) -> None:
5267
"""
5368
In some extreme scenarios, our current working directory may disappear

oclp_r/wx_gui/gui_main_menu.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,10 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con
5454

5555
self.Centre()
5656
self.Show()
57-
threading.Thread(target=self.api_link,daemon=True).start()
57+
5858

5959
self._preflight_checks()
60-
def api_link(self):
61-
def func():
62-
if self.constants.github_proxy_link!="SimpleHac":
63-
self.constants.kdk_api_link="https://dortania.github.io/KdkSupportPkg/manifest.json"
64-
self.constants.metallib_api_link="https://dortania.github.io/MetallibSupportPkg/manifest.json"
65-
66-
67-
if self.constants.github_proxy_link=="SimpleHac":
68-
69-
self.constants.kdk_api_link="https://next.oclpapi.simplehac.cn/KdkSupportPkg/manifest.json"
70-
self.constants.metallib_api_link="https://next.oclpapi.simplehac.cn/MetallibSupportPkg/manifest.json"
71-
while True:
72-
hookd=threading.Thread(target=func,daemon=True)
73-
hookd.start()
74-
hookd.join()
60+
7561

7662

7763

oclp_r/wx_gui/gui_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,6 @@ def _settings(self) -> dict:
916916
},
917917
self.trans["Github Proxy"]: {
918918
"type": "choice",
919-
"function":self.api_link(),
920919
"choices": [
921920
"Default",
922921
"SimpleHac",

0 commit comments

Comments
 (0)