Rename all log tags to match English module names
[EBENEN] → [LAYERS], [EBENEN-BE] → [LAYERS-BE] [ZEICHNUNGSEBENEN] → [DRAWING-LEVELS] [GESTALTUNG] → [STYLES] [OBERLEISTE] → [TOOLBAR] [WERKZEUGE] → [TOOLS] [DIMENSIONEN] → [DIMENSIONS] [AUSSCHNITTE] → [VIEWPORTS] [MASSSTAB] → [SCALE] [SCHNITT] → [SECTION], [SCHNITT_GRIPS] → [SECTION-GRIPS] [WAND_GRIPS] → [WALL-GRIPS], [TREPPE_GRIPS] → [STAIR-GRIPS] [CURVE_DOTS] → [CURVE-DOTS] [panel_base] → [CORE] [ALIAS-LOADER] → [ALIASES] [BEGIN-CMD] → [CMD-HOOK]
This commit is contained in:
+17
-17
@@ -39,7 +39,7 @@ def _read_defaults():
|
||||
out[k] = v
|
||||
return out
|
||||
except Exception as ex:
|
||||
print("[ALIAS-LOADER] Defaults lesen:", ex)
|
||||
print("[ALIASES] Defaults lesen:", ex)
|
||||
return {}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def _read_user_overrides():
|
||||
so = data.get("shortcuts_user")
|
||||
if isinstance(so, dict): return so
|
||||
except Exception as ex:
|
||||
print("[ALIAS-LOADER] Settings lesen:", ex)
|
||||
print("[ALIASES] Settings lesen:", ex)
|
||||
return {}
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ def _xml_persist_shortcut(xml_key, macro, verbose=False):
|
||||
if line_end < 0: line_end = len(content)
|
||||
line_trim = content[line_start:line_end].strip()
|
||||
if line_trim == new_entry:
|
||||
if verbose: print("[ALIAS-LOADER] XML '{}' unchanged".format(xml_key))
|
||||
if verbose: print("[ALIASES] XML '{}' unchanged".format(xml_key))
|
||||
continue
|
||||
# Sonst: loeschen inkl. preceding-newline+whitespace damit
|
||||
# keine orphan-line uebrig bleibt
|
||||
@@ -176,11 +176,11 @@ def _xml_persist_shortcut(xml_key, macro, verbose=False):
|
||||
# ShortcutKeys-Section finden
|
||||
sec_start = content.find('<child key="ShortcutKeys">')
|
||||
if sec_start < 0:
|
||||
if verbose: print("[ALIAS-LOADER] ShortcutKeys-section fehlt")
|
||||
if verbose: print("[ALIASES] ShortcutKeys-section fehlt")
|
||||
continue
|
||||
sec_end = content.find('</child>', sec_start)
|
||||
if sec_end < 0:
|
||||
if verbose: print("[ALIAS-LOADER] ShortcutKeys-close fehlt")
|
||||
if verbose: print("[ALIASES] ShortcutKeys-close fehlt")
|
||||
continue
|
||||
# Indent vom letzten <entry> in der Section uebernehmen
|
||||
section = content[sec_start:sec_end]
|
||||
@@ -199,9 +199,9 @@ def _xml_persist_shortcut(xml_key, macro, verbose=False):
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
n_written += 1
|
||||
if verbose: print("[ALIAS-LOADER] XML {} '{}'".format(action, xml_key))
|
||||
if verbose: print("[ALIASES] XML {} '{}'".format(action, xml_key))
|
||||
except Exception as ex:
|
||||
print("[ALIAS-LOADER] XML-Write {}: {}".format(path, ex))
|
||||
print("[ALIASES] XML-Write {}: {}".format(path, ex))
|
||||
return n_written
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ def apply_all():
|
||||
# Konflikt-Check (gleicher Trigger → letzter gewinnt, Warning)
|
||||
norm = (spec_type, str(trigger).lower())
|
||||
if norm in seen_triggers:
|
||||
print("[ALIAS-LOADER] Konflikt: '{}' fuer {} bereits von {} belegt"
|
||||
print("[ALIASES] Konflikt: '{}' fuer {} bereits von {} belegt"
|
||||
.format(trigger, action_id, seen_triggers[norm]))
|
||||
seen_triggers[norm] = action_id
|
||||
|
||||
@@ -383,7 +383,7 @@ def apply_all():
|
||||
try:
|
||||
added = aliases.Add(tname, macro)
|
||||
except Exception as _addex:
|
||||
print("[ALIAS-LOADER] Add({}, ...) Exception: {}"
|
||||
print("[ALIASES] Add({}, ...) Exception: {}"
|
||||
.format(tname, _addex))
|
||||
if not added:
|
||||
try: aliases.SetMacro(tname, macro)
|
||||
@@ -392,7 +392,7 @@ def apply_all():
|
||||
try:
|
||||
is_ok = aliases.IsAlias(tname)
|
||||
if not is_ok:
|
||||
print("[ALIAS-LOADER] WARN: '{}' (action={}) NICHT registriert "
|
||||
print("[ALIASES] WARN: '{}' (action={}) NICHT registriert "
|
||||
"— Rhino lehnt Namen wahrscheinlich ab (z.B. reine Zahl)"
|
||||
.format(tname, action_id))
|
||||
n_skipped += 1
|
||||
@@ -409,7 +409,7 @@ def apply_all():
|
||||
got = skset.GetMacro(sk)
|
||||
api_ok = (got == macro)
|
||||
except Exception as _sex:
|
||||
print("[ALIAS-LOADER] SetMacro({}): {}".format(trigger, _sex))
|
||||
print("[ALIASES] SetMacro({}): {}".format(trigger, _sex))
|
||||
if not api_ok and xml_key:
|
||||
# Enum-Wert fehlt → direkt ins XML (mit verbose-Log).
|
||||
# n_xml=0 kann "schon korrekt" ODER "gescheitert" heissen
|
||||
@@ -426,7 +426,7 @@ def apply_all():
|
||||
# damit Rhino-Quit-Save sie nicht ueberschreibt
|
||||
_quit_xml_pairs.append((xml_key, macro))
|
||||
else:
|
||||
print("[ALIAS-LOADER] WARN F-Key {} ({}) konnte weder "
|
||||
print("[ALIASES] WARN F-Key {} ({}) konnte weder "
|
||||
"API noch XML set werden".format(trigger, action_id))
|
||||
n_skipped += 1; continue
|
||||
n_fkey += 1
|
||||
@@ -439,7 +439,7 @@ def apply_all():
|
||||
if len(letter_only) == 1 and letter_only.isalpha():
|
||||
aliases.SetMacro(letter_only, macro)
|
||||
n_alias += 1
|
||||
print("[ALIAS-LOADER] {} ({}): Cmd+Letter nicht im Enum, "
|
||||
print("[ALIASES] {} ({}): Cmd+Letter nicht im Enum, "
|
||||
"fallback Alias '{}'".format(action_id, trigger, letter_only))
|
||||
else:
|
||||
n_skipped += 1
|
||||
@@ -447,16 +447,16 @@ def apply_all():
|
||||
skset.SetMacro(sk, macro)
|
||||
n_cmd += 1
|
||||
else:
|
||||
print("[ALIAS-LOADER] Unbekannter Type:", spec_type); n_skipped += 1
|
||||
print("[ALIASES] Unbekannter Type:", spec_type); n_skipped += 1
|
||||
except Exception as ex:
|
||||
print("[ALIAS-LOADER] Apply", action_id, "->", trigger, ":", ex)
|
||||
print("[ALIASES] Apply", action_id, "->", trigger, ":", ex)
|
||||
n_skipped += 1
|
||||
|
||||
# Quit-Hook installieren falls XML-only Shortcuts set wurden — diese
|
||||
# ueberlebt sonst Rhino's Auto-Save beim Quit nicht.
|
||||
if _quit_xml_pairs:
|
||||
_install_quit_xml_save(list(_quit_xml_pairs))
|
||||
print("[ALIAS-LOADER] {} XML-only Shortcuts werden bei Quit "
|
||||
print("[ALIASES] {} XML-only Shortcuts werden bei Quit "
|
||||
"re-persistiert (closing hook installed)"
|
||||
.format(len(_quit_xml_pairs)))
|
||||
|
||||
@@ -465,5 +465,5 @@ def apply_all():
|
||||
|
||||
if __name__ == "__main__":
|
||||
a, f, c, s = apply_all()
|
||||
print("[ALIAS-LOADER] OK: {} alias, {} fkey, {} cmd, {} skipped"
|
||||
print("[ALIASES] OK: {} alias, {} fkey, {} cmd, {} skipped"
|
||||
.format(a, f, c, s))
|
||||
|
||||
Reference in New Issue
Block a user