Update app.py
Browse files
app.py
CHANGED
|
@@ -314,51 +314,57 @@ hat_block_data = _load_block_catalog(HAT_BLOCKS_PATH)
|
|
| 314 |
hat_description = hat_block_data["description"]
|
| 315 |
# hat_description = hat_block_data.get("description", "No description available")
|
| 316 |
# hat_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in hat_block_data["blocks"]])
|
| 317 |
-
hat_opcodes_functionalities = "\n".join([
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
]) if isinstance(hat_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 321 |
print("Hat blocks loaded successfully.", hat_description)
|
| 322 |
|
| 323 |
boolean_block_data = _load_block_catalog(BOOLEAN_BLOCKS_PATH)
|
| 324 |
boolean_description = boolean_block_data["description"]
|
| 325 |
# boolean_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in boolean_block_data["blocks"]])
|
| 326 |
-
boolean_opcodes_functionalities = "\n".join([
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
]) if isinstance(boolean_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 330 |
|
| 331 |
c_block_data = _load_block_catalog(C_BLOCKS_PATH)
|
| 332 |
c_description = c_block_data["description"]
|
| 333 |
# c_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in c_block_data["blocks"]])
|
| 334 |
-
c_opcodes_functionalities = "\n".join([
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
]) if isinstance(c_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 338 |
|
| 339 |
cap_block_data = _load_block_catalog(CAP_BLOCKS_PATH)
|
| 340 |
cap_description = cap_block_data["description"]
|
| 341 |
# cap_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in cap_block_data["blocks"]])
|
| 342 |
-
cap_opcodes_functionalities = "\n".join([
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
]) if isinstance(cap_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 346 |
|
| 347 |
reporter_block_data = _load_block_catalog(REPORTER_BLOCKS_PATH)
|
| 348 |
reporter_description = reporter_block_data["description"]
|
| 349 |
# reporter_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in reporter_block_data["blocks"]])
|
| 350 |
-
reporter_opcodes_functionalities = "\n".join([
|
| 351 |
-
|
| 352 |
-
|
| 353 |
-
]) if isinstance(reporter_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 354 |
|
| 355 |
stack_block_data = _load_block_catalog(STACK_BLOCKS_PATH)
|
| 356 |
stack_description = stack_block_data["description"]
|
| 357 |
# stack_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in stack_block_data["blocks"]])
|
| 358 |
-
stack_opcodes_functionalities = "\n".join([
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
]) if isinstance(stack_block_data.get("blocks"), list) else " No blocks information available."
|
|
|
|
| 362 |
|
| 363 |
# This makes ALL_SCRATCH_BLOCKS_CATALOG available globally
|
| 364 |
# ALL_SCRATCH_BLOCKS_CATALOG = _load_block_catalog(BLOCK_CATALOG_PATH)
|
|
|
|
| 314 |
hat_description = hat_block_data["description"]
|
| 315 |
# hat_description = hat_block_data.get("description", "No description available")
|
| 316 |
# hat_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in hat_block_data["blocks"]])
|
| 317 |
+
# hat_opcodes_functionalities = "\n".join([
|
| 318 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 319 |
+
# for block in hat_block_data.get("blocks", [])
|
| 320 |
+
# ]) if isinstance(hat_block_data.get("blocks"), list) else " No blocks information available."
|
| 321 |
+
hat_opcodes_functionalities = os.path.join(BLOCKS_DIR, "hat_blocks.txt")
|
| 322 |
print("Hat blocks loaded successfully.", hat_description)
|
| 323 |
|
| 324 |
boolean_block_data = _load_block_catalog(BOOLEAN_BLOCKS_PATH)
|
| 325 |
boolean_description = boolean_block_data["description"]
|
| 326 |
# boolean_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in boolean_block_data["blocks"]])
|
| 327 |
+
# boolean_opcodes_functionalities = "\n".join([
|
| 328 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 329 |
+
# for block in boolean_block_data.get("blocks", [])
|
| 330 |
+
# ]) if isinstance(boolean_block_data.get("blocks"), list) else " No blocks information available."
|
| 331 |
+
boolean_opcodes_functionalities = os.path.join(BLOCKS_DIR, "boolean_blocks.txt")
|
| 332 |
|
| 333 |
c_block_data = _load_block_catalog(C_BLOCKS_PATH)
|
| 334 |
c_description = c_block_data["description"]
|
| 335 |
# c_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in c_block_data["blocks"]])
|
| 336 |
+
# c_opcodes_functionalities = "\n".join([
|
| 337 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 338 |
+
# for block in c_block_data.get("blocks", [])
|
| 339 |
+
# ]) if isinstance(c_block_data.get("blocks"), list) else " No blocks information available."
|
| 340 |
+
c_opcodes_functionalities = os.path.join(BLOCKS_DIR, "c_blocks.txt")
|
| 341 |
|
| 342 |
cap_block_data = _load_block_catalog(CAP_BLOCKS_PATH)
|
| 343 |
cap_description = cap_block_data["description"]
|
| 344 |
# cap_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in cap_block_data["blocks"]])
|
| 345 |
+
# cap_opcodes_functionalities = "\n".join([
|
| 346 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 347 |
+
# for block in cap_block_data.get("blocks", [])
|
| 348 |
+
# ]) if isinstance(cap_block_data.get("blocks"), list) else " No blocks information available."
|
| 349 |
+
cap_opcodes_functionalities = os.path.join(BLOCKS_DIR, "cap_blocks.txt")
|
| 350 |
|
| 351 |
reporter_block_data = _load_block_catalog(REPORTER_BLOCKS_PATH)
|
| 352 |
reporter_description = reporter_block_data["description"]
|
| 353 |
# reporter_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in reporter_block_data["blocks"]])
|
| 354 |
+
# reporter_opcodes_functionalities = "\n".join([
|
| 355 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 356 |
+
# for block in reporter_block_data.get("blocks", [])
|
| 357 |
+
# ]) if isinstance(reporter_block_data.get("blocks"), list) else " No blocks information available."
|
| 358 |
+
reporter_opcodes_functionalities = os.path.join(BLOCKS_DIR, "reporter_blocks.txt")
|
| 359 |
|
| 360 |
stack_block_data = _load_block_catalog(STACK_BLOCKS_PATH)
|
| 361 |
stack_description = stack_block_data["description"]
|
| 362 |
# stack_opcodes_functionalities = "\n".join([f" - Opcode: {block['op_code']}, functionality: {block['functionality']} example: standalone use: {block['example_standalone']}" for block in stack_block_data["blocks"]])
|
| 363 |
+
# stack_opcodes_functionalities = "\n".join([
|
| 364 |
+
# f" - Opcode: {block.get('op_code', 'N/A')}, functionality: {block.get('functionality', 'N/A')}, example: standalone use {block.get('example_standalone', 'N/A')}"
|
| 365 |
+
# for block in stack_block_data.get("blocks", [])
|
| 366 |
+
# ]) if isinstance(stack_block_data.get("blocks"), list) else " No blocks information available."
|
| 367 |
+
stack_opcodes_functionalities = os.path.join(BLOCKS_DIR, "stack_blocks.txt")
|
| 368 |
|
| 369 |
# This makes ALL_SCRATCH_BLOCKS_CATALOG available globally
|
| 370 |
# ALL_SCRATCH_BLOCKS_CATALOG = _load_block_catalog(BLOCK_CATALOG_PATH)
|