Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions example/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@
"proj.all_artifacts(\"wheel\")[1].make()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "47412d6d-5e4c-40e7-b1d7-2b7f792259f4",
"metadata": {},
"outputs": [],
"source": [
"import projspec.library"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6a6dffd1-9cba-49db-9647-3a8b10edb29e",
"metadata": {},
"outputs": [],
"source": [
"projspec.library.ProjectLibrary()"
]
},
{
"cell_type": "markdown",
"id": "ebe14f5c-1381-4f62-abf2-c861471cfb32",
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ test = ["pytest", "pytest-cov", "django", "streamlit", "copier", "jinja2-time",
"maturin", "uv", "briefcase"]
qt = ["pyqt>5,<6", "pyqtwebengin>5,<6"]
textual = ["textual>=0.80"]
ipywidget = ["anywidget>=0.9", "ipywidgets>=8", "ipython"]

[project.scripts]
projspec = "projspec.__main__:main"
Expand Down
37 changes: 13 additions & 24 deletions qtapp/emoji.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
"""Emoji icons for projspec UIs.
"""Backwards-compatibility shim.

The spec / content / artifact classes in ``projspec`` itself already carry
emoji in their ``icon`` class attribute, so the three UIs can render those
as-is. This module only supplies the small fixed set of *chrome* icons
(toolbar buttons, search box, kebab trigger, etc.) that are specific to
the UI and a category fallback for icons ``projspec`` doesn't name.
The canonical chrome emoji map and category defaults now live in
:mod:`projspec.webui`. This module re-exports them for any existing
imports of ``qtapp.emoji``.
"""

from __future__ import annotations

from projspec.webui import chrome_icons

CHROME = {
"add": "➕",
"reload": "🔄",
"configure": "⚙️",
"search": "🔍",
"clear": "✖️",
"spinner": "⏳",
"chevron_up": "🔼",
"chevron_down": "🔽",
"kebab": "⋮",
"play": "▶️",
"info": "ℹ️",
"reveal": "➡️",
}
CHROME = chrome_icons()

# Category fallbacks used when a spec/content/artifact class has no
# ``icon`` attribute. These match the ``DEFAULT_ICONS`` values baked into
# ``projspec/webui/panel.js``.
_CATEGORY_DEFAULT = {
"spec": "🧩",
"content": "📄",
"artifact": "📦",
"spec": "\U0001f9e9", # 🧩
"content": "\U0001f4c4", # 📄
"artifact": "\U0001f4e6", # 📦
}

_UNKNOWN = "❔"
_UNKNOWN = "\u2754" # ❔


def icon_for(icon: str | None, category: str | None = None) -> str:
Expand Down
Loading
Loading