Skip to content

Commit fa0c137

Browse files
committed
1.3.x load config.json by init
1 parent c797a72 commit fa0c137

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

code/export-msaccess-sql.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __init__(self, render_params=None, *args, **options):
4444
self.scrollbar = ttk.Scrollbar(self.frame1, orient="vertical", command=self.tree.yview)
4545
self.tree.configure(yscrollcommand=self.scrollbar.set)
4646
self.create_widgets()
47+
self.load_config('config.json',True)
4748

4849
def create_widgets(self):
4950
"""Building the main widgets at the beginning of program execution"""
@@ -139,7 +140,7 @@ def save_config(self):
139140
with open('config.json', 'w') as f:
140141
json.dump(config, f, indent = 4)
141142

142-
def load_config(self, fpath='config.json'):
143+
def load_config(self, fpath='config.json', loadbyinit = False):
143144
try:
144145
with open(fpath, 'r') as f:
145146
config = json.load(f)
@@ -148,10 +149,12 @@ def load_config(self, fpath='config.json'):
148149
self.update_widgets()
149150
self.tree.df = self.tree.df.from_dict(config["tree"])
150151
self.tree.rebuild_tree()
151-
self.update_column_style()
152+
self.tree.all_checked_update()
152153
else:
153154
raise
154155
except:
156+
if loadbyinit:
157+
return
155158
fpath = filedialog.askopenfilename(filetypes=[("JSON files", "*.json")])
156159
if fpath:
157160
self.load_config(fpath)

0 commit comments

Comments
 (0)