Skip to content

Commit

Permalink
PyQt6. Remove unused promote_specific_enums function
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Nov 5, 2021
1 parent dc86e18 commit d91d757
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions qtpy/enums_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@
from . import sip


def promote_specific_enums(base_class, enum_classes_list, inclusion_criteria):
"""
Allow access for the given enumeration classes values at base class level.
Based on:
https://github.com/pyqtgraph/pyqtgraph/blob/pyqtgraph-0.12.1/pyqtgraph/Qt.py#L331-L377
"""
for enum_class_name in enum_classes_list:
klass = getattr(base_class, enum_class_name)
attrib_names = [x for x in dir(klass) if inclusion_criteria(x)]
for attrib_name in attrib_names:
attrib = getattr(klass, attrib_name)
if not isinstance(attrib, (enum.Enum)):
continue
setattr(base_class, attrib.name, attrib)


def promote_enums(module):
"""
Search enums in the given module and allow unscoped access.
Expand Down

0 comments on commit d91d757

Please sign in to comment.