Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
删去冗余标志。
Browse files Browse the repository at this point in the history
修复设置面板未正常禁用的问题。
  • Loading branch information
jiaojiaodubai23 committed Sep 26, 2023
1 parent a2620fd commit 001de5b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ class Initializer:
version_exist = {'JianyingPro': False, 'CapCut': False}
version_choose: str

def __init__(self, first_time: bool = False):
def __init__(self):
self.install_path = PathX('public', 'install_path', '安装路径')
self.draft_path = PathX('public', 'draft_path', '草稿路径')
self.Data_path = PathX('public', 'Data_path', 'Data路径')
self.read_path(first_time=first_time)
self.read_path()

def batch_paths(self, appendix=None):
if appendix is None:
Expand All @@ -109,7 +109,7 @@ def write_path(self, appendix=None):
with open(r'.\config.ini', 'w', encoding='utf-8') as f:
self.configer.write(f)

def read_path(self, first_time: bool = False) -> bool:
def read_path(self) -> bool:
"""
读取config.ini的默认配置,若存在则写入p.paths,若不存在则创建config.ini并增加相应节点。
Returns:
Expand All @@ -120,7 +120,7 @@ def read_path(self, first_time: bool = False) -> bool:
self.configer.read(r'.\config.ini', encoding='utf-8')
try:
for key in list(self.version_exist.keys()):
self.version_exist[key] = self.configer['setting'][key]
self.version_exist[key] = self.configer['setting'].getboolean(key)
self.version_choose = self.configer['setting']['version_choose']
except KeyError:
self.reset_ini()
Expand Down Expand Up @@ -243,7 +243,7 @@ def __init__(self, master: Misc, label: Label):
super().__init__(master=master, width=560, height=155)
# 模块
self.message = label
self.p = Initializer(first_time=True)
self.p = Initializer()
# 部分组件创建时依赖预配置,因此先读取配置

# 草稿行
Expand Down

0 comments on commit 001de5b

Please sign in to comment.