mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-19 00:48:09 -07:00
Format
This commit is contained in:
+28
-10
@@ -30,11 +30,16 @@ valid_dirs = list()
|
||||
# This will not stay, dont worry! This is temp code until we got time to rewrite this all
|
||||
root_dir = pathlib.Path(__file__).absolute().parent.parent
|
||||
dolphin_external = root_dir / "assets/dolphin/external/"
|
||||
potential_directories = [item for item in dolphin_external.iterdir() if item.is_dir()] # Get all animation directories
|
||||
potential_directories = [
|
||||
item for item in dolphin_external.iterdir() if item.is_dir()
|
||||
] # Get all animation directories
|
||||
|
||||
for directory in potential_directories: # loop through all of them
|
||||
if (
|
||||
directory / "manifest.txt"
|
||||
).exists(): # check if they contain a manifest.txt TODO: This code should be moved to wherever manifest.txt files are validated!
|
||||
valid_dirs.append(directory) # append valid directory to list
|
||||
|
||||
for directory in potential_directories: # loop through all of them
|
||||
if (directory / "manifest.txt").exists(): # check if they contain a manifest.txt TODO: This code should be moved to wherever manifest.txt files are validated!
|
||||
valid_dirs.append(directory) # append valid directory to list
|
||||
|
||||
class Main(App):
|
||||
def init(self):
|
||||
@@ -259,13 +264,24 @@ class Main(App):
|
||||
self.logger.info("Manifest is up-to-date!")
|
||||
|
||||
# This will not stay, dont worry! This is temp code until we got time to rewrite this all
|
||||
global valid_dirs # access our global variable
|
||||
for valid_dir in valid_dirs: # We can copy the manifest for all of the valid dirs!
|
||||
(root_dir / f"assets/resources/dolphin/{valid_dir.name}").mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(valid_dir / "manifest.txt", root_dir / f"assets/resources/dolphin/{valid_dir.name}/manifest.txt")
|
||||
global valid_dirs # access our global variable
|
||||
for (
|
||||
valid_dir
|
||||
) in valid_dirs: # We can copy the manifest for all of the valid dirs!
|
||||
(root_dir / f"assets/resources/dolphin/{valid_dir.name}").mkdir(
|
||||
parents=True, exist_ok=True
|
||||
)
|
||||
shutil.copyfile(
|
||||
valid_dir / "manifest.txt",
|
||||
root_dir / f"assets/resources/dolphin/{valid_dir.name}/manifest.txt",
|
||||
)
|
||||
(root_dir / "assets/resources/dolphin/manifest.txt").unlink()
|
||||
self.logger.info("Packing custom asset packs")
|
||||
asset_packer.pack(root_dir / "assets/dolphin/custom", root_dir / f"assets/resources/dolphin_custom", self.logger.info)
|
||||
asset_packer.pack(
|
||||
root_dir / "assets/dolphin/custom",
|
||||
root_dir / f"assets/resources/dolphin_custom",
|
||||
self.logger.info,
|
||||
)
|
||||
|
||||
self.logger.info(f"Complete")
|
||||
|
||||
@@ -295,7 +311,9 @@ class Main(App):
|
||||
self.logger.info(f"Processing Dolphin sources")
|
||||
dolphin = Dolphin()
|
||||
self.logger.info(f"Loading data")
|
||||
if f"dolphin{os.sep}external" in str(self.args.input_directory): # AHEM... oopsie. This script apparently just loads all assets, not only external assets, lol.
|
||||
if f"dolphin{os.sep}external" in str(
|
||||
self.args.input_directory
|
||||
): # AHEM... oopsie. This script apparently just loads all assets, not only external assets, lol.
|
||||
dolphin.load(self.args.input_directory, valid_dirs)
|
||||
else:
|
||||
dolphin.load(self.args.input_directory)
|
||||
|
||||
Reference in New Issue
Block a user