all repos — m12-patcher @ 5ca994a538ae0cd9ced684b344799875cdcc5885

patcher.py (view raw)

 1#!/usr/bin/python3
 2import tkinter as tk
 3import os
 4import Constants
 5from Gui import PatcherApp
 6from Functions import check_rom, show_warning
 7
 8tools_path = os.path.join('.', 'tools')
 9alt_path = os.path.join(tools_path, 'alt')
10
11if __name__ == "__main__":
12    
13    if not os.path.isdir(alt_path):
14        show_warning(Constants.WARNING_EXTRACT)
15        exit()
16
17    baserom = None
18    for file in os.listdir('.'):
19        if file.lower().endswith('.gba'):
20            filename = os.path.join('.', file)
21            if(check_rom(filename)):
22                baserom = filename
23    
24    root = tk.Tk()
25    app = PatcherApp(root, baserom)
26    app.run()