diff --git a/AutoShell/command/installdll b/AutoShell/command/installdll new file mode 100755 index 0000000..eb687c0 --- /dev/null +++ b/AutoShell/command/installdll @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv = i.replace(" ", "\\ ") +com = ConfigLanguareRunner.Command(f"installdll {''.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installfont b/AutoShell/command/installfont new file mode 100755 index 0000000..f3c3459 --- /dev/null +++ b/AutoShell/command/installfont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv = i.replace(" ", "\\ ") +com = ConfigLanguareRunner.Command(f"installfont {''.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installgecko b/AutoShell/command/installgecko new file mode 100755 index 0000000..3f72ecc --- /dev/null +++ b/AutoShell/command/installgecko @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv = i.replace(" ", "\\ ") +com = ConfigLanguareRunner.Command(f"installgecko {''.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installmono b/AutoShell/command/installmono new file mode 100755 index 0000000..cbd37e2 --- /dev/null +++ b/AutoShell/command/installmono @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv = i.replace(" ", "\\ ") +com = ConfigLanguareRunner.Command(f"installmono {''.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/command/installsparkcorefont b/AutoShell/command/installsparkcorefont new file mode 100755 index 0000000..4831931 --- /dev/null +++ b/AutoShell/command/installsparkcorefont @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv = i.replace(" ", "\\ ") +com = ConfigLanguareRunner.Command(f"installsparkcorefont {''.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/AutoShell/main.py b/AutoShell/main.py new file mode 100644 index 0000000..67fa435 --- /dev/null +++ b/AutoShell/main.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +import os +import sys +import time +import json +import platform + +# 读取文本文档 +def readtxt(path): + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(f"{programPath}/../information.json")) +version = information["Version"] +thankText = "" +for i in information["Thank"]: + thankText += f"{i}\n" +programEnv = [ + ["WINEPREFIX", f"{os.path.expanduser('~')}/.wine"], + ["WINE", "deepin-wine6-stable"], + ["DANGER", "0"], + ["PROGRAMPATH", programPath], + ["VERSION", version], + ["THANK", thankText.replace("\n", "\\n")], + ["MAKER", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["COPYRIGHT", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["PLATFORM", platform.system()], + ["DEBUG", str(int("--debug" in sys.argv))] +] +'''programEnv = [ + ["($WINEPREFIX)", f"{os.path.expanduser('~')}/.wine"], + ["($WINE)", "deepin-wine6-stable"], + ["($DANGER)", "0"], + ["($HOME)", os.path.expanduser('~')], + ["($PROGRAMPATH)", programPath], + ["($VERSION)", version], + ["($THANK)", thankText], + ["($MAKER)", "gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["($COPYRIGHT)", f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢"], + ["?", "0"], + ["PLATFORM)", platform.system()], + ["DEBUG)", str(int("--debug" in sys.argv))] +]''' +optionAll = 0 +if "--debug" in sys.argv: + optionAll += 1 +if "--system" in sys.argv: + programEnv.append(["DANGER", "1"]) + optionAll += 1 +if os.getenv("WINE") != None: + programEnv.append(["WINE", os.getenv("WINE")]) +if os.getenv("WINEPREFIX") != None: + programEnv.append(["WINE", os.getenv("WINEPREFIX")]) +# 生成可以使用的参数 +commandEnv = "" +for i in programEnv: + commandEnv += f"{i[0]}=\"{i[1]}\" " +commandEnv += f"PATH=\"$PATH:{programPath}/command\" " +if len(sys.argv) - optionAll < 2: + print("Wine 运行器自动配置文件解析器交互环境(基于 Bash)") + print(f"版本:{version}") + print(f"©2020~{time.strftime('%Y')} gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("--------------------------------------------------------------") + os.system(f"{commandEnv} bash") \ No newline at end of file diff --git a/__pycache__/ConfigLanguareRunner.cpython-37.pyc b/__pycache__/ConfigLanguareRunner.cpython-37.pyc new file mode 100644 index 0000000..f8ca55e Binary files /dev/null and b/__pycache__/ConfigLanguareRunner.cpython-37.pyc differ diff --git a/__pycache__/InstallDll.cpython-37.pyc b/__pycache__/InstallDll.cpython-37.pyc index ba86a66..6c5ab6e 100644 Binary files a/__pycache__/InstallDll.cpython-37.pyc and b/__pycache__/InstallDll.cpython-37.pyc differ diff --git a/__pycache__/InstallFont.cpython-37.pyc b/__pycache__/InstallFont.cpython-37.pyc index 7f2e1dd..7f0871e 100644 Binary files a/__pycache__/InstallFont.cpython-37.pyc and b/__pycache__/InstallFont.cpython-37.pyc differ