Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Give YAML plugin objects a useful `__str__`

Đang mở
#33 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@coleman-m đang làm issue này rồi.

Từ ngày 18/9/2026.

  • #34 của @coleman-m — đang mở

Đá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__ to BaseYamlPlugin that 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 family out 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__ to BaseYamlPlugin
  • 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NRLMMD-GEOIPS/pluginify

Tất cả issue của NRLMMD-GEOIPS/pluginify

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.