mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-26 01:48:10 -07:00
bit cleaner now
This commit is contained in:
+1
-2
@@ -261,7 +261,6 @@ class Main(App):
|
||||
global valid_dirs # access our global variable
|
||||
for i in valid_dirs: # We can copy the manifest for all of the valid dirs!
|
||||
i = i.split("/")[-1]
|
||||
print(f"assets\dolphin\external\{i}\manifest.txt")
|
||||
shutil.copyfile(fr"assets\dolphin\external\{i}\manifest.txt", fr"assets\resources\dolphin\{i}\manifest.txt")
|
||||
os.remove(r"assets\resources\dolphin\manifest.txt")
|
||||
|
||||
@@ -293,7 +292,7 @@ class Main(App):
|
||||
self.logger.info(f"Processing Dolphin sources")
|
||||
dolphin = Dolphin()
|
||||
self.logger.info(f"Loading data")
|
||||
if not "external" in str(self.args.input_directory): # AHEM... oopsie. This script apparently just loads all assets, not only external assets, lol.
|
||||
if not "dolphin\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)
|
||||
else:
|
||||
dolphin.load(valid_dirs)
|
||||
|
||||
@@ -298,10 +298,7 @@ class DolphinManifest:
|
||||
if len(newname) < 2:
|
||||
newname = name.split("/")
|
||||
|
||||
try: # Flipper Zero moment. loading all assets in one script, lol.
|
||||
newname = str(newname[1]) # external shit we modified
|
||||
except:
|
||||
newname = str(newname[0]) # everything else... smh
|
||||
newname = str(newname[-1])
|
||||
|
||||
animation.load(os.path.join(loc, newname))
|
||||
|
||||
@@ -372,18 +369,21 @@ class Dolphin:
|
||||
self.manifest = DolphinManifest()
|
||||
self.logger = logging.getLogger("Dolphin")
|
||||
|
||||
def load(self, valid_dirs: list):
|
||||
if not "external" in str(valid_dirs):
|
||||
assert os.path.isdir(valid_dirs)
|
||||
def load(self, valid_dirs: list or str):
|
||||
|
||||
if type(valid_dirs) == list:
|
||||
for path in valid_dirs:
|
||||
assert os.path.isdir(path)
|
||||
# Load Manifest
|
||||
self.logger.info(f"Loading directory {valid_dirs}")
|
||||
self.manifest.load(valid_dirs)
|
||||
self.logger.info(f"Loading directory {path}")
|
||||
self.manifest.load(path)
|
||||
else:
|
||||
for loc in valid_dirs:
|
||||
assert os.path.isdir(loc)
|
||||
# Load Manifest
|
||||
self.logger.info(f"Loading directory {loc}")
|
||||
self.manifest.load(loc)
|
||||
assert os.path.isdir(valid_dirs)
|
||||
# Load Manifest
|
||||
self.logger.info(f"Loading directory {valid_dirs}")
|
||||
self.manifest.load(valid_dirs)
|
||||
|
||||
|
||||
|
||||
def pack(self, output_directory: str, symbol_name: str = None):
|
||||
self.manifest.save(output_directory, symbol_name)
|
||||
|
||||
Reference in New Issue
Block a user