oarepo-runtime 1.9.0__py3-none-any.whl → 1.9.2__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/types.py +5 -1
- oarepo_runtime/datastreams/writers/publish.py +28 -24
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/METADATA +1 -1
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/RECORD +8 -8
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/WHEEL +0 -0
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/entry_points.txt +0 -0
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/licenses/LICENSE +0 -0
- {oarepo_runtime-1.9.0.dist-info → oarepo_runtime-1.9.2.dist-info}/top_level.txt +0 -0
@@ -236,10 +236,14 @@ class DataStreamCallback:
|
|
236
236
|
self.log_error_entry = log_error_entry
|
237
237
|
|
238
238
|
def batch_started(self, batch):
|
239
|
-
log.info("Batch started: %s", batch)
|
239
|
+
log.info("Batch started: %s", batch.seq)
|
240
|
+
if log.isEnabledFor(logging.DEBUG):
|
241
|
+
log.debug("Content: %s", batch)
|
240
242
|
|
241
243
|
def batch_finished(self, batch: StreamBatch):
|
242
244
|
log.info("Batch finished: %s", batch.seq)
|
245
|
+
if log.isEnabledFor(logging.DEBUG):
|
246
|
+
log.debug("Content: %s", batch)
|
243
247
|
for err in batch.errors:
|
244
248
|
log.error("Failed batch: %s: %s", err, batch.seq)
|
245
249
|
if self.log_error_entry:
|
@@ -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"])
|
@@ -31,7 +31,7 @@ oarepo_runtime/datastreams/json.py,sha256=OkIkGKUawtYoGelyS5V92DVk7Ei7SlkMMny2Ue
|
|
31
31
|
oarepo_runtime/datastreams/semi_asynchronous.py,sha256=kNc6BBnV6oFoY9kHgf5l8fd1wibRfI0dwyzLtu4fmUA,2940
|
32
32
|
oarepo_runtime/datastreams/synchronous.py,sha256=t5lfnMkLqy3jK5zMl-nIuA0HlMPiHGjwCqZ8XQP-3GM,2595
|
33
33
|
oarepo_runtime/datastreams/transformers.py,sha256=q5KzHPl2kJg7HP1BtKJ7F_UMqg_7L1ZGDX0O7s8D6UI,521
|
34
|
-
oarepo_runtime/datastreams/types.py,sha256=
|
34
|
+
oarepo_runtime/datastreams/types.py,sha256=pAxb1R9tJyatkX7Zo9IYi-Dm8c6DOdvh0_XMix4yZyg,10130
|
35
35
|
oarepo_runtime/datastreams/utils.py,sha256=w24qRRw1ZawPFbgqtxhpYnxPnghSn0pp49JLLy8wTms,4280
|
36
36
|
oarepo_runtime/datastreams/readers/__init__.py,sha256=P1n3llZQ3AFHnSPbeT1VaCJcEtRFz9AbHfjkZv5LG7s,1103
|
37
37
|
oarepo_runtime/datastreams/readers/attachments.py,sha256=A7EC1TqyTHG-go5DIaRotlBSOm6o9hGqAKyVVAceCRU,1956
|
@@ -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
|
@@ -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.2.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.2.dist-info/METADATA,sha256=o-rT5Q2aByveCjJPC48lEVUE4GRgo_gLBom6k_gAExA,4788
|
159
|
+
oarepo_runtime-1.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
160
|
+
oarepo_runtime-1.9.2.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
|
161
|
+
oarepo_runtime-1.9.2.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
|
162
|
+
oarepo_runtime-1.9.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|