yzsp-studio/mediakit-shared-suite / ppt
ppt
Unverified飞书幻灯片:创建和编辑幻灯片。创建演示文稿、读取幻灯片内容、管理幻灯片页面(创建、删除、读取、局部替换)。当用户需要创建或编辑幻灯片、读取或修改单个页面时使用。
scripts/svg_relation_lib/attributes/_resolver.py
View on GitHub"""
Channel conflict resolver · 同一 channel 被多个 attribute 占用时的降级策略
规则:
1. 按 attrs 声明顺序 · 先声明的占默认 channel
2. 后声明的若与已占 channel 冲突 · 降级到 fallback_channel
3. 若 fallback 也被占 · 抛 error
"""
from __future__ import annotations
from typing import List, Dict
def resolve_channels(attrs: List) -> Dict[str, str]:
"""
attrs: List[Attribute] instances
return: dict {attribute_class_name: resolved_channel}
"""
used = set()
mapping: Dict[str, str] = {}
for attr in attrs:
name = attr.__class__.__name__
chan = getattr(attr, "channel", None)
fallback = getattr(attr, "fallback_channel", None)
if chan is None:
raise ValueError(f"{name} · missing `channel` attribute")
# "none" fallback 表示没有降级选项 · 允许占用一次
if chan not in used:
mapping[name] = chan
if chan != "none":
used.add(chan)
elif fallback and fallback != "none" and fallback not in used:
mapping[name] = fallback
used.add(fallback)
else:
raise ValueError(
f"channel conflict · {name} wants '{chan}' or '{fallback}' · "
f"both taken by {sorted(used)}"
)
return mapping
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |