1
0
Fork 0

remove unused imports, cleanup

This commit is contained in:
JoshuaMK 2020-12-06 01:56:58 -06:00
parent 8e1bd5d38b
commit 41cc1ff98e
5 changed files with 9 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)
f.write(b'\x00'*(vSize-1) + b'\x01') if val is True else f.write(b'\x00' * vSize)

View file

@ -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)
dolFile.insert_branch(codeHandler.startAddress, address, lk=0)