From 336f17dfd374af83e838f8b4b3f19acb233962cb Mon Sep 17 00:00:00 2001 From: seiya-git Date: Thu, 9 Nov 2023 11:38:08 +0300 Subject: [PATCH] update scripts --- .gitignore | 1 + py/Fs/Hfs0.py | 2 +- py/Fs/Open.py | 27 --------------------------- py/Fs/Pfs0.py | 2 +- py/lib/Verify.py | 2 +- py/ns_extract_hashes.py | 4 ++-- py/ns_extract_meta.py | 2 +- 7 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 py/Fs/Open.py diff --git a/.gitignore b/.gitignore index 306410d..77a7fdb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__ smartgit* /logs +*_dev.py *.xci *.xcz *.nsp diff --git a/py/Fs/Hfs0.py b/py/Fs/Hfs0.py index 9253223..944cc58 100644 --- a/py/Fs/Hfs0.py +++ b/py/Fs/Hfs0.py @@ -11,7 +11,7 @@ from nut import Keys from nut import Print -from .Open import factory +from . import factory from .File import BaseFile from .File import File from .Pfs0 import Pfs0 diff --git a/py/Fs/Open.py b/py/Fs/Open.py deleted file mode 100644 index 38e0cd2..0000000 --- a/py/Fs/Open.py +++ /dev/null @@ -1,27 +0,0 @@ -def factory(name): - if name.suffix == '.xci' or name.suffix == '.xcz': - from .Xci import Xci - f = Xci() - elif name.suffix == '.nsp' or name.suffix == '.nsz' or name.suffix == '.nspz' or name.suffix == '.nsx': - from .Nsp import Nsp - f = Nsp() - elif name.suffix == '.nca': - from .Nca import Nca - f = Nca() - elif name.suffix == '.nacp': - from .Nacp import Nacp - f = Nacp() - elif name.suffix == '.tik': - from .Ticket import Ticket - f = Ticket() - elif name.suffix == '.cnmt': - from .Cnmt import Cnmt - f = Cnmt() - elif str(name) in set(['normal', 'logo', 'update', 'secure']): - from .Hfs0 import Hfs0 - f = Hfs0(None) - else: - from .File import File - f = File() - - return f diff --git a/py/Fs/Pfs0.py b/py/Fs/Pfs0.py index 6c87603..1a77c74 100644 --- a/py/Fs/Pfs0.py +++ b/py/Fs/Pfs0.py @@ -12,7 +12,7 @@ from nut import Print from nut import Titles -from .Open import factory +from . import factory from .BaseFs import BaseFs from .File import File from .File import BaseFile diff --git a/py/lib/Verify.py b/py/lib/Verify.py index c328926..dca39bb 100644 --- a/py/lib/Verify.py +++ b/py/lib/Verify.py @@ -16,7 +16,7 @@ import enlighten # import Fs -from Fs.Open import factory +from Fs import factory from Fs import Xci, Nsp from Fs import Nca, Ticket from Fs import Type diff --git a/py/ns_extract_hashes.py b/py/ns_extract_hashes.py index 0f58754..f5e0b9b 100644 --- a/py/ns_extract_hashes.py +++ b/py/ns_extract_hashes.py @@ -5,8 +5,8 @@ from pathlib import Path -from FsNSZ.Open import factory -from FsNSZ import Pfs0, Nca, Type +from Fs import factory +from Fs import Pfs0, Nca, Type from lib import FsTools diff --git a/py/ns_extract_meta.py b/py/ns_extract_meta.py index b49e342..66ea56c 100644 --- a/py/ns_extract_meta.py +++ b/py/ns_extract_meta.py @@ -5,7 +5,7 @@ from pathlib import Path -from Fs.Open import factory +from Fs import factory from Fs import Pfs0, Nca, Type from lib import FsTools