MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / safe_symbol_from_path

Function safe_symbol_from_path

server/icon_export.py:27–32  ·  view source on GitHub ↗
(path: str)

Source from the content-addressed store, hash-verified

25
26
27def safe_symbol_from_path(path: str) -> str:
28 raw = path.replace("\\", "/")
29 base = raw.split("/")[-1] or raw
30 no_ext = re.sub(r"\.[a-z0-9]+$", "", base, flags=re.I)
31 sym = re.sub(r"[^a-zA-Z0-9_]", "_", no_ext)
32 return sym or "icon"
33
34
35def hex_to_rgb(hex_str: str) -> tuple[int, int, int]:

Callers 1

export_iconsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected