From 84d5580873ea0b34da3ee65fc339c858dc08d77f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 16 Sep 2020 19:05:12 +0200 Subject: [PATCH] attribute `is_input_type` renamed to `is_item_type` and added better check --- pype/tools/settings/settings/widgets/item_types.py | 12 ++++++------ pype/tools/settings/settings/widgets/lib.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_types.py b/pype/tools/settings/settings/widgets/item_types.py index e2d59c2e69..ff95ba82c3 100644 --- a/pype/tools/settings/settings/widgets/item_types.py +++ b/pype/tools/settings/settings/widgets/item_types.py @@ -12,8 +12,8 @@ from avalon.vendor import qtawesome class SettingObject: - # `is_input_type` attribute says if has implemented item type methods - is_input_type = True + # `is_item_type` attribute says if has implemented item type methods + is_item_type = True # each input must have implemented default value for development # when defaults are not filled yet default_input_value = NOT_SET @@ -1935,7 +1935,7 @@ class DictWidget(QtWidgets.QWidget, SettingObject): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) - if not klass.is_input_type: + if not getattr(klass, "is_item_type", False): item = klass(child_configuration, self) self.content_layout.addWidget(item) return item @@ -2226,7 +2226,7 @@ class DictInvisible(QtWidgets.QWidget, SettingObject): item_type = child_configuration["type"] klass = TypeToKlass.types.get(item_type) - if not klass.is_input_type: + if not klass.is_item_type: item = klass(child_configuration, self) self.layout().addWidget(item) return item @@ -3003,7 +3003,7 @@ class DictFormWidget(QtWidgets.QWidget, SettingObject): class LabelWidget(QtWidgets.QWidget): - is_input_type = False + is_item_type = False def __init__(self, configuration, parent=None): super(LabelWidget, self).__init__(parent) @@ -3018,7 +3018,7 @@ class LabelWidget(QtWidgets.QWidget): class SplitterWidget(QtWidgets.QWidget): - is_input_type = False + is_item_type = False _height = 2 def __init__(self, configuration, parent=None): diff --git a/pype/tools/settings/settings/widgets/lib.py b/pype/tools/settings/settings/widgets/lib.py index e225d65417..a2646ad4e6 100644 --- a/pype/tools/settings/settings/widgets/lib.py +++ b/pype/tools/settings/settings/widgets/lib.py @@ -125,7 +125,7 @@ def file_keys_from_schema(schema_data): output = [] item_type = schema_data["type"] klass = TypeToKlass.types[item_type] - if not klass.is_input_type: + if not klass.is_item_type: return output keys = [] @@ -150,7 +150,7 @@ def file_keys_from_schema(schema_data): def validate_all_has_ending_file(schema_data, is_top=True): item_type = schema_data["type"] klass = TypeToKlass.types[item_type] - if not klass.is_input_type: + if not klass.is_item_type: return None if schema_data.get("is_file"):