Give YAML plugin objects a useful `__str__`
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Requested Update
Description
- Printing a YAML plugin doesn't tell you much at a glance, since it falls back to the full
__repr__dump of the plugin's contents. Add a__str__toBaseYamlPluginthat gives a short readable summary for the cases where you just want to know which plugin you're looking at.
Background and Motivation
- This is the pluginify side of NRLMMD-GEOIPS/geoips#424, which covers the class-based plugins whose base class lives over in geoips. Both sides are using the same wording so the two kinds of plugin read the same way.
__repr__stays exactly as it is. The full dump is useful when you actually want to see everything in a plugin, and this is only about having a shorter option alongside it.- Leaving
familyout of the output on purpose, since it's on its way to being deprecated.
Alternative Solutions
- Only fixing the class-based side in geoips and leaving this one alone. Workable, but then
the two kinds of plugin behave differently for no good reason.
Environment
Code to demonstrate issue
What you get now:
>>> print(products.get_plugin(("abi", "Infrared")))
ProductsPlugin({'interface': 'products', 'name': 'Infrared', 'spec': {...}, ...})
What we want, with repr still available for the full picture:
>>> print(products.get_plugin(("abi", "Infrared")))
Infrared (products plugin from geoips)
Checklist for Completion
- Add
__str__toBaseYamlPlugin - Leave
__repr__alone - Make sure it degrades gracefully when a plugin is missing attributes, so it never
blows up on a half-built plugin in a debugger - Keep the wording matching what geoips#424 produces
- Add tests
- Add a release note
- Ngôn ngữ chính
- Python
- Star
- 1
- Fork
- 1
- Merge trung bình
- 11 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NRLMMD-GEOIPS/pluginify
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
NRLMMD-GEOIPS/pluginify#41 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NRLMMD-GEOIPS/pluginify#35 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NRLMMD-GEOIPS/pluginify#30 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
NRLMMD-GEOIPS/pluginify#32 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
NRLMMD-GEOIPS/pluginify#31 ·
Tất cả issue của NRLMMD-GEOIPS/pluginify
Issue tương tự
-
Support .aac audio uploadsCó thể đã có người làm @julien731 đã nhận hôm nay. Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nimblehq/audio-transcriber#153 ·
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
antonyrag/ragleap-core#1062 ·
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gke-labs/kube-agents#4321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Git-Hospital/githealthcheck#61 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ramnes/notion-sdk-py#433 ·