Skip to content

Use property for getting enumerated values - #561

Open
tfarago wants to merge 1 commit into
masterfrom
new-gobject
Open

Use property for getting enumerated values#561
tfarago wants to merge 1 commit into
masterfrom
new-gobject

Conversation

@tfarago

@tfarago tfarago commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

On one of the machines, conda had pygobject==3.50.0 installed and there the enumerated properties become gi.repository.GObject.ParamSpecEnum instead of gobject.GParamSpec. The prop.default_value.__enum_values__ trick did not work anymore, because the default_value was an integer. This PR fixes it. However, I do now know if it will work on older versions of pygobject than 3.48.2 (which I tested). Code to reproduce:

import gi
gi.require_version('Uca', '2.0')
from gi.repository import GObject, GLib, Uca
manager = Uca.PluginManager()
uca = manager.get_camerah("mock", None)
for prop in uca.props:
    if hasattr(prop, "enum_class"):
    eprop = prop
    break 
type(eprop)
gi.repository.GObject.ParamSpecEnum

Check before merge

  • HIKA PyGObject: 3.42.2
  • ID19 PyGObject: 3.48.2
  • IMAGE PyGObject: 3.48.2
  • CL/CT lab

@tfarago tfarago self-assigned this Aug 26, 2025
@codecov

codecov Bot commented Aug 26, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.52%. Comparing base (64508fd) to head (a5c94ef).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #561   +/-   ##
=======================================
  Coverage   83.52%   83.52%           
=======================================
  Files         133      133           
  Lines       10718    10718           
=======================================
  Hits         8952     8952           
  Misses       1766     1766           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tfarago

tfarago commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

HIKA PyGObject: 3.42.2
ID19 PyGObject: 3.48.2
IMAGE PyGObject: 3.48.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant