Consider allowing outside module names for light definitions
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 validate_item 和 dmx.json.load_config 入口点,以了解 PyDMXControl.profiles. 模块是如何解析的。定义对外部定义模块的回退查找行为,然后验证 MyLight.MyAwesomeLight 之类的 light_config.json 条目是否能够在不使用 sys.modules workaround 的情况下加载。
由索引模型根据 Issue 内容生成。
描述
At present, its difficult to add light definitions without contributing directly to the project since the validate_item function assumes the PyDMXControl.profiles. module name being present. Perhaps the code could be modified si that if the module is not found you search the broader namespace for the module before failing.
I plan to hopefully contribute to this projects codebase on a few fronts after I get done with my own testing. 😄
In the meantime, I found a work around. If one defines a light in a file called MyLight with a class of MyAwesomeLight, they can add this to their executing class:
test.py
import sys
from PyDMXControl.controllers import OpenDMXController
import MyLight
sys.modules['PyDMXControl.profiles.MyLight'] = MyLight
dmx.json.load_config('light_config.json')
light_config.json
[
{
"type": "MyLight.MyAwesomeLight",
"args": [],
"name": "Light 1",
"start_channel": 1
},
{
"type": "MyLight.MyAwesomeLight",
"args": [],
"name": "Light 2",
"start_channel": 8
}
]
- 主要语言
- Python
- 星标
- 143
- 派生
- 23
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MattIPv4/PyDMXControl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
MattIPv4/PyDMXControl#60 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
MattIPv4/PyDMXControl#58 ·
-
难度 5/5 一周以上 新手友好度 25/100
MattIPv4/PyDMXControl#56 · 2 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
MattIPv4/PyDMXControl#55 · 3 条评论 ·
-
难度 5/5 一周以上 新手友好度 18/100
MattIPv4/PyDMXControl#52 · 5 条评论 ·
查看 MattIPv4/PyDMXControl 的全部 Issue
相似的 Issue
-
good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 88/100
vllm-project/vllm-metal#822 ·
维护者通常 1 天内回复
-
vector-store
难度 1/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFile未关闭
难度 2/5 1-3 小时 新手友好度 78/100
BasedHardware/omi#19047 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复