diff --git a/client.pyw b/client.pyw index 95768e0..8099fa2 100644 --- a/client.pyw +++ b/client.pyw @@ -5,34 +5,29 @@ import os root = Tk() -CURRENT_DIR = os.getcwd() +ml = os.getcwd() System = platform.system() file_error = '文件丢失,请重新安装' -def windows_run(): - if os.path.exists(os.path.join(CURRENT_DIR, "system_cz.exe")): - os.system("start system_cz.exe") +def jc(exe_name): + if os.path.exists(os.path.join(ml,f"{exe_name}.exe")): + os.system(f"start {exe_name}.exe") else: - messagebox.showerror('update', '重要文件丢失') - -def Not_windows_run(): - if os.path.exists(os.path.join(CURRENT_DIR, "system_command.py")): - os.system("python system_command.py") - else: - messagebox.showerror('update', '重要文件丢失') - -def system_jc(): - if System != 'Windows': - Not_windows_run() - else: - windows_run() - pass + messagebox.showerror('system',file_error) pass + +def install(): + jc("install") + +def delete(): + jc("delete") + +def gk(): + jc("gk") def update(): - messagebox.showwarning('system', '暂无做完') - pass + jc("update") def exit_exe(): root.destroy() @@ -40,9 +35,11 @@ def exit_exe(): # Button and Label -Label(root, text='启动器').pack() -Button(root, text='启动程序', command=system_jc).pack() +Label(root, text='pip_helper').pack() +Button(root, text='安装模式', command=install).pack() +Button(root, text='删除模式', command=delete).pack() Button(root, text='更新日志', command=update).pack() +Button(root, text='关于', command=gk).pack() Button(root, text='退出', command=exit_exe).pack() diff --git a/new_system/delete.py b/delete.py similarity index 100% rename from new_system/delete.py rename to delete.py diff --git a/new_system/gk.py b/gk.py similarity index 100% rename from new_system/gk.py rename to gk.py diff --git a/new_system/install.py b/install.py similarity index 100% rename from new_system/install.py rename to install.py diff --git a/jc.py b/jc.py new file mode 100644 index 0000000..9f62af3 --- /dev/null +++ b/jc.py @@ -0,0 +1,49 @@ +import os +import webbrowser +from time import sleep + + +error = 0 +ok = 0 +ml = os.getcwd() + + +def jc(exe_name): + if os.path.exists(os.path.join(ml,f"{exe_name}.exe")): + ok += 1 + else: + error += 1 + pass + pass + +def client(): + jc("client") + +def install(): + jc("install") + +def delete(): + jc("delete") + +def gk(): + jc("gk") + +def update(): + jc("update") + + +# mainloop +client() +install() +delete() +gk() +update() + +sleep(0.555) + +print(f"共有{ok}个文件正常,有{error}个文件丢失!") +sleep(1) +webbrowser.open("https://github.com/dengrb1/pip-helper") + +sleep(5) +exit() diff --git a/system.py b/old/system.py similarity index 100% rename from system.py rename to old/system.py diff --git a/system_command.py b/old/system_command.py similarity index 100% rename from system_command.py rename to old/system_command.py diff --git a/system_cz.py b/old/system_cz.py similarity index 100% rename from system_cz.py rename to old/system_cz.py diff --git a/new_system/update.py b/update.py similarity index 100% rename from new_system/update.py rename to update.py