Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions code/export-msaccess-sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, render_params=None, *args, **options):
self.scrollbar = ttk.Scrollbar(self.frame1, orient="vertical", command=self.tree.yview)
self.tree.configure(yscrollcommand=self.scrollbar.set)
self.create_widgets()
self.load_config('config.json',True)

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

def load_config(self, fpath='config.json'):
def load_config(self, fpath='config.json', loadbyinit = False):
try:
with open(fpath, 'r') as f:
config = json.load(f)
Expand All @@ -148,10 +149,12 @@ def load_config(self, fpath='config.json'):
self.update_widgets()
self.tree.df = self.tree.df.from_dict(config["tree"])
self.tree.rebuild_tree()
self.update_column_style()
self.tree.all_checked_update()
else:
raise
except:
if loadbyinit:
return
fpath = filedialog.askopenfilename(filetypes=[("JSON files", "*.json")])
if fpath:
self.load_config(fpath)
Expand Down