-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBMT.pyw
625 lines (499 loc) · 25.8 KB
/
BMT.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
import os
import sys
import json
import shutil
import zipfile
import demjson3
import tempfile
import threading
import traceback
import subprocess
import tkinter as tk
from datetime import datetime
from zipfile import BadZipFile
from collections import Counter
from tkinter import ttk, filedialog, messagebox, simpledialog
class MergeToolGUI:
def __init__(s):
appdata_dir = os.path.join(os.getenv('LOCALAPPDATA'), 'BMT')
os.makedirs(appdata_dir, exist_ok=True)
s.settings_file = os.path.join(appdata_dir, 'settings.cfg')
if not os.path.exists(s.settings_file):
open(s.settings_file, 'a').close()
s.last_files_folder = s.load_last_folder("last_files_folder")
s.last_save_folder = s.load_last_folder("last_save_folder")
s.dir = os.path.dirname(os.path.abspath(__file__))
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
s.theme_path = sys._MEIPASS + '\\azure.tcl'
s.icon_path = sys._MEIPASS + '\\icon.ico'
else:
s.theme_path = os.path.join(s.dir, 'azure.tcl')
s.icon_path = os.path.join(s.dir, 'icon.ico')
s.var_files = []
s.artist_name = ""
s.package_name = ""
s.version_number = ""
s.output_file = ""
s.merge_thread = None
button_width = 20
wide_button_width = 25
s.root = tk.Tk()
s.root.title("BlafKing's .var Merge Tool (BMT)")
s.root.minsize(650, 500)
s.root.pack_propagate(False)
s.root.tk.call("source", s.theme_path)
s.root.tk.call("set_theme", "dark")
s.root.iconbitmap(default=s.icon_path)
s.button_style = ttk.Style()
s.file_frame = ttk.Frame(s.root)
s.file_frame.pack(fill=tk.BOTH, expand=True, padx=10, pady=(10, 5))
s.file_list_label = ttk.Label(s.file_frame, text="Selected Files:")
s.file_list_label.pack(anchor=tk.W)
s.file_scrollbar = ttk.Scrollbar(s.file_frame, orient=tk.VERTICAL)
s.file_scrollbar.pack(side=tk.RIGHT, fill=tk.Y)
s.file_listbox = tk.Listbox(s.file_frame, selectmode=tk.MULTIPLE, width=60, height=5, state="normal")
s.file_listbox.configure(exportselection=False)
s.file_listbox.bind("<<ListboxSelect>>", lambda event: s.file_listbox.selection_clear(0, tk.END))
s.file_listbox.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
s.file_listbox.config(yscrollcommand=s.file_scrollbar.set)
s.file_scrollbar.config(command=s.file_listbox.yview)
s.add_file_button = ttk.Button(s.root, text="Select Files", command=s.select_var_files, width=wide_button_width)
s.add_file_button.pack(padx=10, pady=(5, 2))
s.save_frame = ttk.Frame(s.root)
s.save_frame.pack(fill=tk.X, padx=10, pady=(10, 5))
s.save_label = ttk.Label(s.save_frame, text="Save Location:")
s.save_label.pack(side=tk.LEFT, anchor=tk.W)
s.save_entry = ttk.Entry(s.save_frame, width=60, state="normal")
s.save_entry.bind("<FocusIn>", lambda event: s.save_entry.selection_range(0, tk.END))
s.save_entry.bind("<Key>", lambda event: "break")
s.save_entry.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(5, 0))
s.save_button = ttk.Button(s.save_frame, text="Choose", command=s.choose_save_location)
s.save_button.pack(side=tk.LEFT, padx=(5, 0))
s.edit_frame = ttk.Frame(s.root)
s.edit_frame.pack(fill=tk.X, padx=50, pady=(10, 0))
s.edit_artist_button = ttk.Button(s.edit_frame, text="Edit Artist Name", command=s.edit_artist_name, width=button_width)
s.edit_artist_button.pack(side=tk.LEFT, pady=(5, 0))
s.edit_version_button = ttk.Button(s.edit_frame, text="Edit Version Number", command=s.edit_version_number, width=button_width)
s.edit_version_button.pack(side=tk.RIGHT, pady=(5, 0))
s.edit_package_button = ttk.Button(s.edit_frame, text="Edit Package Name", command=s.edit_package_name, width=button_width)
s.edit_package_button.pack(pady=(5, 0))
s.merge_frame = ttk.Frame(s.root)
s.merge_frame.pack(fill=tk.X, padx=0, pady=(15, 0))
s.checkboxes_frame = ttk.Frame(s.merge_frame)
s.checkboxes_frame.pack(side=tk.LEFT, padx=(12, 0))
s.openFolder = tk.IntVar()
s.openFolder.set(s.load_checkbox_state(1))
s.merge_checkbox1 = ttk.Checkbutton(s.checkboxes_frame, variable=s.openFolder, command=s.update_checkbox_state)
s.merge_checkbox1.pack(side=tk.TOP)
s.closeProgram = tk.IntVar()
s.closeProgram.set(s.load_checkbox_state(2))
s.merge_checkbox2 = ttk.Checkbutton(s.checkboxes_frame, variable=s.closeProgram, command=s.update_checkbox_state)
s.merge_checkbox2.pack(side=tk.TOP)
s.updateMeta = tk.IntVar()
s.updateMeta.set(s.load_checkbox_state(3))
s.merge_checkbox3 = ttk.Checkbutton(s.checkboxes_frame, variable=s.updateMeta, command=s.update_checkbox_state)
s.merge_checkbox3.pack(side=tk.TOP)
s.labels_frame = ttk.Frame(s.merge_frame)
s.labels_frame.pack(side=tk.LEFT)
label1 = ttk.Label(s.labels_frame, text="Open folder after merge", anchor=tk.W)
label1.pack(side=tk.TOP, anchor=tk.W)
label2 = ttk.Label(s.labels_frame, text="Exit program after merge", anchor=tk.W)
label2.pack(side=tk.TOP, anchor=tk.W, pady=(7, 7))
label3 = ttk.Label(s.labels_frame, text="Set dependencies to .latest", anchor=tk.W)
label3.pack(side=tk.TOP, anchor=tk.W, pady=(0, 2))
s.button_frame = ttk.Frame(s.merge_frame)
s.button_frame.pack(side=tk.LEFT, fill=tk.X, expand=True)
s.merge_button = ttk.Button(s.button_frame, text="Merge Files", command=s.start_merge, width=wide_button_width)
s.merge_button.pack(padx=(0, 200))
s.progress_label = ttk.Label(s.root, text="")
s.progress_label.pack()
s.progressbar = ttk.Progressbar(s.root, orient=tk.HORIZONTAL, mode='determinate')
s.progressbar.pack(side=tk.BOTTOM, fill=tk.X, padx=10, pady=5)
s.disable_buttons_init()
def run(s):
s.root.mainloop()
def load_checkbox_state(s, checkbox_index):
with open(s.settings_file, 'r') as f:
try:
settings = json.load(f)
checkbox_state = settings.get(f"checkbox{checkbox_index}")
if checkbox_state is not None:
return checkbox_state
except (ValueError, json.JSONDecodeError):
pass
return 0
def update_checkbox_state(s):
openFolder_state = s.openFolder.get()
closeProgram_state = s.closeProgram.get()
updateMeta_state = s.updateMeta.get()
with open(s.settings_file, 'r') as f:
try:
settings = json.load(f)
except (ValueError, json.JSONDecodeError):
settings = {}
settings["checkbox1"] = openFolder_state
settings["checkbox2"] = closeProgram_state
settings["checkbox3"] = updateMeta_state
with open(s.settings_file, 'w') as f:
json.dump(settings, f)
def select_var_files(s):
file_paths = filedialog.askopenfilenames(filetypes=[("VAR Files", "*.var")], initialdir=s.last_files_folder)
if file_paths:
s.var_files = list(file_paths)
s.display_selected_files()
s.enable_buttons_file()
folder_path = os.path.dirname(s.var_files[0])
s.save_last_folder("last_files_folder", folder_path)
s.update_artist_name()
s.save_entry.delete(0, tk.END)
s.output_file = ""
s.last_files_folder = folder_path
def display_selected_files(s):
s.file_listbox.delete(0, tk.END)
for file in s.var_files:
s.file_listbox.insert(tk.END, file)
s.update_save_location()
def choose_save_location(s):
folder_path = filedialog.askdirectory(initialdir=s.last_save_folder)
if folder_path:
package_name = f"{s.artist_name}.{s.package_name}.{s.version_number}"
s.output_file = os.path.normpath(os.path.join(folder_path, package_name + ".var"))
s.save_entry.delete(0, tk.END)
s.save_entry.insert(tk.END, s.output_file)
s.SaveLocation = False
s.enable_buttons()
s.save_last_folder("last_save_folder", folder_path)
s.update_artist_name()
s.last_save_folder = folder_path
def update_artist_name(s):
artist_name_counts = Counter()
for file_path in s.var_files:
file_name = os.path.basename(file_path)
artist_name = file_name.split(".")[0]
artist_name_counts[artist_name] += 1
artist = artist_name_counts.most_common(1)
s.artist_name = artist[0][0] if artist else ""
s.update_save_location()
def edit_artist_name(s):
artist_name = s.get_user_input("Enter the new artist name:", default_text=s.artist_name)
if artist_name:
s.artist_name = artist_name.replace(" ", "_")
s.update_save_location()
def edit_package_name(s):
package_name = s.get_user_input("Enter the new package name:", default_text=s.package_name)
if package_name:
s.package_name = package_name.replace(" ", "_")
s.update_save_location()
def edit_version_number(s):
version_number = s.get_user_input("Enter the new version number:", default_text=s.version_number)
if version_number.replace('.', '', 1).isdigit():
s.version_number = version_number
s.update_save_location()
def get_user_input(s, prompt, default_text=None):
root = tk.Tk()
root.withdraw()
initial_value = default_text if default_text is not None else ""
user_input = simpledialog.askstring("Input", prompt, initialvalue=initial_value)
if user_input:
valid_input = ''.join(char for char in user_input if s.validate_input(char))
return valid_input.strip() if valid_input else None
else:
return None
def validate_input(s, char):
disallowed_chars = r'<>:"/\|?*'
if char in disallowed_chars:
return False
return True
def save_last_folder(s, folder_name, folder_path):
if not os.path.isfile(s.settings_file):
settings = {}
else:
with open(s.settings_file, 'r') as f:
try:
settings = json.load(f)
except (ValueError, json.JSONDecodeError):
settings = {}
settings[folder_name] = folder_path
with open(s.settings_file, 'w') as f:
json.dump(settings, f)
def load_last_folder(s, folder_name):
if not os.path.isfile(s.settings_file):
return ""
with open(s.settings_file, 'r') as f:
try:
settings = json.load(f)
return settings.get(folder_name, "")
except (ValueError, json.JSONDecodeError):
return ""
def update_save_location(s):
if not s.artist_name:
artist_name_counts = Counter()
for file_path in s.var_files:
file_name = os.path.basename(file_path)
artist_name = file_name.split(".")[0]
artist_name_counts[artist_name] += 1
artist = artist_name_counts.most_common(1)
s.artist_name = artist[0][0] if artist else ""
if not s.package_name:
s.package_name = "Package"
if not s.version_number:
s.version_number = "1"
package_name = f"{s.artist_name}.{s.package_name}.{s.version_number}"
s.output_file = os.path.normpath(os.path.join(os.path.dirname(s.output_file), package_name + ".var"))
s.save_entry.delete(0, tk.END)
s.save_entry.insert(tk.END, s.output_file)
def set_button_state(s, add_file_state, add_file_color, save_state, save_color, other_state, other_color):
s.add_file_button.config(state=add_file_state, style=add_file_color)
s.save_button.config(state=save_state, style=save_color)
s.edit_artist_button.config(state=other_state, style=other_color)
s.edit_version_button.config(state=other_state, style=other_color)
s.edit_package_button.config(state=other_state, style=other_color)
s.merge_button.config(state=other_state, style=other_color)
s.merge_checkbox1.config(state=add_file_state)
s.merge_checkbox2.config(state=add_file_state)
s.merge_checkbox3.config(state=add_file_state)
def disable_buttons_init(s):
s.button_style.configure("White.TButton", foreground="white")
s.button_style.configure("Grey.TButton", foreground="grey")
s.button_style.map("Grey.TButton",
foreground=[("disabled", "grey")],
background=[("disabled", "!focus", "grey")])
s.set_button_state(tk.NORMAL, "White.TButton",
tk.DISABLED, "Grey.TButton",
tk.DISABLED, "Grey.TButton")
def disable_buttons(s):
s.set_button_state(tk.DISABLED, "Grey.TButton",
tk.DISABLED, "Grey.TButton",
tk.DISABLED, "Grey.TButton")
def enable_buttons(s):
s.set_button_state(tk.NORMAL, "White.TButton",
tk.NORMAL, "White.TButton",
tk.NORMAL, "White.TButton")
def enable_buttons_file(s):
s.set_button_state(tk.NORMAL, "White.TButton",
tk.NORMAL, "White.TButton",
tk.DISABLED, "Grey.TButton")
def clean_window(s):
s.file_listbox.delete(0, tk.END)
s.var_files = []
s.save_entry.delete(0, tk.END)
s.output_file = ""
s.progress_label.configure(text="")
s.progressbar["value"] = 0
def start_merge(s):
if len(s.var_files) == 0:
messagebox.showinfo("Error", "No files selected.")
return
if not s.output_file:
messagebox.showinfo("Error", "No save location provided.")
return
if s.merge_thread is None or not s.merge_thread.is_alive():
s.disable_buttons()
s.progressbar["maximum"] = len(s.var_files)
s.progressbar["value"] = 0
s.merge_thread = threading.Thread(target=s.merge_files_thread)
s.merge_thread.start()
def merge_files_thread(s):
artist_name_counts = Counter()
for file_path in s.var_files:
file_name = os.path.basename(file_path)
artist_name = file_name.split(".")[0]
artist_name_counts[artist_name] += 1
artist = artist_name_counts.most_common(1)
s.artist_name = artist[0][0] if artist else ""
s.merge_files()
def load_valid_json_file(s, file_path, temp_dir):
try:
with open(file_path, 'r', encoding='utf-8-sig') as f:
return json.load(f)
except (ValueError, json.JSONDecodeError):
print(f"Error with {file_path}, Attempting fix.")
with open(file_path, 'r', encoding='utf-8-sig') as f:
content = f.read()
index = content.find('contentList')
if index != -1:
content = content[:index] + content[index:].replace('\\', '/')
content = content[:index] + content[index:].replace('//', '/')
lines = content.split('\n')
i = 0
while i < len(lines) - 4:
line = lines[i]
next_line = lines[i + 1]
third_line = lines[i + 2]
fourth_line = lines[i + 3]
if line.strip().startswith('"') and line.count('/') >= 2 and next_line.strip() == '},' and third_line.strip().startswith('"'):
lines[i + 1] = '],'
if line.strip().startswith('"') and line.count('/') >= 2 and next_line.strip().startswith('"') and line.count('/') >= 2:
if not line.strip().endswith('",'):
if line.strip().endswith('"'):
lines[i] = line.rstrip() + ','
else:
lines[i] = line.rstrip() + '",'
if line.strip().endswith(',') and next_line.strip() == '}' and third_line.strip() == '},' and fourth_line.strip().startswith('"customOptions'):
lines[i] = line.rstrip()[:-1]
if line.strip().endswith('{') and next_line.strip() == '}' and third_line.strip() == '},' and fourth_line.strip().startswith('"customOptions'):
indentation = '\t' * (line.count('\t') - 1)
new_line = f'{indentation}}},'
third_line.rstrip(',')
lines.insert(i + 3, new_line)
if line.strip().endswith('}') and next_line.strip() == '}' and third_line.strip() == '},' and fourth_line.strip().startswith('"customOptions'):
lines.pop(i + 1)
if line.strip().endswith('"') and len(next_line.strip()) > 0 and next_line.strip()[0] == '"':
lines[i] = line.rstrip() + ','
i += 1
content = '\n'.join(lines)
try:
fixed_json = demjson3.decode(content)
print(f"{file_path} has been successfully fixed.")
return fixed_json
except demjson3.JSONDecodeError as e:
print("Unable to fix JSON:", e)
return None
except:
return None
def merge_files(s):
try:
appdata_dir = os.path.join(os.getenv('LOCALAPPDATA'), 'BMT')
combined_content_list = set()
combined_dependencies = {}
existing_files = set()
highest_program_version = None
unusable_files = []
for i, file_path in enumerate(s.var_files):
s.progress_label.configure(text=f"Checking files: {file_path}")
try:
with zipfile.ZipFile(file_path, 'r') as zip_ref:
file_list = zip_ref.namelist()
for file_name in file_list:
try:
zip_ref.open(file_name)
except BadZipFile:
unusable_files.append(file_path)
break
except Exception as e:
unusable_files.append(file_path)
if unusable_files:
response = messagebox.askquestion(
"Unable to process",
f"The following files are unable to be processed:\n\n{unusable_files}\n\nDo you want to continue without them?"
)
if response == 'no':
os._exit(0)
output_drive = os.path.splitdrive(s.output_file)[0]
with zipfile.ZipFile(s.output_file, 'w', zipfile.ZIP_DEFLATED) as zipf:
for i, file_path in enumerate(s.var_files):
if file_path in unusable_files:
continue
s.progress_label.configure(text=f"Merging files: {file_path}")
temp_dir = tempfile.mkdtemp(dir=output_drive)
with zipfile.ZipFile(file_path, 'r') as zip_ref:
zip_ref.extractall(temp_dir)
meta_file = os.path.join(temp_dir, "meta.json")
meta_data = s.load_valid_json_file(meta_file, temp_dir)
if meta_data is None:
unusable_files.append(file_path)
continue
combined_content_list.update(meta_data.get("contentList", []))
dependencies = meta_data.get("dependencies")
if dependencies:
for dep, dep_data in dependencies.items():
dep_license_type = dep_data.get("licenseType")
combined_dependencies.setdefault(dep, {}).update({
"licenseType": dep_license_type,
"dependencies": dep_data.get("dependencies", {})
})
program_version = meta_data.get("programVersion")
if program_version and (highest_program_version is None or program_version > highest_program_version):
highest_program_version = program_version
for root, dirs, files in os.walk(temp_dir):
for file in files:
if file == "meta.json":
continue
file_path = os.path.join(root, file)
rel_path = os.path.relpath(file_path, temp_dir)
if rel_path in existing_files:
continue
existing_files.add(rel_path)
zipf.write(file_path, rel_path)
shutil.rmtree(temp_dir)
s.update_progress(i + 1)
combined_content_list = sorted(combined_content_list)
combined_dependencies = dict(sorted(combined_dependencies.items()))
combined_meta_data = {
"licenseType": "PC",
"creatorName": s.artist_name,
"packageName": s.package_name,
"standardReferenceVersionOption": "Latest",
"scriptReferenceVersionOption": "Exact",
"description": "This Package has been merged by BlafKing's Merge Tool",
"credits": "",
"instructions": "",
"promotionalLink": "",
"programVersion": highest_program_version,
"contentList": combined_content_list,
"dependencies": combined_dependencies,
"customOptions": {"preloadMorphs": "false"},
"hadReferenceIssues": "false",
"referenceIssues": []
}
temp_meta_file = os.path.join(appdata_dir, "temp_meta.json")
with open(temp_meta_file, 'w') as file:
json.dump(combined_meta_data, file, indent=3)
if s.updateMeta.get() == 1:
optimized_meta = s.setToLatest(temp_meta_file)
else:
with open(temp_meta_file, 'r') as file:
optimized_meta = json.load(file)
with zipfile.ZipFile(s.output_file, 'a', zipfile.ZIP_DEFLATED) as zipf:
zipf.writestr("meta.json", json.dumps(optimized_meta, indent=3))
os.remove(temp_meta_file)
s.progress_label.configure(text=f"Merging completed!")
if unusable_files:
messagebox.showinfo(
"Merge Complete",
f"The following files were unable to be processed and are not included in the final package:\n\n{unusable_files}"
)
else:
messagebox.showinfo("Merge Complete", "All files merged successfully.")
if s.openFolder.get() == 1:
subprocess.Popen(f'explorer /select,"{s.output_file}"')
if s.closeProgram.get() == 1:
os._exit(0)
else:
s.clean_window()
s.disable_buttons_init()
return
except Exception as e:
error_message = f"Exception occurred during merge:\n{traceback.format_exc()}"
current_file = s.var_files[s.progressbar["value"] - 1]
error_message += f"\n\nError occurred in file: {current_file}"
current_datetime = datetime.now().strftime("%Y%m%d-%H%M%S")
errorlog_filename = f"Error_{current_datetime}.txt"
errorlog_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), errorlog_filename)
with open(errorlog_path, "w") as errorlog_file:
errorlog_file.write(error_message)
messagebox.showerror("Merge Error", f"An error occurred during the merge process. Error log saved to: {errorlog_path}")
shutil.rmtree(temp_dir)
os._exit(1)
def setToLatest(s, meta_file):
with open(meta_file, 'r') as file:
data = json.load(file)
dependencies = data.get('dependencies', {})
optimized_data = data.copy()
def rename_dependencies(dep_dict):
for dep_name, dep_data in dep_dict.copy().items():
package_name, version = dep_name.rsplit('.', 1)
package_name_latest = package_name + '.latest'
if package_name_latest != dep_name:
dep_dict[package_name_latest] = dep_dict.pop(dep_name)
nested_dependencies = dep_data.get('dependencies', {})
if nested_dependencies:
rename_dependencies(nested_dependencies)
rename_dependencies(dependencies)
return optimized_data
def update_progress(s, value):
s.progressbar["value"] = value
s.root.update_idletasks()
if __name__ == "__main__":
merge_tool_gui = MergeToolGUI()
merge_tool_gui.run()