Compare commits
2 Commits
bd7191226f
...
8af5428b35
| Author | SHA1 | Date | |
|---|---|---|---|
| 8af5428b35 | |||
| f842646d25 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/build/
|
||||
/dist/
|
||||
@@ -1,20 +0,0 @@
|
||||
import os,sys
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
try:
|
||||
if not sys.argv[1] == "-c":
|
||||
# 判断当前目录有没有main.py
|
||||
|
||||
os.system("pip install pluginbase")
|
||||
if os.path.exists("main.py"):
|
||||
|
||||
os.system("python3 main.py")
|
||||
else:
|
||||
if os.path.exists("autozshell.zip"):
|
||||
os.system("unzip autozshell.zip")
|
||||
os.system("python3 main.py")
|
||||
except:
|
||||
pass
|
||||
|
||||
if sys.argv[1] == "-c":
|
||||
os.system("zip autozshell.zip *")
|
||||
Binary file not shown.
@@ -77,13 +77,7 @@ while True:
|
||||
with open(current_file_dir + "/" + "themetext", "r") as f:
|
||||
themetext = f.read()
|
||||
|
||||
# 获取当前用户和地址
|
||||
user = os.getlogin()
|
||||
address = os.getcwd()
|
||||
# 把inputtext这个变量里的{user}换成user变量
|
||||
inputtext = themetext.replace("{user}", user)
|
||||
# 把inputtext这个变量里的{address}换成address变量
|
||||
inputtext = inputtext.replace("{address}", address)
|
||||
inputtext = themetext
|
||||
|
||||
text1 = str(input(inputtext))
|
||||
if text1 == "exit":
|
||||
|
||||
2
main.py
2
main.py
@@ -1,7 +1,7 @@
|
||||
import configparser
|
||||
import sys,os
|
||||
import fun
|
||||
version = "1.5.0"
|
||||
version = "1.5.5"
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
if not os.path.exists(os.path.expanduser('~') + '/.ashrc'):
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import os
|
||||
theme_name = "default"
|
||||
theme_version = "1.0.0"
|
||||
head = "{user}@{address}$ "
|
||||
|
||||
import os
|
||||
user = os.getlogin()
|
||||
address = os.getcwd()
|
||||
head = f"\033[31m{user}\033[0m@\033[32m{address}\033[0m$ "
|
||||
|
||||
|
||||
# 获取当前文件的绝对路径
|
||||
current_file_path = os.path.abspath(__file__)
|
||||
|
||||
|
||||
18
theme/sus/theme.py
Normal file
18
theme/sus/theme.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
theme_name = "sus"
|
||||
theme_version = "1.0.0"
|
||||
|
||||
user = os.getlogin()
|
||||
address = os.getcwd()
|
||||
head = f"\033[31mSUS的{user}\033[0m@\033[32m{address}\033[0m$ "
|
||||
|
||||
# 获取当前文件的绝对路径
|
||||
current_file_path = os.path.abspath(__file__)
|
||||
|
||||
# 从绝对路径中提取目录
|
||||
current_file_dir = os.path.dirname(current_file_path)
|
||||
# 拼接成配置文件路径
|
||||
current_file_dir = current_file_dir.split("/")
|
||||
current_file_dir = "/".join(current_file_dir[:-1])
|
||||
with open(current_file_dir + "text", "w") as f:
|
||||
f.write(head)
|
||||
Reference in New Issue
Block a user