mntm-asset-packer 1.1.4__py3-none-any.whl → 1.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mntm-asset-packer
3
- Version: 1.1.4
3
+ Version: 1.1.6
4
4
  Summary: An improved asset packer script to make the process of creating and packing asset packs for the Momentum firmware easier.
5
5
  Author-email: notnotnescap <nescap@tuta.io>
6
6
  Requires-Python: >=3.10
@@ -0,0 +1,5 @@
1
+ mntm_asset_packer.py,sha256=gFvKENg7mLtAS9l0TLndkBBlH9HxzPd_IPom2UZRRsY,27818
2
+ mntm_asset_packer-1.1.6.dist-info/METADATA,sha256=6P5Az5W5E41p51zOCzIx6BhMRFcUeaGtPr74KIPHNyE,3694
3
+ mntm_asset_packer-1.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
+ mntm_asset_packer-1.1.6.dist-info/entry_points.txt,sha256=CF05qVMVPPNhTroKeH_kkKqVgG-mJ-Q0mSAZHpfxkr0,61
5
+ mntm_asset_packer-1.1.6.dist-info/RECORD,,
mntm_asset_packer.py CHANGED
@@ -84,7 +84,13 @@ Active cooldown: 0
84
84
  Bubble slots: 0
85
85
  """
86
86
 
87
- VERSION = importlib.metadata.version("mntm-asset-packer")
87
+
88
+ try:
89
+ VERSION = importlib.metadata.version("mntm-asset-packer")
90
+ except importlib.metadata.PackageNotFoundError:
91
+ VERSION = "1.1.6 (standalone mode)"
92
+ # this means the script is being used directly with python
93
+ # instead of using the python package
88
94
 
89
95
 
90
96
  def convert_to_bm(img: "Image.Image | pathlib.Path") -> bytes:
@@ -412,12 +418,17 @@ def pack_specific(
412
418
  """Packs a specific asset pack."""
413
419
  asset_pack_path = pathlib.Path(asset_pack_path)
414
420
  output_directory = pathlib.Path(output_directory)
415
- logger(f"Packing '\033[3m{asset_pack_path.name}\033[0m'")
416
421
 
417
422
  if not asset_pack_path.is_dir():
418
423
  logger(f"\033[31mError: '{asset_pack_path}' is not a directory\033[0m")
419
424
  return
420
425
 
426
+ if not (asset_pack_path / "Anims").is_dir() and not (asset_pack_path / "Icons").is_dir() and not (asset_pack_path / "Fonts").is_dir() and not (asset_pack_path / "Passport").is_dir():
427
+ logger(f"\033[37mInfo: '{asset_pack_path}' is not an asset pack, skipping.\033[0m")
428
+ return
429
+
430
+ logger(f"Packing '\033[3m{asset_pack_path.name}\033[0m'")
431
+
421
432
  packed = output_directory / asset_pack_path.name
422
433
 
423
434
  if packed.exists():
@@ -428,6 +439,7 @@ def pack_specific(
428
439
  packed.unlink()
429
440
  except (OSError, shutil.Error):
430
441
  logger(f"\033[31mError: Failed to remove existing pack: '{packed}'\033[0m")
442
+ return
431
443
 
432
444
  # packing anims
433
445
  if (asset_pack_path / "Anims/manifest.txt").exists():
@@ -488,12 +500,16 @@ def recover_specific(
488
500
  """Recovers a specific asset pack."""
489
501
  asset_pack_path = pathlib.Path(asset_pack_path)
490
502
  output_directory = pathlib.Path(output_directory)
491
- logger(f"Recovering '\033[3m{asset_pack_path.name}\033[0m'")
492
503
 
493
504
  if not asset_pack_path.is_dir():
494
505
  logger(f"\033[31mError: '{asset_pack_path}' is not a directory\033[0m")
495
506
  return
496
507
 
508
+ if not (asset_pack_path / "Anims").is_dir() and not (asset_pack_path / "Icons").is_dir() and not (asset_pack_path / "Fonts").is_dir() and not (asset_pack_path / "Passport").is_dir():
509
+ logger(f"\033[37mInfo: '{asset_pack_path}' is not an asset pack, skipping.\033[0m")
510
+ return
511
+
512
+ logger(f"Recovering '\033[3m{asset_pack_path.name}\033[0m'")
497
513
  recovered = output_directory / asset_pack_path.name
498
514
 
499
515
  if recovered.exists():
@@ -1,5 +0,0 @@
1
- mntm_asset_packer.py,sha256=DXDRcpg_Q37bhSaZx4Umla6j8v_JTUzbg-1GRdaApyA,27005
2
- mntm_asset_packer-1.1.4.dist-info/METADATA,sha256=-DwKWOaSz7RNG1ZoXZQZzyOAq78E0JSdGm8t4TRB558,3694
3
- mntm_asset_packer-1.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
4
- mntm_asset_packer-1.1.4.dist-info/entry_points.txt,sha256=CF05qVMVPPNhTroKeH_kkKqVgG-mJ-Q0mSAZHpfxkr0,61
5
- mntm_asset_packer-1.1.4.dist-info/RECORD,,