oarepo-runtime 1.9.1__py3-none-any.whl → 1.9.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oarepo_runtime/datastreams/writers/publish.py +28 -24
- oarepo_runtime/records/dumpers/multilingual_dumper.py +6 -4
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/METADATA +1 -1
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/RECORD +8 -8
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/WHEEL +0 -0
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/entry_points.txt +0 -0
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/licenses/LICENSE +0 -0
- {oarepo_runtime-1.9.1.dist-info → oarepo_runtime-1.9.3.dist-info}/top_level.txt +0 -0
@@ -13,7 +13,7 @@ class PublishWriter(BaseWriter):
|
|
13
13
|
service,
|
14
14
|
request_name="publish_draft",
|
15
15
|
identity=None,
|
16
|
-
direct_call=
|
16
|
+
direct_call=True,
|
17
17
|
**kwargs
|
18
18
|
):
|
19
19
|
if isinstance(service, str):
|
@@ -34,27 +34,31 @@ class PublishWriter(BaseWriter):
|
|
34
34
|
|
35
35
|
def _write_entry(self, entry: StreamEntry):
|
36
36
|
if self._direct_call:
|
37
|
-
self._service.publish(self._identity, entry.id)
|
37
|
+
data = self._service.publish(self._identity, entry.id)
|
38
38
|
else:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
39
|
+
data = self._publish_via_request(self._identity, entry.id)
|
40
|
+
|
41
|
+
entry.entry = data.to_dict()
|
42
|
+
|
43
|
+
def _publish_via_request(self, identity, entry_id):
|
44
|
+
from invenio_requests.proxies import (
|
45
|
+
current_requests_service as current_invenio_requests_service,
|
46
|
+
)
|
47
|
+
from oarepo_requests.proxies import current_oarepo_requests_service
|
48
|
+
|
49
|
+
draft = self._service.read_draft(identity, entry_id)
|
50
|
+
request = current_oarepo_requests_service.create(
|
51
|
+
identity=identity,
|
52
|
+
data=None,
|
53
|
+
request_type=self._request_name,
|
54
|
+
topic=draft._record,
|
55
|
+
)
|
56
|
+
|
57
|
+
submit_result = current_invenio_requests_service.execute_action(
|
58
|
+
identity, request.id, "submit"
|
59
|
+
)
|
60
|
+
accept_result = current_invenio_requests_service.execute_action(
|
61
|
+
identity, request.id, "accept"
|
62
|
+
)
|
63
|
+
|
64
|
+
return self._service.read(identity, draft["id"])
|
@@ -18,15 +18,17 @@ class MultilingualDumper(SearchDumperExt):
|
|
18
18
|
def dump(self, record, data):
|
19
19
|
for path in self.path_traversal.iter(data):
|
20
20
|
rec = path[-1].current
|
21
|
-
|
22
|
-
|
21
|
+
lang = rec.get("lang", None)
|
22
|
+
if lang and lang in self.SUPPORTED_LANGS:
|
23
|
+
el_name = path[-1].key + "_" + lang
|
23
24
|
path[-1].parent_data.setdefault(el_name, []).append(rec["value"])
|
24
25
|
return data
|
25
26
|
|
26
27
|
def load(self, data, record_cls):
|
27
28
|
for path in self.path_traversal.iter(data):
|
28
29
|
rec = path[-1].current
|
29
|
-
|
30
|
-
|
30
|
+
lang = rec.get("lang", None)
|
31
|
+
if lang and lang in self.SUPPORTED_LANGS:
|
32
|
+
el_name = path[-1].key + "_" + lang
|
31
33
|
path[-1].parent_data.pop(el_name, None)
|
32
34
|
return data
|
@@ -42,7 +42,7 @@ oarepo_runtime/datastreams/readers/yaml.py,sha256=U4nyJQ8ocM_ohp-eUN1RjVoNzYV9z7
|
|
42
42
|
oarepo_runtime/datastreams/writers/__init__.py,sha256=PWufWNrixFhXv5wSv3_pzmrimroqVB2DVgTxVtY5FCg,526
|
43
43
|
oarepo_runtime/datastreams/writers/attachments_file.py,sha256=kV_IPAWawJ9PX-IfoncmLQXpdTbzRMsJie8uKX1vNp0,3161
|
44
44
|
oarepo_runtime/datastreams/writers/attachments_service.py,sha256=g_tbjUA3YnTE5gP21zlG2kIxneZsn0q95EVjlxB8s1M,4152
|
45
|
-
oarepo_runtime/datastreams/writers/publish.py,sha256=
|
45
|
+
oarepo_runtime/datastreams/writers/publish.py,sha256=XUuYjrbLMX77eIvY7I40On8SkrwpLuh2Y4yjltANcfE,2162
|
46
46
|
oarepo_runtime/datastreams/writers/service.py,sha256=8oXGG365ro_XEoZUncFltule_6TAbPPbSr-SBgcbWRA,6224
|
47
47
|
oarepo_runtime/datastreams/writers/utils.py,sha256=Lk_ZLNeXTLuFEn04lw1-6bJ7duG6kwA8X4wf9c_GiL4,1067
|
48
48
|
oarepo_runtime/datastreams/writers/validation_errors.py,sha256=wOCXdniR6so_4ExpdFYYgBRyENp7_6kVFZM2L-Hy3G8,661
|
@@ -58,7 +58,7 @@ oarepo_runtime/records/drafts.py,sha256=8BRmxXcKyVMBQbMMhVScPS_T7lwvR8kGKYQAxaVa
|
|
58
58
|
oarepo_runtime/records/pid_providers.py,sha256=V9KIeffLoFwjh7PDEBkpmVQb2j7w9pgKr9OlHV5g8S4,736
|
59
59
|
oarepo_runtime/records/dumpers/__init__.py,sha256=OmzNhLdMNKibmCksnj9eTX9xPBG30dziiK3j3bAAp3k,233
|
60
60
|
oarepo_runtime/records/dumpers/edtf_interval.py,sha256=8bE3JlaR7b33rxDc7LW9R8jcwNI66Zb07Jee6YUmlrE,1231
|
61
|
-
oarepo_runtime/records/dumpers/multilingual_dumper.py,sha256=
|
61
|
+
oarepo_runtime/records/dumpers/multilingual_dumper.py,sha256=vcoY25VZSyo3q7Zgexo0IOkE6xq1yTAM3uq7GZcSgUQ,1162
|
62
62
|
oarepo_runtime/records/entity_resolvers/__init__.py,sha256=UiiIT54pUu9j7qPAPfqVp4UTnXnppp0c_LtKbFnyt6Y,383
|
63
63
|
oarepo_runtime/records/entity_resolvers/proxies.py,sha256=P9c8JeHc25i_v8uXxTMHNlMNTFskET6dTM0VVMfLfyk,2097
|
64
64
|
oarepo_runtime/records/mappings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -150,13 +150,13 @@ oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
|
|
150
150
|
oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
|
151
151
|
oarepo_runtime/utils/index.py,sha256=ArrUUXB-KowUcUksRKqcFpmqct4bn9alO1zd_kX2tmU,292
|
152
152
|
oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
|
153
|
-
oarepo_runtime-1.9.
|
153
|
+
oarepo_runtime-1.9.3.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
|
154
154
|
tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
155
155
|
tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
|
156
156
|
tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
|
157
157
|
tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
158
|
-
oarepo_runtime-1.9.
|
159
|
-
oarepo_runtime-1.9.
|
160
|
-
oarepo_runtime-1.9.
|
161
|
-
oarepo_runtime-1.9.
|
162
|
-
oarepo_runtime-1.9.
|
158
|
+
oarepo_runtime-1.9.3.dist-info/METADATA,sha256=TCd9T3D_rVijLNLyRH5HeSNcxdWs0h6qT38B0NMuf1Q,4788
|
159
|
+
oarepo_runtime-1.9.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
160
|
+
oarepo_runtime-1.9.3.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
|
161
|
+
oarepo_runtime-1.9.3.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
|
162
|
+
oarepo_runtime-1.9.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|