From d671939c418487722023ba830de7d50b6959ff44 Mon Sep 17 00:00:00 2001 From: Viv Date: Fri, 2 Jun 2023 16:35:05 -0400 Subject: [PATCH] Use explicit importing over relative importing Helps when the package is used by a different script --- tja2fumen/converters.py | 4 ++-- tja2fumen/main.py | 8 ++++---- tja2fumen/parsers.py | 4 ++-- tja2fumen/utils.py | 2 +- tja2fumen/writers.py | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tja2fumen/converters.py b/tja2fumen/converters.py index 167e1ed..10416bc 100644 --- a/tja2fumen/converters.py +++ b/tja2fumen/converters.py @@ -1,7 +1,7 @@ from copy import deepcopy -from utils import computeSoulGaugeByte -from constants import TJA_NOTE_TYPES, DIFFICULTY_BYTES, unknownHeaderSample +from tja2fumen.utils import computeSoulGaugeByte +from tja2fumen.constants import TJA_NOTE_TYPES, DIFFICULTY_BYTES, unknownHeaderSample # Filler metadata that the `writeFumen` function expects default_note = {'type': '', 'pos': 0.0, 'item': 0, 'padding': 0.0, diff --git a/tja2fumen/main.py b/tja2fumen/main.py index 06035d0..d43e0b9 100644 --- a/tja2fumen/main.py +++ b/tja2fumen/main.py @@ -1,7 +1,7 @@ -from parsers import readFumen, parseTJA -from writers import writeFumen -from converters import convertTJAToFumen -from utils import checkMismatchedBytes +from tja2fumen.parsers import readFumen, parseTJA +from tja2fumen.writers import writeFumen +from tja2fumen.converters import convertTJAToFumen +from tja2fumen.utils import checkMismatchedBytes tja2fumen_version = "v0.1" diff --git a/tja2fumen/parsers.py b/tja2fumen/parsers.py index 8d0ab65..0094ed2 100644 --- a/tja2fumen/parsers.py +++ b/tja2fumen/parsers.py @@ -1,8 +1,8 @@ import os import re -from utils import readStruct, getBool, shortHex, nameValue, debugPrint, checkValidHeader, validateHeaderMetadata -from constants import ( +from tja2fumen.utils import readStruct, getBool, shortHex, nameValue, debugPrint, checkValidHeader, validateHeaderMetadata +from tja2fumen.constants import ( # TJA constants HEADER_GLOBAL, HEADER_COURSE, BRANCH_COMMANDS, MEASURE_COMMANDS, COMMAND, # Fumen constants diff --git a/tja2fumen/utils.py b/tja2fumen/utils.py index b0c299b..f076e41 100644 --- a/tja2fumen/utils.py +++ b/tja2fumen/utils.py @@ -2,7 +2,7 @@ import sys import struct import math -from constants import simpleHeaders, byte_strings +from tja2fumen.constants import simpleHeaders, byte_strings def checkValidHeader(header): diff --git a/tja2fumen/writers.py b/tja2fumen/writers.py index 93096f8..f065c0f 100644 --- a/tja2fumen/writers.py +++ b/tja2fumen/writers.py @@ -1,5 +1,5 @@ -from utils import writeStruct, putBool -from constants import simpleHeaders, branchNames, typeNotes +from tja2fumen.utils import writeStruct, putBool +from tja2fumen.constants import simpleHeaders, branchNames, typeNotes def writeFumen(file, song):