Skip to content

Commit 03ef0e3

Browse files
committed
some upd
1 parent a23add6 commit 03ef0e3

File tree

2 files changed

+22
-16
lines changed

2 files changed

+22
-16
lines changed

pages.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def _start(self):
8282
output.put_processbar(self.PROCESSBAR_STAGE)
8383
output.set_processbar(self.PROCESSBAR_STAGE, 0/3)
8484
output.put_processbar(self.PROCESSBAR_PYTHON_MANAGER)
85+
# output.put_button(t2t("Stop start"), onclick = self._stop_start)
8586
def set_processbar(x:ProgressTracker, processbar_name:str, info_scope:str):
8687
last_info = ""
8788
last_progress = 0
@@ -132,7 +133,8 @@ def set_processbar(x:ProgressTracker, processbar_name:str, info_scope:str):
132133

133134
# os.system("color 07")
134135
os.system(f"title {PROGRAM_NAME} Console")
135-
os.system(f'"{PROGRAM_PYTHON_PATH}" {launching_config["Main"]}')
136+
os.system(f'start cmd /k "{PROGRAM_PYTHON_PATH}" {launching_config["Main"]}')
137+
os.chdir(ROOT_PATH)
136138

137139
except Exception as e:
138140
pt.end_flag = True
@@ -152,6 +154,7 @@ def _load_config_files(self):
152154
def _load(self):
153155
# output.put_html('<style>@font-face {font-family: "SmileySans-Oblique"; src: url("M:\\ProgramData\\PGPL\\python-git-program-launcher\\toolkit\\SmileySans-Oblique.ttf");}</style>')
154156
# output.put_html('<style>body {font-family: "Arial", sans-serif;}</style>')
157+
self.last_config = ""
155158
self._load_config_files()
156159
show_config = self.config_files
157160
with open(os.path.join(ROOT_PATH, 'launcher_config_name.txt'), 'r') as f:
@@ -178,7 +181,10 @@ def _load(self):
178181
# with output.use_scope(self.SCOPE_LOG):
179182
# output.put_markdown(t2t('## Log'))
180183
# output.put_scrollable(output.put_scope(self.SCOPE_LOG_AREA), keep_bottom=True)
181-
184+
185+
def _stop_start(self):
186+
output.close_popup()
187+
182188
def logout(self, text: str, color='black'):
183189
if self.loaded:
184190
self.log_list_lock.acquire()
@@ -256,7 +262,7 @@ def _address_verify(self,x):
256262
return None
257263

258264
def _onclick_add_config(self):
259-
n = input.input(t2t('config name'), validate=self._address_verify)
265+
n = input.input(t2t('config name')+t2t("(You can enter the github repository address which already have existing config)"), validate=self._address_verify)
260266
if 'http' not in n:
261267
save_json(CONFIG_TEMPLATE, os.path.join(ROOT_PATH, 'configs', n + '.json'))
262268
else:

webio.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
status = True
1010
global first_run
1111
first_run = False
12-
def get_branch_commit_id():
13-
res = subprocess.Popen('git rev-parse --short HEAD', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
14-
stderr=subprocess.PIPE)
15-
res.wait()
16-
commit_id = res.stdout.read().decode('utf8').replace('\n', '')
12+
# def get_branch_commit_id():
13+
# res = subprocess.Popen('git rev-parse --short HEAD', shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
14+
# stderr=subprocess.PIPE)
15+
# res.wait()
16+
# commit_id = res.stdout.read().decode('utf8').replace('\n', '')
1717

18-
res = subprocess.Popen('git symbolic-ref --short -q HEAD', shell=True, stdin=subprocess.PIPE,
19-
stdout=subprocess.PIPE,
20-
stderr=subprocess.PIPE)
21-
res.wait()
22-
branch = res.stdout.read().decode('utf8').replace('\n', '')
23-
return branch,commit_id
18+
# res = subprocess.Popen('git symbolic-ref --short -q HEAD', shell=True, stdin=subprocess.PIPE,
19+
# stdout=subprocess.PIPE,
20+
# stderr=subprocess.PIPE)
21+
# res.wait()
22+
# branch = res.stdout.read().decode('utf8').replace('\n', '')
23+
# return branch,commit_id
2424

2525
def main():
2626
global first_run
27-
pywebio.session.set_env(output_max_width='80%', title=f"PGPL {1.0} {get_branch_commit_id()[1]}")
28-
session.run_js(f'document.querySelector("body > footer").innerHTML+="| PGPL: {"-".join(get_branch_commit_id())}"')
27+
# pywebio.session.set_env(output_max_width='80%', title=f"PGPL {1.0} {get_branch_commit_id()[1]}")
28+
# session.run_js(f'document.querySelector("body > footer").innerHTML+="| PGPL: {"-".join(get_branch_commit_id())}"')
2929
manager.reg_page('MainPage', MainPage())
3030
manager.reg_page('SettingPage', ConfigPage())
3131
manager.load_page('MainPage')

0 commit comments

Comments
 (0)