ghostbt 0.2.1__tar.gz → 0.2.2__tar.gz

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.
Files changed (33) hide show
  1. {ghostbt-0.2.1 → ghostbt-0.2.2}/PKG-INFO +1 -1
  2. ghostbt-0.2.2/ghostbt/__init__.py +1 -0
  3. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/asset.py +46 -0
  4. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/PKG-INFO +1 -1
  5. {ghostbt-0.2.1 → ghostbt-0.2.2}/pyproject.toml +1 -1
  6. ghostbt-0.2.1/ghostbt/__init__.py +0 -1
  7. {ghostbt-0.2.1 → ghostbt-0.2.2}/LICENSE +0 -0
  8. {ghostbt-0.2.1 → ghostbt-0.2.2}/README.md +0 -0
  9. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/__main__.py +0 -0
  10. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/build.py +0 -0
  11. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/cli.py +0 -0
  12. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/config.py +0 -0
  13. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/create.py +0 -0
  14. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/sdk/ghostesp_plugin_api.h +0 -0
  15. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/CMakeLists.txt +0 -0
  16. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/main/CMakeLists.txt +0 -0
  17. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/main/idf_component.yml +0 -0
  18. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/main/{{APP_SYMBOL}}.c +0 -0
  19. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/manifest.json +0 -0
  20. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/data/templates/basic_app/sdkconfig.defaults +0 -0
  21. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/dist.py +0 -0
  22. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/esp_idf.py +0 -0
  23. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/firmware.py +0 -0
  24. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/flash.py +0 -0
  25. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/icon.py +0 -0
  26. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/package.py +0 -0
  27. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt/utils.py +0 -0
  28. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/SOURCES.txt +0 -0
  29. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/dependency_links.txt +0 -0
  30. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/entry_points.txt +0 -0
  31. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/requires.txt +0 -0
  32. {ghostbt-0.2.1 → ghostbt-0.2.2}/ghostbt.egg-info/top_level.txt +0 -0
  33. {ghostbt-0.2.1 → ghostbt-0.2.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghostbt
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Ghost Build Tool - build and package GhostESP native SD apps
5
5
  License-Expression: GPL-3.0
6
6
  Project-URL: Homepage, https://github.com/GhostESP-Revival/GhostESP
@@ -0,0 +1 @@
1
+ __version__ = "0.2.2"
@@ -24,6 +24,12 @@ COMPRESSION_NONE = 0
24
24
  COMPRESSION_DEFLATE_RAW = 1
25
25
 
26
26
  DEFAULT_ICON_VARIANTS = (32, 64)
27
+ DEFAULT_BACKGROUND_VARIANTS = {
28
+ "full": {"width": 240, "height": 320, "format": "rgb565", "output": "bg/bg_full.gimg"},
29
+ "half": {"width": 120, "height": 160, "format": "indexed_4bpp", "output": "bg/bg_half.gimg"},
30
+ "tiny": {"width": 80, "height": 107, "format": "indexed_4bpp", "output": "bg/bg_tiny.gimg"},
31
+ "tile": {"width": 32, "height": 32, "format": "indexed_4bpp", "output": "bg/bg_tile.gimg"},
32
+ }
27
33
  VARIANT_LABELS = {
28
34
  32: "s",
29
35
  64: "l",
@@ -118,6 +124,28 @@ def _parse_variant_sizes(values) -> tuple[int, ...]:
118
124
  return sizes
119
125
 
120
126
 
127
+ def _background_variant_specs(spec: dict) -> dict:
128
+ variants = spec.get("variants", DEFAULT_BACKGROUND_VARIANTS)
129
+ if variants is True:
130
+ variants = DEFAULT_BACKGROUND_VARIANTS
131
+ if not isinstance(variants, dict):
132
+ raise ValueError("background variants must be an object or true")
133
+
134
+ out = {}
135
+ for name, defaults in DEFAULT_BACKGROUND_VARIANTS.items():
136
+ value = variants.get(name)
137
+ if value is False or value is None:
138
+ continue
139
+ if value is True:
140
+ value = {}
141
+ if not isinstance(value, dict):
142
+ raise ValueError(f"background variant {name!r} must be an object, true, or false")
143
+ merged = dict(defaults)
144
+ merged.update(value)
145
+ out[name] = merged
146
+ return out
147
+
148
+
121
149
  def _copy_runtime_manifest(manifest: dict) -> dict:
122
150
  runtime = dict(manifest)
123
151
  for key in (
@@ -213,6 +241,24 @@ def make_asset_pack(
213
241
  if not src.is_file():
214
242
  print(f"warning: background source not found: {src}", file=sys.stderr)
215
243
  continue
244
+
245
+ if spec.get("variants") is not None or key == "background":
246
+ backgrounds = dict(runtime_manifest.get("backgrounds", {}))
247
+ for variant_name, variant in _background_variant_specs(spec).items():
248
+ rel_out = variant.get("output", f"bg/bg_{variant_name}.gimg")
249
+ write_asset_image(
250
+ src,
251
+ package_dir / rel_out,
252
+ int(variant["width"]),
253
+ int(variant["height"]),
254
+ variant.get("format", "indexed_4bpp"),
255
+ compress=compress,
256
+ )
257
+ backgrounds[variant_name] = rel_out
258
+ if backgrounds:
259
+ runtime_manifest["backgrounds"] = backgrounds
260
+ continue
261
+
216
262
  width = int(spec.get("width", 64 if key == "bg_tile" else 240))
217
263
  height = int(spec.get("height", 64 if key == "bg_tile" else 320))
218
264
  fmt = spec.get("format", "rgb565")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghostbt
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Ghost Build Tool - build and package GhostESP native SD apps
5
5
  License-Expression: GPL-3.0
6
6
  Project-URL: Homepage, https://github.com/GhostESP-Revival/GhostESP
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ghostbt"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "Ghost Build Tool - build and package GhostESP native SD apps"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes