sonolus.py 0.9.1__py3-none-any.whl → 0.9.3__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.

Potentially problematic release.


This version of sonolus.py might be problematic. Click here for more details.

@@ -246,9 +246,13 @@ class Collection:
246
246
  use_item = level[key]
247
247
  if "item" not in use_item:
248
248
  continue
249
- name = use_item["item"]["name"]
250
- if name in self.categories.get(category, {}):
251
- use_item["item"] = self.get_item(category, name)
249
+ use_item_value = use_item["item"]
250
+ if isinstance(use_item_value, str) and use_item_value in self.categories.get(category, {}):
251
+ use_item["item"] = self.get_item(category, use_item_value)
252
+ elif isinstance(use_item_value, dict) and "name" in use_item_value:
253
+ name = use_item["item"]["name"]
254
+ if name in self.categories.get(category, {}):
255
+ use_item["item"] = self.get_item(category, name)
252
256
 
253
257
  def _create_base_directory(self, path: Asset) -> Path:
254
258
  base_dir = Path(path) / BASE_PATH.strip("/")
@@ -112,17 +112,14 @@ def parse_dev_command(command_line: str) -> Command | None:
112
112
  return None
113
113
 
114
114
 
115
- def command_input_thread(command_queue: queue.Queue, stop_event: threading.Event, prompt_event: threading.Event):
115
+ def command_input_thread(command_queue: queue.Queue, prompt_event: threading.Event):
116
116
  print(f"\nAvailable commands:\n{HELP_TEXT}")
117
117
 
118
- while not stop_event.is_set():
118
+ while True:
119
119
  try:
120
120
  prompt_event.wait()
121
121
  prompt_event.clear()
122
122
 
123
- if stop_event.is_set():
124
- break
125
-
126
123
  print("\n> ", end="", flush=True)
127
124
  command_line = input()
128
125
  if command_line.strip():
@@ -193,10 +190,9 @@ def run_server(
193
190
  threading.Thread(target=httpd.serve_forever, daemon=True).start()
194
191
 
195
192
  command_queue = queue.Queue()
196
- stop_event = threading.Event()
197
193
  prompt_event = threading.Event()
198
194
  input_thread = threading.Thread(
199
- target=command_input_thread, args=(command_queue, stop_event, prompt_event), daemon=True
195
+ target=command_input_thread, args=(command_queue, prompt_event), daemon=True
200
196
  )
201
197
  input_thread.start()
202
198
 
@@ -215,8 +211,5 @@ def run_server(
215
211
  sys.exit(0)
216
212
  finally:
217
213
  httpd.shutdown()
218
- stop_event.set()
219
- prompt_event.set()
220
- input_thread.join()
221
214
  else:
222
215
  httpd.serve_forever()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sonolus.py
3
- Version: 0.9.1
3
+ Version: 0.9.3
4
4
  Summary: Sonolus engine development in Python
5
5
  Project-URL: Documentation, https://sonolus.py.qwewqa.xyz/
6
6
  Project-URL: Repository, https://github.com/qwewqa/sonolus.py
@@ -27,9 +27,9 @@ sonolus/backend/optimize/simplify.py,sha256=RDNVTKfC7ByRyxY5z30_ShimOAKth_pKlVFV
27
27
  sonolus/backend/optimize/ssa.py,sha256=raQO0furQQRPYb8iIBKfNrJlj-_5wqtI4EWNfLZ8QFo,10834
28
28
  sonolus/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
29
  sonolus/build/cli.py,sha256=aEuuyWxo5u12z-0On2conYxQ31XHTIZ3npD4y0QNpFQ,9441
30
- sonolus/build/collection.py,sha256=KgMfdLsCA7bheT-E2wmdB2OBEWolbsECm8vrwAhGC1c,12415
30
+ sonolus/build/collection.py,sha256=6hniAzriPWBKUeGDkXabNXpbdHiHnqiK9shs6U1OExM,12748
31
31
  sonolus/build/compile.py,sha256=3r3pbrOMS45ufQdtd12mhCq11b3km7BU4Npa2AMxTzo,8272
32
- sonolus/build/dev_server.py,sha256=oTvYsUaZDE8XyobS7jqOarwWiNkOjbWTm9bjp1r2M_s,6597
32
+ sonolus/build/dev_server.py,sha256=5LgfHRhnR8cYGp8prkGxOp6E3TflTPw7xmJ1h1kOpGM,6331
33
33
  sonolus/build/engine.py,sha256=J5I1-oYpiwCl9lOKhLpEgw3iPRhzD6aLH9oBPjgHx_s,14139
34
34
  sonolus/build/level.py,sha256=KLqUAtxIuIqrzeFURJA97rdqjA5pcvYSmwNZQhElaMQ,702
35
35
  sonolus/build/node.py,sha256=gnX71RYDUOK_gYMpinQi-bLWO4csqcfiG5gFmhxzSec,1330
@@ -87,8 +87,8 @@ sonolus/script/internal/simulation_context.py,sha256=LGxLTvxbqBIhoe1R-SfwGajNIDw
87
87
  sonolus/script/internal/transient.py,sha256=y2AWABqF1aoaP6H4_2u4MMpNioC4OsZQCtPyNI0txqo,1634
88
88
  sonolus/script/internal/tuple_impl.py,sha256=DPNdmmRmupU8Ah4_XKq6-PdT336l4nt15_uCJKQGkkk,3587
89
89
  sonolus/script/internal/value.py,sha256=OngrCdmY_h6mV2Zgwqhuo4eYFad0kTk6263UAxctZcY,6963
90
- sonolus_py-0.9.1.dist-info/METADATA,sha256=1eOoNYUb6fpDM8Z9qtnEAfBd7tFQkpOaa1IfE2iRyLA,553
91
- sonolus_py-0.9.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- sonolus_py-0.9.1.dist-info/entry_points.txt,sha256=oTYspY_b7SA8TptEMTDxh4-Aj-ZVPnYC9f1lqH6s9G4,54
93
- sonolus_py-0.9.1.dist-info/licenses/LICENSE,sha256=JEKpqVhQYfEc7zg3Mj462sKbKYmO1K7WmvX1qvg9IJk,1067
94
- sonolus_py-0.9.1.dist-info/RECORD,,
90
+ sonolus_py-0.9.3.dist-info/METADATA,sha256=85b716gzemda0_TZ3ldIMytt7juroiJuQqt_oxkg2vY,553
91
+ sonolus_py-0.9.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
+ sonolus_py-0.9.3.dist-info/entry_points.txt,sha256=oTYspY_b7SA8TptEMTDxh4-Aj-ZVPnYC9f1lqH6s9G4,54
93
+ sonolus_py-0.9.3.dist-info/licenses/LICENSE,sha256=JEKpqVhQYfEc7zg3Mj462sKbKYmO1K7WmvX1qvg9IJk,1067
94
+ sonolus_py-0.9.3.dist-info/RECORD,,