Upload "Google Blockly" prototyping tools

This commit is contained in:
layerdiffusion
2024-09-07 01:43:40 -07:00
parent 66211d9a06
commit accf133a38
4 changed files with 105 additions and 0 deletions

View File

@@ -132,3 +132,9 @@ def initialize_rest(*, reload_script_modules=False):
extra_networks.initialize()
extra_networks.register_default_extra_networks()
startup_timer.record("initialize extra networks")
from modules_forge.google_blockly.loader import load_all_google_blockly
load_all_google_blockly()
startup_timer.record("initialize google blockly")
return

View File

@@ -0,0 +1,11 @@
### Google Blockly
Starting from **v2.0.1**, Forge will begin incorporating **Google Blockly** as a prototyping tool for certain developments. This approach is aimed at enhancing the speed and flexibility of experimental feature creation.
- **Experimental Prototype**: Forge may store experimental Visual Programming Graphs (VPGs) directly in Google Blockly specifications within the `google_blockly` folder.
- **Mature Code**: Once code has matured and proven its stability, it may be rewritten in Python and moved to its appropriate directory, if necessary.
For further references, see also the following resources:
- [Google Blockly GitHub Repository](https://github.com/google/blockly)
- [Google Blockly Homepage](https://developers.google.com/blockly)

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,28 @@
import os
import importlib
def load_all_google_blockly():
current_dir = os.path.dirname(__file__)
package = __package__
for filename in os.listdir(current_dir):
if filename == os.path.basename(__file__):
continue
if not filename.endswith(".py"):
continue
if filename.endswith("_s.py"):
continue
if filename.endswith("_u.py"):
continue
if filename.endswith("_m.py"):
continue
module_name = f"{package}.{filename[:-3]}"
importlib.import_module(module_name)
return