Skip to content

Commit 9f3375e

Browse files
authored
Merge pull request #93 from martindurant/ipy
Add notebook repr to ProjectLibrary
2 parents 88c0dda + c95389c commit 9f3375e

12 files changed

Lines changed: 2142 additions & 1020 deletions

File tree

example/demo.ipynb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,26 @@
8989
"proj.all_artifacts(\"wheel\")[1].make()"
9090
]
9191
},
92+
{
93+
"cell_type": "code",
94+
"execution_count": null,
95+
"id": "47412d6d-5e4c-40e7-b1d7-2b7f792259f4",
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"import projspec.library"
100+
]
101+
},
102+
{
103+
"cell_type": "code",
104+
"execution_count": null,
105+
"id": "6a6dffd1-9cba-49db-9647-3a8b10edb29e",
106+
"metadata": {},
107+
"outputs": [],
108+
"source": [
109+
"projspec.library.ProjectLibrary()"
110+
]
111+
},
92112
{
93113
"cell_type": "markdown",
94114
"id": "ebe14f5c-1381-4f62-abf2-c861471cfb32",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ test = ["pytest", "pytest-cov", "django", "streamlit", "copier", "jinja2-time",
3636
"maturin", "uv", "briefcase"]
3737
qt = ["pyqt>5,<6", "pyqtwebengin>5,<6"]
3838
textual = ["textual>=0.80"]
39+
ipywidget = ["anywidget>=0.9", "ipywidgets>=8", "ipython"]
3940

4041
[project.scripts]
4142
projspec = "projspec.__main__:main"

qtapp/emoji.py

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,26 @@
1-
"""Emoji icons for projspec UIs.
1+
"""Backwards-compatibility shim.
22
3-
The spec / content / artifact classes in ``projspec`` itself already carry
4-
emoji in their ``icon`` class attribute, so the three UIs can render those
5-
as-is. This module only supplies the small fixed set of *chrome* icons
6-
(toolbar buttons, search box, kebab trigger, etc.) that are specific to
7-
the UI and a category fallback for icons ``projspec`` doesn't name.
3+
The canonical chrome emoji map and category defaults now live in
4+
:mod:`projspec.webui`. This module re-exports them for any existing
5+
imports of ``qtapp.emoji``.
86
"""
97

108
from __future__ import annotations
119

10+
from projspec.webui import chrome_icons
1211

13-
CHROME = {
14-
"add": "➕",
15-
"reload": "🔄",
16-
"configure": "⚙️",
17-
"search": "🔍",
18-
"clear": "✖️",
19-
"spinner": "⏳",
20-
"chevron_up": "🔼",
21-
"chevron_down": "🔽",
22-
"kebab": "⋮",
23-
"play": "▶️",
24-
"info": "ℹ️",
25-
"reveal": "➡️",
26-
}
12+
CHROME = chrome_icons()
2713

14+
# Category fallbacks used when a spec/content/artifact class has no
15+
# ``icon`` attribute. These match the ``DEFAULT_ICONS`` values baked into
16+
# ``projspec/webui/panel.js``.
2817
_CATEGORY_DEFAULT = {
29-
"spec": "🧩",
30-
"content": "📄",
31-
"artifact": "📦",
18+
"spec": "\U0001f9e9", # 🧩
19+
"content": "\U0001f4c4", # 📄
20+
"artifact": "\U0001f4e6", # 📦
3221
}
3322

34-
_UNKNOWN = "❔"
23+
_UNKNOWN = "\u2754" # ❔
3524

3625

3726
def icon_for(icon: str | None, category: str | None = None) -> str:

0 commit comments

Comments
 (0)