diff --git a/GeckoLoader.py b/GeckoLoader.py index 2c61614..891d745 100644 --- a/GeckoLoader.py +++ b/GeckoLoader.py @@ -9,7 +9,7 @@ import shutil import signal import sys import tempfile -from contextlib import redirect_stdout, redirect_stderr +from contextlib import redirect_stderr, redirect_stdout from distutils.version import LooseVersion from io import StringIO from pathlib import Path @@ -18,7 +18,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets from children_ui import PrefWindow, SettingsWindow from dolreader import DolFile -from fileutils import resource_path, get_program_folder +from fileutils import get_program_folder, resource_path from kernel import CodeHandler, KernelLoader from main_ui import MainWindow from tools import CommandLineParser, color_text diff --git a/children_ui.py b/children_ui.py index ba943b8..2086669 100644 --- a/children_ui.py +++ b/children_ui.py @@ -1,4 +1,3 @@ -import os import sys from PyQt5 import QtCore, QtGui, QtWidgets @@ -17,7 +16,7 @@ class PrefWindow(QtWidgets.QDialog): self.setFixedSize(300, 120) self.setModal(True) icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(str(resource_path(os.path.join("bin", "icon.ico")))), QtGui.QIcon.Normal, QtGui.QIcon.Off) + icon.addPixmap(QtGui.QPixmap(str(resource_path("bin/icon.ico"))), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.setWindowIcon(icon) #Buttonbox diff --git a/dolreader.py b/dolreader.py index 7b7ef5c..8249bee 100644 --- a/dolreader.py +++ b/dolreader.py @@ -1,7 +1,7 @@ from io import BytesIO import tools -from fileutils import read_uint32, write_uint32, align_byte_size +from fileutils import align_byte_size, read_uint32, write_uint32 class UnmappedAddressError(Exception): pass class SectionCountFullError(Exception): pass diff --git a/fileutils.py b/fileutils.py index 6b1bffa..cd087b5 100644 --- a/fileutils.py +++ b/fileutils.py @@ -1,7 +1,5 @@ -import os import struct import sys - from pathlib import Path from tools import align_byte_size, get_alignment @@ -84,4 +82,4 @@ def read_bool(f, vSize=1): return struct.unpack("B", f.read(vSize))[0] > 0 def write_bool(f, val, vSize=1): - f.write(b'\x00'*(vSize-1) + b'\x01') if val is True else f.write(b'\x00' * vSize) \ No newline at end of file + f.write(b'\x00'*(vSize-1) + b'\x01') if val is True else f.write(b'\x00' * vSize) diff --git a/kernel.py b/kernel.py index 9446d7d..9e0f8e7 100644 --- a/kernel.py +++ b/kernel.py @@ -1,16 +1,15 @@ -import os +import functools import random import re import sys import time -import functools - from io import BytesIO from pathlib import Path import tools -from fileutils import read_uint16, read_uint32, write_bool, write_ubyte, write_uint16, write_uint32, write_sint32, get_alignment from dolreader import DolFile, SectionCountFullError, UnmappedAddressError +from fileutils import (get_alignment, read_uint16, read_uint32, write_bool, + write_sint32, write_ubyte, write_uint16, write_uint32) try: import chardet @@ -663,4 +662,4 @@ def insert_code_hook(dolFile: DolFile, codeHandler: CodeHandler, address: int): raise NotImplementedError(tools.color_text("Hooking the codehandler to a conditional non spr branch is unsupported", defaultColor=tools.TREDLIT)) dolFile.seek(-4, 1) - dolFile.insert_branch(codeHandler.startAddress, address, lk=0) \ No newline at end of file + dolFile.insert_branch(codeHandler.startAddress, address, lk=0)