oarepo-runtime 1.5.71__py3-none-any.whl → 1.5.72__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,7 @@ from invenio_records import Record
9
9
  from oarepo_runtime.services.custom_fields import CustomFieldsMixin, CustomFields, InlinedCustomFields
10
10
  from oarepo_runtime.services.generators import RecordOwners
11
11
 
12
+
12
13
  try:
13
14
  from invenio_drafts_resources.services.records.uow import ParentRecordCommitOp
14
15
  except ImportError:
@@ -88,3 +89,29 @@ class CustomFieldsComponent(ServiceComponent):
88
89
  config = current_app.config.get(cf.config_key, {})
89
90
  for c in config:
90
91
  record[c.name] =data.get(c.name)
92
+
93
+ def process_service_configs(service_configs):
94
+ """
95
+ Processes a list of service_config classes. If a class has a `components` attribute,
96
+ it extends the result with the values in it.
97
+
98
+ :param service_config: List of service_config classes to process.
99
+ :return: A flattened list of processed components.
100
+ """
101
+ processed_components = []
102
+
103
+ for config in service_configs:
104
+
105
+ if hasattr(config, "build"):
106
+ config = config.build(current_app)
107
+
108
+ if hasattr(config, 'components'):
109
+ component_property = config.components
110
+ if isinstance(component_property, list):
111
+ processed_components.extend(component_property)
112
+ elif isinstance(component_property, tuple):
113
+ processed_components.extend(list (component_property))
114
+ else:
115
+ raise ValueError(f"{config} component's definition is not supported")
116
+
117
+ return processed_components
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.5.71
3
+ Version: 1.5.72
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -71,7 +71,7 @@ oarepo_runtime/resources/file_resource.py,sha256=Ta3bFce7l0xwqkkOMOEu9mxbB8BbKj5
71
71
  oarepo_runtime/resources/json_serializer.py,sha256=82_-xQEtxKaPakv8R1oBAFbGnxskF_Ve4tcfcy4PetI,963
72
72
  oarepo_runtime/resources/localized_ui_json_serializer.py,sha256=3V9cJaG_e1PMXKVX_wKfBp1LmbeForwHyBNYdyha4uQ,1878
73
73
  oarepo_runtime/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
- oarepo_runtime/services/components.py,sha256=zaZroTqzV5fz8yVAtRFLbbkTT9iD_dx9jFYANm3JIfI,3285
74
+ oarepo_runtime/services/components.py,sha256=k--zu1RinwoKzg5qHp4H-Ddp9AFyjMJ97fydQ0DvI-A,4238
75
75
  oarepo_runtime/services/generators.py,sha256=j87HitHA_w2awsz0C5IAAJ0qjg9JMtvdO3dvh6FQyfg,250
76
76
  oarepo_runtime/services/results.py,sha256=_Din6CxQH7E5TP0TVZjIXJb2vyJRL_o_97jkUQo-GOc,4062
77
77
  oarepo_runtime/services/search.py,sha256=9xGTN5Yg6eTdptQ9qjO_umbacf9ooMuHYGXWYfla4-M,6227
@@ -131,9 +131,9 @@ tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
131
131
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
132
132
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
133
133
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
- oarepo_runtime-1.5.71.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
135
- oarepo_runtime-1.5.71.dist-info/METADATA,sha256=AWuYzAfF4eHqe4KwSfk-wbenh4tgwaUl6NEoEdSSLUM,4720
136
- oarepo_runtime-1.5.71.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
137
- oarepo_runtime-1.5.71.dist-info/entry_points.txt,sha256=0cschM0RHc6UJ1uudhu4EP0hrVStPGpgMO-XEDGRtY4,430
138
- oarepo_runtime-1.5.71.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
139
- oarepo_runtime-1.5.71.dist-info/RECORD,,
134
+ oarepo_runtime-1.5.72.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
135
+ oarepo_runtime-1.5.72.dist-info/METADATA,sha256=NmVgzl6SJu489vMIebbEad-M3jpzpxTER2qZZEHQ6M4,4720
136
+ oarepo_runtime-1.5.72.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
137
+ oarepo_runtime-1.5.72.dist-info/entry_points.txt,sha256=0cschM0RHc6UJ1uudhu4EP0hrVStPGpgMO-XEDGRtY4,430
138
+ oarepo_runtime-1.5.72.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
139
+ oarepo_runtime-1.5.72.dist-info/RECORD,,