Skip to content

Commit

Permalink
chore: optimize import
Browse files Browse the repository at this point in the history
  • Loading branch information
isHarryh committed Aug 9, 2024
1 parent 9fcdd6d commit bd883af
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import os
import time
import argparse
import os
import os.path as osp

from src.utils import ArgParser
from src.utils.Config import Config
from src.utils.Logger import Logger
Expand Down
1 change: 1 addition & 0 deletions src/CollectModels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import shutil
import os.path as osp

from .utils.Config import Config, PerformanceLevel
from .utils.GlobalMethods import print, rmdir, get_dirlist
from .utils.Logger import Logger
Expand Down
3 changes: 2 additions & 1 deletion src/CombineRGBwithA.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import os
import re
import os
import os.path as osp

from PIL import Image
from .utils.Config import Config, PerformanceLevel
from .utils.GlobalMethods import print, rmdir, get_filelist, is_image_file
Expand Down
3 changes: 2 additions & 1 deletion src/ModelsDataDist.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import os
import re
import json
import shutil
import os
import os.path as osp
from datetime import datetime

from .ResolveAB import ab_resolve
from .ResolveFBO import ArkFBOLibrary
from .utils.GlobalMethods import color, print, get_dirlist, get_filelist
Expand Down
3 changes: 2 additions & 1 deletion src/ResolveAB.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import UnityPy
import os.path as osp

import UnityPy
import UnityPy.classes as uc
from .CombineRGBwithA import AlphaRGBCombiner
from .utils.Config import Config, PerformanceLevel
Expand Down
5 changes: 3 additions & 2 deletions src/ResolveFBO.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# @ BSD 3-Clause License
import os.path as osp
import json
import types
import pkgutil
import importlib.util

import numpy as np
from types import ModuleType
from .utils.Config import Config, PerformanceLevel
from .utils.GlobalMethods import print, rmdir, get_filelist, is_ab_file, is_known_asset_file
from .utils.Logger import Logger
Expand All @@ -18,7 +19,7 @@ class PackageHelper:
"""Helper class for dynamic package inspection."""

@staticmethod
def get_modules_from_package(package:ModuleType):
def get_modules_from_package(package:types.ModuleType):
walk_result = pkgutil.walk_packages(package.__path__, package.__name__ + '.')
module_names = [name for _, name, is_pkg in walk_result if not is_pkg]
return [importlib.import_module(name) for name in module_names]
Expand Down
4 changes: 3 additions & 1 deletion src/utils/Config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import os, json
import json
import os
import os.path as osp

from .Logger import Logger


Expand Down
2 changes: 1 addition & 1 deletion src/utils/GlobalMethods.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024, Harry Huang
# @ BSD 3-Clause License
import os
import builtins
import shutil
import traceback
import os
import os.path as osp


Expand Down
5 changes: 3 additions & 2 deletions src/utils/SaverUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import os
import os.path as osp
import threading
import UnityPy.classes as uc
from io import BytesIO
from PIL import Image
from contextlib import ContextDecorator

import UnityPy.classes as uc
from PIL import Image
from .AnalyUtils import TestRT
from .Config import Config, PerformanceLevel
from .GlobalMethods import mkdir
Expand Down
1 change: 1 addition & 0 deletions src/utils/TaskUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import time
import queue
import threading

from .GlobalMethods import color, print, clear
from .Logger import Logger

Expand Down

0 comments on commit bd883af

Please sign in to comment.