-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
601 lines (504 loc) · 26.4 KB
/
main.py
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
import sys
import os
import traceback
import logging
from datetime import datetime
from PyQt6.QtWidgets import (
QApplication, QMainWindow, QMenuBar, QMenu, QFileDialog,
QDialog, QVBoxLayout, QLabel, QComboBox, QPushButton, QMessageBox, QTextEdit, QHBoxLayout, QWidget
)
from PyQt6.QtGui import QIcon, QAction, QClipboard
from PyQt6.QtCore import Qt, QThread, pyqtSignal, QObject
from pathlib import Path
from win11toast import toast
import inspect
import ctypes
# Настройка логирования
log_directory = Path("logs")
log_directory.mkdir(exist_ok=True)
log_filename = datetime.now().strftime("%Y-%m-%d_%H-%M-%S.log")
log_filepath = log_directory / log_filename
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler(log_filepath),
logging.StreamHandler()
]
)
class WorkerSignals(QObject):
result = pyqtSignal(object)
finished = pyqtSignal()
error = pyqtSignal(tuple)
class WorkerThread(QThread):
def __init__(self, function, *args):
super().__init__()
self.function = function
self.args = args
self.signals = WorkerSignals()
def run(self):
try:
logging.info("WorkerThread started")
result = self.function(*self.args)
self.signals.result.emit(result)
except Exception as e:
traceback_str = traceback.format_exc()
logging.error(f"Error in WorkerThread: {e}\n{traceback_str}")
self.signals.error.emit((e, traceback_str))
finally:
logging.info("WorkerThread finished")
self.signals.finished.emit()
class PlatformDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Select Platform")
self.selected_platform = None
self.selected_list_file = None
self.output_dir = None
layout = QVBoxLayout()
self.platform_label = QLabel("Select Platform:")
layout.addWidget(self.platform_label)
self.platform_combo = QComboBox()
self.platform_combo.addItems(["Steam (PC)", "Nintendo Switch", "PlayStation 4"])
layout.addWidget(self.platform_combo)
self.ok_button = QPushButton("OK")
self.ok_button.clicked.connect(self.accept)
layout.addWidget(self.ok_button)
self.setLayout(layout)
def accept(self):
self.selected_platform = self.platform_combo.currentText()
super().accept()
class GameSelectionDialog(QDialog):
def __init__(self, parent=None):
super().__init__(parent)
self.setWindowTitle("Select Game")
self.selected_game = None
layout = QVBoxLayout()
self.game_label = QLabel("Select Game:")
layout.addWidget(self.game_label)
self.game_combo = QComboBox()
self.game_combo.addItems([
"1 - original phoenix wright",
"2 - justice for all",
"3 - trials and tribulations",
"4 - apollo justice",
"5 - Gyakuten Saiban 1 (GBA)"
])
layout.addWidget(self.game_combo)
self.ok_button = QPushButton("OK")
self.ok_button.clicked.connect(self.accept)
layout.addWidget(self.ok_button)
self.setLayout(layout)
def accept(self):
self.selected_game = self.game_combo.currentIndex() + 1
super().accept()
class MainWindow(QMainWindow):
request_platform_and_unpack = pyqtSignal(Path)
def __init__(self):
super().__init__()
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
self.setWindowTitle("Henshuusha")
self.setGeometry(100, 100, 800, 600)
self.setWindowIcon(QIcon('icon.png'))
menubar = self.menuBar()
file_menu = menubar.addMenu('File')
open_menu = file_menu.addMenu('Open')
ds_menu = open_menu.addMenu('DS')
gs1234_menu = ds_menu.addMenu('GS1234')
extract_mes_action = QAction('mes_all.bin', self)
extract_mes_action.triggered.connect(self.extract_mes_all_bin)
gs1234_menu.addAction(extract_mes_action)
convert_text_action = QAction('Script Converter', self)
convert_text_action.triggered.connect(self.convert_text_messages)
gs1234_menu.addAction(convert_text_action)
ajt_menu = open_menu.addMenu('AJT')
pak_menu = ajt_menu.addMenu('PAK')
unpack_action = QAction('Unpack', self)
unpack_action.triggered.connect(self.unpack_pak)
pak_menu.addAction(unpack_action)
script_menu = ajt_menu.addMenu('Script')
gs56_decode_action = QAction('GS56 Decode', self)
gs56_decode_action.triggered.connect(self.decode_gs56_script)
script_menu.addAction(gs56_decode_action)
gs4_decode_action = QAction('GS4 Decode', self)
gs4_decode_action.triggered.connect(self.decode_gs4_script)
script_menu.addAction(gs4_decode_action)
save_menu = file_menu.addMenu('Save')
save_ajt_menu = save_menu.addMenu('AJT')
save_pak_menu = save_ajt_menu.addMenu('PAK')
create_pak_action = QAction('Create PAK', self)
create_pak_action.triggered.connect(self.create_pak)
save_pak_menu.addAction(create_pak_action)
save_script_menu = save_ajt_menu.addMenu('Script')
gs56_encode_action = QAction('GS56 Encode', self)
gs56_encode_action.triggered.connect(self.encode_gs56_script)
save_script_menu.addAction(gs56_encode_action)
gs4_encode_action = QAction('GS4 Encode', self)
gs4_encode_action.triggered.connect(self.encode_gs4_script)
save_script_menu.addAction(gs4_encode_action)
self.text_edit = QTextEdit(self)
self.text_edit.setReadOnly(True)
self.copy_path_button = QPushButton("Copy Path", self)
self.copy_path_button.clicked.connect(self.copy_path)
self.close_button = QPushButton("Close", self)
self.close_button.clicked.connect(self.close_text_edit)
button_layout = QHBoxLayout()
button_layout.addWidget(self.copy_path_button)
button_layout.addWidget(self.close_button)
main_layout = QVBoxLayout()
main_layout.addWidget(self.text_edit)
main_layout.addLayout(button_layout)
container = QWidget()
container.setLayout(main_layout)
self.setCentralWidget(container)
self.text_edit.setVisible(False)
self.copy_path_button.setVisible(False)
self.close_button.setVisible(False)
self.request_platform_and_unpack.connect(self.select_platform_and_unpack)
# Загрузите DLL
extract_mes_dll_path = os.path.join(os.path.dirname(__file__), 'req', 'DS', 'extract_mes_all_bin.dll')
self.extract_mes_all_bin = ctypes.CDLL(extract_mes_dll_path)
self.extract_mes_all_bin.main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)]
self.extract_mes_all_bin.main.restype = ctypes.c_int
convert_text_dll_path = os.path.join(os.path.dirname(__file__), 'req', 'DS', 'convert_text_messages.dll')
self.convert_text_messages = ctypes.CDLL(convert_text_dll_path)
self.convert_text_messages.main.argtypes = [ctypes.c_int, ctypes.POINTER(ctypes.c_char_p)]
self.convert_text_messages.main.restype = ctypes.c_int
def show_error_message(self, message):
logging.error(f"Error message: {message}")
QMessageBox.critical(self, "Error", message)
def unpack_pak(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Unpacking PAK file")
options = QFileDialog.Option.ReadOnly
file_name, _ = QFileDialog.getOpenFileName(self, "Open File", "", "PAK Files (*.pak)", options=options)
if file_name:
logging.info(f"Selected file: {file_name}")
self.worker_thread = WorkerThread(lambda: self.request_platform_and_unpack.emit(Path(file_name)))
self.worker_thread.signals.finished.connect(self.handle_unpack_finished)
self.worker_thread.signals.error.connect(self.handle_unpack_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error opening file: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_unpack_result(self, result):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info(f"Unpack result: {result}")
def handle_unpack_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Unpack finished")
toast("Unpacking Finished", "The unpacking process has been completed successfully.")
def handle_unpack_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"Unpack error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def select_platform_and_unpack(self, file_name):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Selecting platform and unpacking")
dialog = PlatformDialog(self)
if dialog.exec() == QDialog.DialogCode.Accepted:
selected_platform = dialog.selected_platform
logging.info(f"Selected platform: {selected_platform}")
output_dir = QFileDialog.getExistingDirectory(self, "Select Output Directory")
if output_dir:
logging.info(f"Selected output directory: {output_dir}")
list_path = Path(os.path.dirname(__file__)) / 'req' / 'list_path'
list_files = [f for f in list_path.iterdir() if f.suffix == '.list']
if selected_platform == "Steam (PC)":
selected_list_file = "steam.list"
elif selected_platform == "Nintendo Switch":
selected_list_file = "nsw.list"
elif selected_platform == "PlayStation 4":
selected_list_file = "ps4.list"
release_list_path = list_path / selected_list_file
from req.AJTTools.plugins.pak.src.Pak import REPak
pak = REPak(file_name)
self.worker_thread = WorkerThread(pak.unpack, Path(output_dir), release_list_path)
self.worker_thread.signals.finished.connect(self.handle_unpack_finished)
self.worker_thread.signals.error.connect(self.handle_unpack_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error selecting platform and unpacking: {e}")
raise
def decode_gs56_script(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Decoding GS56 script")
options = QFileDialog.Option.ReadOnly
file_names, _ = QFileDialog.getOpenFileNames(self, "Open File", "", "Script Files (*.user.2.*)", options=options)
if file_names:
logging.info(f"Selected files: {file_names}")
def decode():
from req.AJT56script import decode_script
results = []
for file_name in file_names:
output_file = Path(file_name).with_suffix('.json')
decode_script(file_name, output_file)
with open(output_file, 'r', encoding='utf-8') as f:
content = f.read()
results.append(content)
return results
self.worker_thread = WorkerThread(decode)
self.worker_thread.signals.result.connect(self.handle_decode_result)
self.worker_thread.signals.finished.connect(self.handle_decode_finished)
self.worker_thread.signals.error.connect(self.handle_decode_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error decoding script: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_decode_result(self, result):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
if result:
combined_content = "\n".join(result)
self.text_edit.setPlainText(combined_content)
self.text_edit.setVisible(True)
self.copy_path_button.setVisible(True)
self.close_button.setVisible(True)
QMessageBox.information(self, "Success", "Script decoding completed successfully!")
def handle_decode_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Decode finished")
toast("Decoding Finished", "The decoding process has been completed successfully.")
def handle_decode_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"Decode error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def encode_gs56_script(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Encoding GS56 script")
options = QFileDialog.Option.ReadOnly
file_names, _ = QFileDialog.getOpenFileNames(self, "Open File", "", "Script Files (*.json *.bin)", options=options)
if file_names:
logging.info(f"Selected files: {file_names}")
def encode():
from req.AJT56script import encode_script
results = []
for file_name in file_names:
output_file = Path(file_name).with_suffix('.bin')
encode_script(file_name, output_file)
with open(output_file, 'rb') as f:
content = f.read().decode('utf-8', errors='ignore')
results.append(content)
return results
self.worker_thread = WorkerThread(encode)
self.worker_thread.signals.result.connect(self.handle_encode_result)
self.worker_thread.signals.finished.connect(self.handle_encode_finished)
self.worker_thread.signals.error.connect(self.handle_encode_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error encoding script: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_encode_result(self, result):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
if result:
combined_content = "\n".join(result)
self.text_edit.setPlainText(combined_content)
self.text_edit.setVisible(True)
self.copy_path_button.setVisible(True)
self.close_button.setVisible(True)
QMessageBox.information(self, "Success", "Script encoding completed successfully!")
def handle_encode_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Encode finished")
toast("Encoding Finished", "The encoding process has been completed successfully.")
def handle_encode_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"Encode error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def decode_gs4_script(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Decoding GS4 script")
options = QFileDialog.Option.ReadOnly
file_names, _ = QFileDialog.getOpenFileNames(self, "Open File", "", "Script Files (*.user.2.*)", options=options)
if file_names:
logging.info(f"Selected files: {file_names}")
def decode():
from req.AJTTools.plugins.script import AA4Script
results = []
for file_name in file_names:
file_path = Path(file_name)
script = AA4Script(file_path)
output_file = file_path.with_suffix('.txt')
script.write_txt(output_file)
with open(output_file, 'r', encoding='utf-8') as f:
content = f.read()
results.append(content)
return results
self.worker_thread = WorkerThread(decode)
self.worker_thread.signals.result.connect(self.handle_decode_result)
self.worker_thread.signals.finished.connect(self.handle_decode_finished)
self.worker_thread.signals.error.connect(self.handle_decode_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error decoding script: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def encode_gs4_script(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Encoding GS4 script")
options = QFileDialog.Option.ReadOnly
file_names, _ = QFileDialog.getOpenFileNames(self, "Open File", "", "Script Files (*.txt)", options=options)
if file_names:
logging.info(f"Selected files: {file_names}")
def encode():
from req.AJTTools.plugins.script import AA4Script
results = []
for file_name in file_names:
file_path = Path(file_name)
script = AA4Script(file_path)
output_file = file_path.with_suffix('.user.2')
script.write_user2(output_file)
with open(output_file, 'rb') as f:
content = f.read().decode('utf-8', errors='ignore')
results.append(content)
return results
self.worker_thread = WorkerThread(encode)
self.worker_thread.signals.result.connect(self.handle_encode_result)
self.worker_thread.signals.finished.connect(self.handle_encode_finished)
self.worker_thread.signals.error.connect(self.handle_encode_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error encoding script: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def create_pak(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Creating PAK file")
options = QFileDialog.Option.ShowDirsOnly
dir_name = QFileDialog.getExistingDirectory(self, "Select Directory to Create PAK", options=options)
if dir_name:
logging.info(f"Selected directory to create PAK: {dir_name}")
output_file, _ = QFileDialog.getSaveFileName(self, "Save PAK File", "", "PAK Files (*.pak)")
if output_file:
logging.info(f"Selected output PAK file: {output_file}")
def build_pak(dir_path, pak_path):
from req.AJTTools.plugins.pak.src.Pak import build_pak_from_dir
build_pak_from_dir(dir_path, pak_path)
self.worker_thread = WorkerThread(build_pak, Path(dir_name), Path(output_file))
self.worker_thread.signals.finished.connect(self.handle_create_pak_finished)
self.worker_thread.signals.error.connect(self.handle_create_pak_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error creating PAK file: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_create_pak_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("PAK creation finished")
toast("PAK Creation Finished", "The PAK file has been created successfully.")
def handle_create_pak_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"PAK creation error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def copy_path(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Copying path to clipboard")
clipboard = QApplication.clipboard()
clipboard.setText(self.text_edit.toPlainText().split('\n')[0])
QMessageBox.information(self, "Success", "Path copied to clipboard!")
except Exception as e:
logging.error(f"Error copying path to clipboard: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def close_text_edit(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Closing text edit")
self.text_edit.setVisible(False)
self.copy_path_button.setVisible(False)
self.close_button.setVisible(False)
def extract_mes_all_bin(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Extracting mes_all.bin")
options = QFileDialog.Option.ReadOnly
file_name, _ = QFileDialog.getOpenFileName(self, "Open File", "", "BIN Files (*.bin)", options=options)
if file_name:
logging.info(f"Selected file: {file_name}")
# Получите директорию, где находится файл mes_all.bin
file_dir = os.path.dirname(file_name)
# Вызов C-кода
argc = 3
argv = (ctypes.c_char_p * argc)()
argv[0] = b"extract_mes_all_bin"
argv[1] = file_name.encode('utf-8')
argv[2] = file_dir.encode('utf-8')
self.worker_thread = WorkerThread(lambda: self.extract_mes_all_bin.main(argc, argv))
self.worker_thread.signals.finished.connect(self.handle_extract_finished)
self.worker_thread.signals.error.connect(self.handle_extract_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error extracting mes_all.bin: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_extract_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Extract finished")
toast("Extract Finished", "The extraction process has been completed successfully.")
def handle_extract_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"Extract error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def convert_text_messages(self):
try:
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Converting text messages")
options = QFileDialog.Option.ShowDirsOnly
dir_name = QFileDialog.getExistingDirectory(self, "Select Directory with Scripts", options=options)
if dir_name:
logging.info(f"Selected directory: {dir_name}")
# Вызов диалога выбора игры
game_dialog = GameSelectionDialog(self)
if game_dialog.exec() == QDialog.DialogCode.Accepted:
selected_game = game_dialog.selected_game
logging.info(f"Selected game: {selected_game}")
# Вызов C-кода
argc = 3
argv = (ctypes.c_char_p * argc)()
argv[0] = b"convert_text_messages"
argv[1] = dir_name.encode('utf-8')
argv[2] = str(selected_game).encode('utf-8')
self.worker_thread = WorkerThread(lambda: self.convert_text_messages.main(argc, argv))
self.worker_thread.signals.finished.connect(self.handle_convert_finished)
self.worker_thread.signals.error.connect(self.handle_convert_error)
self.worker_thread.start()
except Exception as e:
logging.error(f"Error converting text messages: {e}")
self.show_error_message(f"An error occurred: {e}")
traceback.print_exc()
def handle_convert_finished(self):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Convert finished")
toast("Convert Finished", "The conversion process has been completed successfully.")
def handle_convert_error(self, error):
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
e, traceback_str = error
logging.error(f"Convert error: {e}\n{traceback_str}")
self.show_error_message(f"An error occurred: {e}")
def set_taskbar_icon(icon_path):
# Устанавливаем иконку для приложения в панели задач
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(f"mycompany.myproduct.subproduct.{icon_path}")
def main():
logging.info(f"Executing: {inspect.currentframe().f_lineno}")
logging.info("Starting application")
app = QApplication(sys.argv)
set_taskbar_icon('icon.png')
window = MainWindow()
window.show()
sys.exit(app.exec())
if __name__ == '__main__':
main()