Skip to content

Commit

Permalink
corrected object iteration for NODE_LIST
Browse files Browse the repository at this point in the history
removed old default.json mechanism
removed /jovimetrix/config routes
  • Loading branch information
Amorano committed Feb 4, 2025
1 parent 9db24ba commit 61b8823
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You can colorize nodes via their `title background`, `node body` or `title text`

## UPDATES

**2024/02/04** @1.6.5:
**2024/02/04** @1.6.10:
* adjusted new default color config to old defaults

**2024/02/04** @1.6.0:
Expand Down
40 changes: 0 additions & 40 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@

JOV_CONFIG = {}
JOV_WEB = ROOT / 'web'
JOV_DEFAULT = JOV_WEB / 'default.json'
JOV_CONFIG_FILE = JOV_WEB / 'config.json'

# nodes to skip on import; for online systems; skip Export, Streamreader, etc...
Expand Down Expand Up @@ -775,34 +774,6 @@ async def jovimetrix_config(request) -> Any:
JOV_CONFIG = configLoad(JOV_CONFIG_FILE)
return web.json_response(JOV_CONFIG)

@PromptServer.instance.routes.post("/jovimetrix/config")
async def jovimetrix_config_post(request) -> Any:
json_data = await request.json()
did = json_data.get("id", None)
value = json_data.get("cmd", None)
if did is None or value is None:
logger.error("bad config {}", json_data)
return

global JOV_CONFIG
update_nested_dict(JOV_CONFIG, did, value)
with open(JOV_CONFIG_FILE, 'w', encoding='utf-8') as f:
json.dump(JOV_CONFIG, f, indent=4)
return web.json_response(json_data)

@PromptServer.instance.routes.post("/jovimetrix/config/clear")
async def jovimetrix_config_post(request) -> Any:
json_data = await request.json()
name = json_data['name']
global JOV_CONFIG
try:
del JOV_CONFIG['color'][name]
except KeyError as _:
pass
with open(JOV_CONFIG_FILE, 'w', encoding='utf-8') as f:
json.dump(JOV_CONFIG, f)
return web.json_response(json_data)

async def object_info(node_class: str, scheme:str, host: str) -> Any:
global COMFYUI_OBJ_DATA
if (info := COMFYUI_OBJ_DATA.get(node_class, None)) is None:
Expand Down Expand Up @@ -913,19 +884,8 @@ def loader():
global JOV_CONFIG, JOV_IGNORE_NODE, NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
NODE_LIST_MAP = {}

found = False
if JOV_CONFIG_FILE.exists():
JOV_CONFIG = configLoad(JOV_CONFIG_FILE)
# is this an old config, copy default (sorry, not sorry)
found = JOV_CONFIG.get('user', None) is not None

if not found:
try:
shutil.copy2(JOV_DEFAULT, JOV_CONFIG_FILE)
logger.warning("---> DEFAULT CONFIGURATION <---")
except Exception as e:
logger.error("MAJOR 😿😰😬🥟 BLUNDERCATS 🥟😬😰😿")
logger.error(e)

if JOV_IGNORE_NODE.exists():
JOV_IGNORE_NODE = configLoad(JOV_IGNORE_NODE, False)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "jovimetrix"
description = "Integrates Webcam, MIDI, Spout and GLSL shader support. Animation via tick. Parameter manipulation with wave generator. Math operations with Unary and Binary support. Value conversion for all major types (int, string, list, dict, Image, Mask). Shape mask generation, image stacking and channel ops, batch splitting, merging and randomizing, load images and video from anywhere, dynamic bus routing with a single node, export support for GIPHY, save output anywhere! flatten, crop, transform; check colorblindness, make stereogram or stereoscopic images, or liner interpolate values and more."
version = "1.6.5"
version = "1.6.10"
license = { file = "LICENSE" }
readme = "README.md"
authors = [{ name = "Alexander G. Morano", email = "[email protected]" }]
Expand Down
2 changes: 1 addition & 1 deletion web/core/core_color.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class JovimetrixPanelColorize {
const categories = [];
const CONFIG_THEME = app.extensionManager.setting.get(setting_theme);

NODE_LIST.forEach(([nodeName, node]) => {
Object.entries(NODE_LIST).forEach(([nodeName, node]) => {
const category = node.category;
const majorCategory = category.split("/")?.[0];

Expand Down

0 comments on commit 61b8823

Please sign in to comment.