Translate Python log messages + fix rhinopanel import in PROJECTS
- startup.py: all user-visible messages translated to English - panel_base.py: icon/rendering log messages translated - toolbar.py: display mode check messages translated - Global: Panel registered/opened/listener-active across all modules - Fix: elemente.py and other files with stale 'import rhinopanel' were missing from PROJECTS sync — now properly copied
This commit is contained in:
+16
-16
@@ -62,16 +62,16 @@ def print_startup_summary():
|
||||
print("[STARTUP] ===== SUMMARY =====")
|
||||
print("[STARTUP] Wall-time (first to last mark): {:.1f} ms".format(total_wall))
|
||||
print("[STARTUP] Sum of measured work: {:.1f} ms".format(total_work))
|
||||
# Top-10 nach Dauer
|
||||
# Top-10 by duration
|
||||
top = sorted(_TIMINGS, key=lambda x: -x[2])[:10]
|
||||
print("[STARTUP] --- Top-10 nach Dauer ---")
|
||||
print("[STARTUP] --- Top-10 by duration ---")
|
||||
for phase, label, ms in top:
|
||||
print("[STARTUP] {:7.1f} ms {} / {}".format(ms, phase, label))
|
||||
# Aggregat nach Phase
|
||||
# Aggregate by phase
|
||||
by_phase = {}
|
||||
for phase, _, ms in _TIMINGS:
|
||||
by_phase[phase] = by_phase.get(phase, 0.0) + ms
|
||||
print("[STARTUP] --- Aggregat nach Phase ---")
|
||||
print("[STARTUP] --- Aggregate by phase ---")
|
||||
for phase, ms in sorted(by_phase.items(), key=lambda x: -x[1]):
|
||||
print("[STARTUP] {:7.1f} ms {}".format(ms, phase))
|
||||
|
||||
@@ -717,7 +717,7 @@ def make_panel_icon(name_or_letter, bg_hex):
|
||||
if os.path.isfile(png_path):
|
||||
icon_bmp = _try_load_png_white(png_path, size - 8)
|
||||
if icon_bmp is not None: chosen_path = png_path
|
||||
else: print("[panel_base] PNG geladen aber Bitmap None:",
|
||||
else: print("[panel_base] PNG loaded but Bitmap is None:",
|
||||
png_path)
|
||||
# PNG-not-found ist normal: Fallback auf SVG dann Material-Font.
|
||||
# Nur loggen wenn final ALLES failt (s.u.).
|
||||
@@ -734,12 +734,12 @@ def make_panel_icon(name_or_letter, bg_hex):
|
||||
size - 2*pad, size - 2*pad)
|
||||
used_svg = True
|
||||
used_material = True # → kein Letter-Fallback
|
||||
print("[panel_base] Icon-Pfad: {} ← {}".format(
|
||||
print("[panel_base] Icon path: {} ← {}".format(
|
||||
name_or_letter, chosen_path))
|
||||
except Exception as ex:
|
||||
print("[panel_base] Icon-Composite Fehler:", ex)
|
||||
print("[panel_base] Icon composite error:", ex)
|
||||
except Exception as ex:
|
||||
print("[panel_base] Icon-Pfad-Check:", ex)
|
||||
print("[panel_base] Icon path check error:", ex)
|
||||
|
||||
# 1) Material-Icon-Font (wenn keine SVG vorhanden)
|
||||
mat_cp = _MATERIAL_CODEPOINTS.get(name_or_letter)
|
||||
@@ -759,7 +759,7 @@ def make_panel_icon(name_or_letter, bg_hex):
|
||||
drawing.Colors.White)
|
||||
used_material = True
|
||||
except Exception as ex:
|
||||
print("[panel_base] Material-Render Fehler:", ex)
|
||||
print("[panel_base] Material render error:", ex)
|
||||
used_material = False
|
||||
|
||||
# 2) Fallback: Buchstabe (erstes Zeichen bzw. eingegebener Buchstabe)
|
||||
@@ -787,7 +787,7 @@ def make_panel_icon(name_or_letter, bg_hex):
|
||||
tag, safe, bg_hex.lstrip("#")))
|
||||
bmp.Save(path, drawing.ImageFormat.Png)
|
||||
except Exception as ex:
|
||||
print("[panel_base] Icon-Save:", ex)
|
||||
print("[panel_base] Icon save error:", ex)
|
||||
path = None
|
||||
# WICHTIG: Mac Rhinos RegisterPanel meldet "expected Icon, got Icon"
|
||||
# wenn wir Eto.Drawing.Icon uebergeben — die API erwartet
|
||||
@@ -797,18 +797,18 @@ def make_panel_icon(name_or_letter, bg_hex):
|
||||
try:
|
||||
import System.Drawing as _sd
|
||||
ic = _sd.Icon(path)
|
||||
print("[panel_base] Icon erzeugt via System.Drawing.Icon(path) [{}]".format(tag))
|
||||
print("[panel_base] Icon created via System.Drawing.Icon(path) [{}]".format(tag))
|
||||
return ic
|
||||
except Exception as ex:
|
||||
print("[panel_base] System.Drawing.Icon(path) fehlgeschlagen:", ex)
|
||||
print("[panel_base] System.Drawing.Icon(path) failed:", ex)
|
||||
# System.Drawing.Bitmap als Fallback (manche RegisterPanel-Overloads akzeptieren Bitmap)
|
||||
try:
|
||||
import System.Drawing as _sd
|
||||
bmp_sd = _sd.Bitmap(path)
|
||||
print("[panel_base] Icon erzeugt via System.Drawing.Bitmap(path) [{}]".format(tag))
|
||||
print("[panel_base] Icon created via System.Drawing.Bitmap(path) [{}]".format(tag))
|
||||
return bmp_sd
|
||||
except Exception as ex:
|
||||
print("[panel_base] System.Drawing.Bitmap(path) fehlgeschlagen:", ex)
|
||||
print("[panel_base] System.Drawing.Bitmap(path) failed:", ex)
|
||||
# Eto.Drawing.Icon als letzter Versuch — falls Rhino-Version anders ist
|
||||
try:
|
||||
ic = drawing.Icon(path)
|
||||
@@ -909,7 +909,7 @@ def register_and_open(mode, caption, guid_str, bridge_factory, icon_spec=None, m
|
||||
registered = True
|
||||
registered_with_icon = with_icon
|
||||
if with_icon:
|
||||
print("[{}] Panel mit Icon registriert ({})".format(
|
||||
print("[{}] Panel registered with icon ({})".format(
|
||||
mode.upper(), type(arg).__name__))
|
||||
break
|
||||
except Exception as ex:
|
||||
@@ -936,7 +936,7 @@ def register_and_open(mode, caption, guid_str, bridge_factory, icon_spec=None, m
|
||||
guid = sc.sticky.get(sticky_guid, System.Guid(guid_str))
|
||||
RhinoUI.Panels.OpenPanel(guid)
|
||||
_t_mark("OpenPanel", mode, t_open)
|
||||
print("[{}] Panel geoeffnet".format(mode.upper()))
|
||||
print("[{}] Panel opened".format(mode.upper()))
|
||||
except Exception as ex:
|
||||
print("[{}] OpenPanel fehlgeschlagen: {}".format(mode.upper(), ex))
|
||||
_t_mark("register_and_open", mode, t_outer)
|
||||
|
||||
Reference in New Issue
Block a user