Major changes: - PD Project Context: accepts incoming context for override chaining, adds auto_increment_version (persistent via widget state, like seed) - New PD Custom Context: 5 user-defined key/value token pairs - Replace PD Output Namer + PD Network Output with: - PD Output Relative (saves to ComfyUI output dir) - PD Output Absolute (saves to absolute/UNC paths) Both show a token reference panel via JS after execution - PD Switch simplified to single-channel with auto-growing inputs (2-8) managed by JS extension (onConnectionsChange pattern) - 💭 emoji prefix on all node display names (with Windows fallback) - Consolidated all JS extensions into web/pipedream.js - Backward compat: PDOutputNamer/PDNetworkOutput aliases preserved https://claude.ai/code/session_015UV4rjSvFatMiNtKhd1sT3
21 lines
541 B
Python
21 lines
541 B
Python
"""
|
|
Display name helper for Pipedream nodes.
|
|
|
|
Provides an emoji prefix for node display names with a safe fallback
|
|
for terminals that cannot encode emoji (e.g. Windows cp1252/cp932).
|
|
"""
|
|
|
|
import sys
|
|
|
|
_EMOJI_PREFIX = "\U0001F4AD " # 💭
|
|
|
|
try:
|
|
_EMOJI_PREFIX.encode(sys.stdout.encoding or "utf-8")
|
|
except (UnicodeEncodeError, LookupError):
|
|
_EMOJI_PREFIX = ""
|
|
|
|
|
|
def display_name(base: str) -> str:
|
|
"""Return *base* with the Pipedream emoji prefix (when supported)."""
|
|
return f"{_EMOJI_PREFIX}{base}" if _EMOJI_PREFIX else base
|