Skip to content

Commit

Permalink
renamed tooltip to tooltips to keep old system with new
Browse files Browse the repository at this point in the history
renamed max/min to mij/maj to resolve immediate conflicts for PR  2666
  • Loading branch information
Amorano committed Aug 8, 2024
1 parent 917ca03 commit 9a2411d
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 365 deletions.
27 changes: 16 additions & 11 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class Lexicon(metaclass=LexiconMeta):
SOURCE = 'SRC', "Source"
SPACING = 'SPACING', "Line Spacing between Text Lines"
START = 'START', "Start of the range"
STEP = '🦶🏽', "Step"
STEP = '🦶🏽', "Steps/Stride between pulses -- useful to do odd or even batches. If set to 0 will stretch from (VAL -> LOOP) / Batch giving a linear range of values."
STRENGTH = '💪🏽', "Strength"
STRING = '📝', "String Entry"
STYLE = 'STYLE', "Style"
Expand Down Expand Up @@ -355,7 +355,7 @@ def _parse(cls, node: dict, node_cls: object) -> dict:
continue
for k, v in entry.items():
widget_data = v[1] if isinstance(v, (tuple, list,)) and len(v) > 1 else {}
if (tip := widget_data.get('tooltip', None)) is None:
if (tip := widget_data.get("tooltips", None)) is None:
if (tip := cls._tooltipsDB.get(k), None) is None:
logger.warning(f"no {k}")
continue
Expand Down Expand Up @@ -392,6 +392,11 @@ class JOVBaseNode:
# instance map for caching
INSTANCE = {}

@classmethod
def VALIDATE_INPUTS(cls, *arg, **kw) -> bool:
logger.debug(f'validate -- {arg} {kw}')
return True

@classmethod
def INPUT_TYPES(cls, prompt:bool=False, extra_png:bool=False) -> dict:
data = {
Expand All @@ -415,9 +420,9 @@ def INPUT_TYPES(cls) -> dict:
d = super().INPUT_TYPES()
d.update({
"outputs": {
0: ("IMAGE", {"tooltip":"Full channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output."}),
1: ("IMAGE", {"tooltip":"Three channel [RGB] image. There will be no alpha."}),
2: ("MASK", {"tooltip":"Single channel mask output."}),
0: ("IMAGE", {"tooltips":"Full channel [RGBA] image. If there is an alpha, the image will be masked out with it when using this output."}),
1: ("IMAGE", {"tooltips":"Three channel [RGB] image. There will be no alpha."}),
2: ("MASK", {"tooltips":"Single channel mask output."}),
}
})
return Lexicon._parse(d, cls)
Expand Down Expand Up @@ -514,12 +519,12 @@ def get_node_info(node_cls: object) -> Dict[str, Any]:
# only stuff that makes sense...
junk = ['default', 'min', 'max']
meta = node_param_meta[param_key][1]
if (tip := meta.get('tooltip', None)) is None:
if (tip := meta.get("tooltips", None)) is None:
if (tip := Lexicon._tooltipsDB.get(param_key, None)) is None:
# logger.warning(f"no tooltip for {node_class}[{k}]::{param_key}")
junk.append('tooltip')
junk.append("tooltips")
tip = "Unknown Explanation!"
input_parameters[k][param_key]['tooltip'] = tip
input_parameters[k][param_key]["tooltips"] = tip
for scrape in junk:
if (val := meta.get(scrape, None)) is not None and val != "":
input_parameters[k][param_key][scrape] = val
Expand Down Expand Up @@ -573,7 +578,7 @@ def json2markdown(json_dict: dict) -> str:
typ = param_meta.get('type','UNKNOWN').upper()
typ = ', '.join([x.strip() for x in typ.split(',')])
typ = "<br>".join(textwrap.wrap(typ, 42))
tool = param_meta.get('tooltip','')
tool = param_meta.get("tooltips",'')
tool = "<br>".join(textwrap.wrap(tool, 42))
default = param_meta.get('default','')
ch = ", ".join(param_meta.get('choice', []))
Expand Down Expand Up @@ -633,7 +638,7 @@ def template_load(what: str, fname: str) -> Template:
typ = param_meta.get('type', 'UNKNOWN').upper()
typ = ', '.join([x.strip() for x in typ.split(',')])
typ = '<br>'.join(textwrap.wrap(typ, 42))
tool = param_meta.get('tooltip', '')
tool = param_meta.get("tooltips", '')
tool = '<br>'.join(textwrap.wrap(tool, 42))
default = html.escape(str(param_meta.get('default', '')))
ch = ', '.join(param_meta.get('choice', []))
Expand Down Expand Up @@ -889,7 +894,7 @@ def __init__(self, *arg, **kw) -> None:
try:
for class_name, class_def in module.import_dynamic():
setattr(module, class_name, class_def)
logger.info(f"shader: {class_name}")
logger.debug(f"shader: {class_name}")
except Exception as e:
pass

Expand Down
Loading

0 comments on commit 9a2411d

Please sign in to comment.