Sfoglia il codice sorgente

Studio app icons: Spaces uses the Lucide Lab hexagons-3 glyph

The generator falls back to Lucide Lab (fetched from its repository)
for a glyph that is not in the vendored set.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Andrey Yasko 1 mese fa
parent
commit
fe8a60d275

File diff suppressed because it is too large
+ 0 - 0
modules/boonex/spaces/template/images/icons/std-icon.svg


+ 20 - 2
scripts/studio_icon_from_lucide.py

@@ -54,7 +54,7 @@ ICONS = [
     ('modules/boonex/videos/template/images/icons/std-icon.svg', 'videos', 'green', 'tv-minimal-play', 80),
     ('modules/boonex/stories/template/images/icons/std-icon.svg', 'stories', 'green', 'image-play', 80),
     ('modules/boonex/protean/template/images/icons/std-icon.svg', 'protean', 'purple', 'panel-top-dashed', 80),
-    ('modules/boonex/spaces/template/images/icons/std-icon.svg', 'spaces', 'red', 'circle-dot-dashed', 80),
+    ('modules/boonex/spaces/template/images/icons/std-icon.svg', 'spaces', 'red', 'hexagons-3', 80),
     ('modules/boonex/feedback/template/images/icons/std-icon.svg', 'feedback', 'gray', 'message-square-text', 80),
     ('modules/boonex/help_tours/template/images/icons/std-icon.svg', 'help_tours', 'gray', 'route', 80),
     ('modules/boonex/invites/template/images/icons/std-icon.svg', 'invites', 'gray', 'mail-plus', 80),
@@ -148,8 +148,26 @@ def sample(d):
     return runs
 
 
+LUCIDE_LAB = 'https://raw.githubusercontent.com/lucide-icons/lucide-lab/main/icons/'
+
+
+def glyph_source(name):
+    """The vendored Lucide file, or the Lucide Lab icon of that name fetched from its repository."""
+    import os
+    path = LUCIDE + name + '.svg'
+    if os.path.exists(path):
+        return path
+    from urllib.request import urlopen
+    with urlopen(LUCIDE_LAB + name + '.svg') as r:
+        data = r.read()
+    if b'<svg' not in data:
+        raise FileNotFoundError(name + ': not in the vendored set nor in Lucide Lab')
+    return data
+
+
 def glyph_outline(name):
-    root = ET.parse(LUCIDE + name + '.svg').getroot()
+    src = glyph_source(name)
+    root = ET.fromstring(src) if isinstance(src, bytes) else ET.parse(src).getroot()
     shapes = []
     for el in root.iter():
         d = element_to_d(el)

Some files were not shown because too many files changed in this diff