Update to 6.0.1 #2
This commit is contained in:
12
config.py
12
config.py
@@ -31,10 +31,10 @@ class Config:
|
||||
path_search_order = (
|
||||
Path(path),
|
||||
Path.cwd() / "config.ini",
|
||||
Path.home() / "avdc.ini",
|
||||
Path.home() / ".avdc.ini",
|
||||
Path.home() / ".avdc/config.ini",
|
||||
Path.home() / ".config/avdc/config.ini"
|
||||
Path.home() / "mdc.ini",
|
||||
Path.home() / ".mdc.ini",
|
||||
Path.home() / ".mdc/config.ini",
|
||||
Path.home() / ".config/mdc/config.ini"
|
||||
)
|
||||
ini_path = None
|
||||
for p in path_search_order:
|
||||
@@ -79,9 +79,9 @@ class Config:
|
||||
ins = input("Or, Do you want me create a config file for you? (Yes/No)[Y]:")
|
||||
if re.search('n', ins, re.I):
|
||||
sys.exit(2)
|
||||
# 用户目录才确定具有写权限,因此选择 ~/avdc.ini 作为配置文件生成路径,而不是有可能并没有写权限的
|
||||
# 用户目录才确定具有写权限,因此选择 ~/mdc.ini 作为配置文件生成路径,而不是有可能并没有写权限的
|
||||
# 当前目录。目前版本也不再鼓励使用当前路径放置配置文件了,只是作为多配置文件的切换技巧保留。
|
||||
write_path = path_search_order[2] # Path.home() / "avdc.ini"
|
||||
write_path = path_search_order[2] # Path.home() / "mdc.ini"
|
||||
write_path.write_text(res_path.read_text(encoding='utf-8'), encoding='utf-8')
|
||||
print("Config file '{}' created.".format(write_path.resolve()))
|
||||
input("Press Enter key exit...")
|
||||
|
||||
Reference in New Issue
Block a user