oarepo-runtime 1.10.2__py3-none-any.whl → 2.0.0.dev3__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/__init__.py +24 -0
- oarepo_runtime/api.py +111 -0
- oarepo_runtime/cli/__init__.py +10 -21
- oarepo_runtime/cli/search.py +34 -0
- oarepo_runtime/config.py +86 -13
- oarepo_runtime/ext.py +64 -82
- oarepo_runtime/proxies.py +21 -5
- oarepo_runtime/records/__init__.py +11 -50
- oarepo_runtime/records/drafts.py +24 -18
- oarepo_runtime/records/mapping.py +84 -0
- oarepo_runtime/records/pid_providers.py +43 -7
- oarepo_runtime/records/systemfields/__init__.py +15 -33
- oarepo_runtime/records/systemfields/mapping.py +41 -24
- oarepo_runtime/records/systemfields/publication_status.py +59 -0
- oarepo_runtime/services/__init__.py +12 -0
- oarepo_runtime/services/config/__init__.py +15 -21
- oarepo_runtime/services/config/link_conditions.py +69 -75
- oarepo_runtime/services/config/permissions.py +62 -0
- oarepo_runtime/services/records/__init__.py +14 -1
- oarepo_runtime/services/records/links.py +21 -11
- oarepo_runtime/services/records/mapping.py +42 -0
- oarepo_runtime/services/results.py +98 -109
- oarepo_runtime/services/schema/__init__.py +12 -44
- oarepo_runtime/services/schema/i18n.py +47 -22
- oarepo_runtime/services/schema/i18n_ui.py +61 -24
- {oarepo_runtime-1.10.2.dist-info → oarepo_runtime-2.0.0.dev3.dist-info}/METADATA +9 -21
- oarepo_runtime-2.0.0.dev3.dist-info/RECORD +30 -0
- {oarepo_runtime-1.10.2.dist-info → oarepo_runtime-2.0.0.dev3.dist-info}/WHEEL +1 -2
- oarepo_runtime-2.0.0.dev3.dist-info/entry_points.txt +5 -0
- oarepo_runtime/cli/assets.py +0 -145
- oarepo_runtime/cli/base.py +0 -25
- oarepo_runtime/cli/cf.py +0 -15
- oarepo_runtime/cli/check.py +0 -167
- oarepo_runtime/cli/configuration.py +0 -51
- oarepo_runtime/cli/fixtures.py +0 -167
- oarepo_runtime/cli/index.py +0 -272
- oarepo_runtime/cli/permissions/__init__.py +0 -6
- oarepo_runtime/cli/permissions/base.py +0 -26
- oarepo_runtime/cli/permissions/evaluate.py +0 -63
- oarepo_runtime/cli/permissions/list.py +0 -239
- oarepo_runtime/cli/permissions/search.py +0 -121
- oarepo_runtime/cli/validate.py +0 -150
- oarepo_runtime/datastreams/__init__.py +0 -38
- oarepo_runtime/datastreams/asynchronous.py +0 -247
- oarepo_runtime/datastreams/catalogue.py +0 -150
- oarepo_runtime/datastreams/datastreams.py +0 -152
- oarepo_runtime/datastreams/errors.py +0 -54
- oarepo_runtime/datastreams/ext.py +0 -41
- oarepo_runtime/datastreams/fixtures.py +0 -265
- oarepo_runtime/datastreams/json.py +0 -4
- oarepo_runtime/datastreams/readers/__init__.py +0 -39
- oarepo_runtime/datastreams/readers/attachments.py +0 -51
- oarepo_runtime/datastreams/readers/excel.py +0 -123
- oarepo_runtime/datastreams/readers/json.py +0 -27
- oarepo_runtime/datastreams/readers/service.py +0 -54
- oarepo_runtime/datastreams/readers/yaml.py +0 -14
- oarepo_runtime/datastreams/semi_asynchronous.py +0 -91
- oarepo_runtime/datastreams/synchronous.py +0 -70
- oarepo_runtime/datastreams/transformers.py +0 -18
- oarepo_runtime/datastreams/types.py +0 -323
- oarepo_runtime/datastreams/utils.py +0 -131
- oarepo_runtime/datastreams/writers/__init__.py +0 -21
- oarepo_runtime/datastreams/writers/attachments_file.py +0 -92
- oarepo_runtime/datastreams/writers/attachments_service.py +0 -118
- oarepo_runtime/datastreams/writers/publish.py +0 -70
- oarepo_runtime/datastreams/writers/service.py +0 -175
- oarepo_runtime/datastreams/writers/utils.py +0 -30
- oarepo_runtime/datastreams/writers/validation_errors.py +0 -20
- oarepo_runtime/datastreams/writers/yaml.py +0 -56
- oarepo_runtime/ext_config.py +0 -67
- oarepo_runtime/i18n/__init__.py +0 -3
- oarepo_runtime/info/__init__.py +0 -0
- oarepo_runtime/info/check.py +0 -95
- oarepo_runtime/info/permissions/__init__.py +0 -0
- oarepo_runtime/info/permissions/debug.py +0 -191
- oarepo_runtime/info/views.py +0 -586
- oarepo_runtime/profile.py +0 -60
- oarepo_runtime/records/dumpers/__init__.py +0 -8
- oarepo_runtime/records/dumpers/edtf_interval.py +0 -38
- oarepo_runtime/records/dumpers/multilingual_dumper.py +0 -34
- oarepo_runtime/records/entity_resolvers/__init__.py +0 -13
- oarepo_runtime/records/entity_resolvers/proxies.py +0 -57
- oarepo_runtime/records/mappings/__init__.py +0 -0
- oarepo_runtime/records/mappings/rdm_parent_mapping.json +0 -483
- oarepo_runtime/records/owners/__init__.py +0 -3
- oarepo_runtime/records/owners/registry.py +0 -22
- oarepo_runtime/records/relations/__init__.py +0 -22
- oarepo_runtime/records/relations/base.py +0 -296
- oarepo_runtime/records/relations/internal.py +0 -46
- oarepo_runtime/records/relations/lookup.py +0 -28
- oarepo_runtime/records/relations/pid_relation.py +0 -102
- oarepo_runtime/records/systemfields/featured_file.py +0 -45
- oarepo_runtime/records/systemfields/has_draftcheck.py +0 -47
- oarepo_runtime/records/systemfields/icu.py +0 -371
- oarepo_runtime/records/systemfields/owner.py +0 -115
- oarepo_runtime/records/systemfields/record_status.py +0 -35
- oarepo_runtime/records/systemfields/selectors.py +0 -98
- oarepo_runtime/records/systemfields/synthetic.py +0 -130
- oarepo_runtime/resources/__init__.py +0 -4
- oarepo_runtime/resources/config.py +0 -12
- oarepo_runtime/resources/file_resource.py +0 -15
- oarepo_runtime/resources/json_serializer.py +0 -27
- oarepo_runtime/resources/localized_ui_json_serializer.py +0 -54
- oarepo_runtime/resources/resource.py +0 -53
- oarepo_runtime/resources/responses.py +0 -20
- oarepo_runtime/services/components.py +0 -429
- oarepo_runtime/services/config/draft_link.py +0 -23
- oarepo_runtime/services/config/permissions_presets.py +0 -174
- oarepo_runtime/services/config/service.py +0 -117
- oarepo_runtime/services/custom_fields/__init__.py +0 -80
- oarepo_runtime/services/custom_fields/mappings.py +0 -188
- oarepo_runtime/services/entity/__init__.py +0 -0
- oarepo_runtime/services/entity/config.py +0 -14
- oarepo_runtime/services/entity/schema.py +0 -9
- oarepo_runtime/services/entity/service.py +0 -48
- oarepo_runtime/services/expansions/__init__.py +0 -0
- oarepo_runtime/services/expansions/expandable_fields.py +0 -21
- oarepo_runtime/services/expansions/service.py +0 -4
- oarepo_runtime/services/facets/__init__.py +0 -33
- oarepo_runtime/services/facets/base.py +0 -12
- oarepo_runtime/services/facets/date.py +0 -72
- oarepo_runtime/services/facets/enum.py +0 -11
- oarepo_runtime/services/facets/facet_groups_names.py +0 -17
- oarepo_runtime/services/facets/max_facet.py +0 -13
- oarepo_runtime/services/facets/multilingual_facet.py +0 -33
- oarepo_runtime/services/facets/nested_facet.py +0 -32
- oarepo_runtime/services/facets/params.py +0 -192
- oarepo_runtime/services/facets/year_histogram.py +0 -200
- oarepo_runtime/services/files/__init__.py +0 -8
- oarepo_runtime/services/files/components.py +0 -62
- oarepo_runtime/services/files/service.py +0 -16
- oarepo_runtime/services/generators.py +0 -10
- oarepo_runtime/services/permissions/__init__.py +0 -3
- oarepo_runtime/services/permissions/generators.py +0 -103
- oarepo_runtime/services/relations/__init__.py +0 -0
- oarepo_runtime/services/relations/components.py +0 -15
- oarepo_runtime/services/relations/errors.py +0 -18
- oarepo_runtime/services/relations/mapping.py +0 -38
- oarepo_runtime/services/schema/cf.py +0 -13
- oarepo_runtime/services/schema/i18n_validation.py +0 -7
- oarepo_runtime/services/schema/marshmallow.py +0 -44
- oarepo_runtime/services/schema/marshmallow_to_json_schema.py +0 -72
- oarepo_runtime/services/schema/oneofschema.py +0 -192
- oarepo_runtime/services/schema/polymorphic.py +0 -21
- oarepo_runtime/services/schema/rdm.py +0 -75
- oarepo_runtime/services/schema/rdm_ui.py +0 -156
- oarepo_runtime/services/schema/ui.py +0 -251
- oarepo_runtime/services/schema/validation.py +0 -70
- oarepo_runtime/services/search.py +0 -282
- oarepo_runtime/services/service.py +0 -61
- oarepo_runtime/tasks.py +0 -6
- oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo +0 -0
- oarepo_runtime/translations/cs/LC_MESSAGES/messages.po +0 -85
- oarepo_runtime/translations/default_translations.py +0 -6
- oarepo_runtime/translations/en/LC_MESSAGES/messages.mo +0 -0
- oarepo_runtime/translations/en/LC_MESSAGES/messages.po +0 -89
- oarepo_runtime/translations/messages.pot +0 -91
- oarepo_runtime/uow.py +0 -146
- oarepo_runtime/utils/__init__.py +0 -0
- oarepo_runtime/utils/functools.py +0 -37
- oarepo_runtime/utils/identity_utils.py +0 -35
- oarepo_runtime/utils/index.py +0 -11
- oarepo_runtime/utils/path.py +0 -97
- oarepo_runtime-1.10.2.dist-info/RECORD +0 -163
- oarepo_runtime-1.10.2.dist-info/entry_points.txt +0 -16
- oarepo_runtime-1.10.2.dist-info/top_level.txt +0 -2
- tests/marshmallow_to_json/__init__.py +0 -0
- tests/marshmallow_to_json/test_datacite_ui_schema.py +0 -1410
- tests/marshmallow_to_json/test_simple_schema.py +0 -52
- tests/pkg_data/__init__.py +0 -0
- {oarepo_runtime-1.10.2.dist-info → oarepo_runtime-2.0.0.dev3.dist-info}/licenses/LICENSE +0 -0
@@ -1,85 +0,0 @@
|
|
1
|
-
# Czech translations for PROJECT.
|
2
|
-
# Copyright (C) 2023 ORGANIZATION
|
3
|
-
# This file is distributed under the same license as the PROJECT project.
|
4
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
|
5
|
-
#
|
6
|
-
msgid ""
|
7
|
-
msgstr ""
|
8
|
-
"Project-Id-Version: PROJECT VERSION\n"
|
9
|
-
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
10
|
-
"POT-Creation-Date: 2023-05-11 12:49+0200\n"
|
11
|
-
"PO-Revision-Date: 2023-05-11 12:50+0200\n"
|
12
|
-
"Last-Translator: \n"
|
13
|
-
"Language-Team: cs <LL@li.org>\n"
|
14
|
-
"Language: cs\n"
|
15
|
-
"MIME-Version: 1.0\n"
|
16
|
-
"Content-Type: text/plain; charset=utf-8\n"
|
17
|
-
"Content-Transfer-Encoding: 8bit\n"
|
18
|
-
"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n"
|
19
|
-
"Generated-By: Babel 2.12.1\n"
|
20
|
-
"X-Generator: Poedit 3.2.2\n"
|
21
|
-
|
22
|
-
#: oarepo_runtime/i18n/default_translations.py:3
|
23
|
-
msgid "Newest"
|
24
|
-
msgstr "Nejnovější"
|
25
|
-
|
26
|
-
#: oarepo_runtime/i18n/default_translations.py:4
|
27
|
-
msgid "Oldest"
|
28
|
-
msgstr "Nejstarší"
|
29
|
-
|
30
|
-
#: oarepo_runtime/i18n/default_translations.py:5
|
31
|
-
msgid "Best match"
|
32
|
-
msgstr "Nejlepší shoda"
|
33
|
-
|
34
|
-
#: oarepo_runtime/i18n/default_translations.py:6
|
35
|
-
msgid "Contact"
|
36
|
-
msgstr "Kontakt"
|
37
|
-
|
38
|
-
#: oarepo_runtime/ui/marshmallow.py:81
|
39
|
-
msgid "True"
|
40
|
-
msgstr "Ano"
|
41
|
-
|
42
|
-
#: oarepo_runtime/services/search.py:39 oarepo_runtime/services/search.py:127
|
43
|
-
msgid "By Title"
|
44
|
-
msgstr "Dle názvu"
|
45
|
-
|
46
|
-
#: oarepo_runtime/services/schema/ui.py:114
|
47
|
-
msgid "False"
|
48
|
-
msgstr "Ne"
|
49
|
-
|
50
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/validation.py:19
|
51
|
-
#, python-format
|
52
|
-
msgid "Invalid value %(identifier)s of identifier type %(type)s"
|
53
|
-
msgstr "%(type)s: Neplatná hodnota '%(identifier)s'"
|
54
|
-
|
55
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:152
|
56
|
-
msgid "access.status.open"
|
57
|
-
msgstr "otevřený přístup"
|
58
|
-
|
59
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:153
|
60
|
-
msgid "access.status.embargoed"
|
61
|
-
msgstr "odložené zpřístupnění"
|
62
|
-
|
63
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:154
|
64
|
-
msgid "access.status.restricted"
|
65
|
-
msgstr "omezený přístup"
|
66
|
-
|
67
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:155
|
68
|
-
msgid "access.status.metadata-only"
|
69
|
-
msgstr "pouze metadata"
|
70
|
-
|
71
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:105
|
72
|
-
msgid "Recently updated"
|
73
|
-
msgstr ""
|
74
|
-
|
75
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:109
|
76
|
-
msgid "Least recently updated"
|
77
|
-
msgstr ""
|
78
|
-
|
79
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:121
|
80
|
-
msgid "Version"
|
81
|
-
msgstr ""
|
82
|
-
|
83
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/i18n.py:28
|
84
|
-
msgid "Both language and text must be provided."
|
85
|
-
msgstr "Musí být vyplněn jazyk i hodnota."
|
Binary file
|
@@ -1,89 +0,0 @@
|
|
1
|
-
# English translations for PROJECT.
|
2
|
-
# Copyright (C) 2023 ORGANIZATION
|
3
|
-
# This file is distributed under the same license as the PROJECT project.
|
4
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
|
5
|
-
#
|
6
|
-
msgid ""
|
7
|
-
msgstr ""
|
8
|
-
"Project-Id-Version: PROJECT VERSION\n"
|
9
|
-
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
10
|
-
"POT-Creation-Date: 2023-05-11 12:49+0200\n"
|
11
|
-
"PO-Revision-Date: 2023-05-11 12:27+0200\n"
|
12
|
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13
|
-
"Language-Team: en <LL@li.org>\n"
|
14
|
-
"Language: en\n"
|
15
|
-
"MIME-Version: 1.0\n"
|
16
|
-
"Content-Type: text/plain; charset=utf-8\n"
|
17
|
-
"Content-Transfer-Encoding: 8bit\n"
|
18
|
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19
|
-
"Generated-By: Babel 2.12.1\n"
|
20
|
-
|
21
|
-
#: oarepo_runtime/i18n/default_translations.py:3
|
22
|
-
msgid "Newest"
|
23
|
-
msgstr ""
|
24
|
-
|
25
|
-
#: oarepo_runtime/i18n/default_translations.py:4
|
26
|
-
msgid "Oldest"
|
27
|
-
msgstr ""
|
28
|
-
|
29
|
-
#: oarepo_runtime/i18n/default_translations.py:5
|
30
|
-
msgid "Best match"
|
31
|
-
msgstr ""
|
32
|
-
|
33
|
-
#: oarepo_runtime/i18n/default_translations.py:6
|
34
|
-
msgid "Contact"
|
35
|
-
msgstr ""
|
36
|
-
|
37
|
-
#: oarepo_runtime/ui/marshmallow.py:81
|
38
|
-
msgid "True"
|
39
|
-
msgstr ""
|
40
|
-
|
41
|
-
#: oarepo_runtime/services/search.py:39 oarepo_runtime/services/search.py:127
|
42
|
-
msgid "By Title"
|
43
|
-
msgstr ""
|
44
|
-
|
45
|
-
#: oarepo_runtime/services/schema/ui.py:114
|
46
|
-
msgid "False"
|
47
|
-
msgstr ""
|
48
|
-
|
49
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/validation.py:19
|
50
|
-
#, python-format
|
51
|
-
msgid "Invalid value %(identifier)s of identifier type %(type)s"
|
52
|
-
msgstr ""
|
53
|
-
|
54
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:152
|
55
|
-
msgid "access.status.open"
|
56
|
-
msgstr "open access"
|
57
|
-
|
58
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:153
|
59
|
-
msgid "access.status.embargoed"
|
60
|
-
msgstr "embargoed access"
|
61
|
-
|
62
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:154
|
63
|
-
msgid "access.status.restricted"
|
64
|
-
msgstr "restricted access"
|
65
|
-
|
66
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:155
|
67
|
-
msgid "access.status.metadata-only"
|
68
|
-
msgstr "metadata only access"
|
69
|
-
|
70
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:105
|
71
|
-
msgid "Recently updated"
|
72
|
-
msgstr ""
|
73
|
-
|
74
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:109
|
75
|
-
msgid "Least recently updated"
|
76
|
-
msgstr ""
|
77
|
-
|
78
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:121
|
79
|
-
msgid "Version"
|
80
|
-
msgstr ""
|
81
|
-
|
82
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/i18n.py:30
|
83
|
-
#, python-brace-format
|
84
|
-
msgid "Both '{lang_name}' and '{value_name}' fields must be provided."
|
85
|
-
msgstr ""
|
86
|
-
|
87
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/i18n.py:28
|
88
|
-
msgid "Both language and text must be provided."
|
89
|
-
msgstr ""
|
@@ -1,91 +0,0 @@
|
|
1
|
-
# Translations template for PROJECT.
|
2
|
-
# Copyright (C) 2025 ORGANIZATION
|
3
|
-
# This file is distributed under the same license as the PROJECT project.
|
4
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2025.
|
5
|
-
#
|
6
|
-
#, fuzzy
|
7
|
-
msgid ""
|
8
|
-
msgstr ""
|
9
|
-
"Project-Id-Version: PROJECT VERSION\n"
|
10
|
-
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
11
|
-
"POT-Creation-Date: 2025-07-29 15:53+0200\n"
|
12
|
-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13
|
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
|
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15
|
-
"MIME-Version: 1.0\n"
|
16
|
-
"Content-Type: text/plain; charset=utf-8\n"
|
17
|
-
"Content-Transfer-Encoding: 8bit\n"
|
18
|
-
"Generated-By: Babel 2.17.0\n"
|
19
|
-
|
20
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:80
|
21
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:224
|
22
|
-
msgid "By Title"
|
23
|
-
msgstr ""
|
24
|
-
|
25
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:84
|
26
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:101
|
27
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/translations/default_translations.py:5
|
28
|
-
msgid "Best match"
|
29
|
-
msgstr ""
|
30
|
-
|
31
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:88
|
32
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:113
|
33
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/translations/default_translations.py:3
|
34
|
-
msgid "Newest"
|
35
|
-
msgstr ""
|
36
|
-
|
37
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:92
|
38
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:117
|
39
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/translations/default_translations.py:4
|
40
|
-
msgid "Oldest"
|
41
|
-
msgstr ""
|
42
|
-
|
43
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:105
|
44
|
-
msgid "Recently updated"
|
45
|
-
msgstr ""
|
46
|
-
|
47
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:109
|
48
|
-
msgid "Least recently updated"
|
49
|
-
msgstr ""
|
50
|
-
|
51
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/search.py:121
|
52
|
-
msgid "Version"
|
53
|
-
msgstr ""
|
54
|
-
|
55
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/i18n.py:28
|
56
|
-
msgid "Both language and text must be provided."
|
57
|
-
msgstr ""
|
58
|
-
|
59
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:155
|
60
|
-
msgid "True"
|
61
|
-
msgstr ""
|
62
|
-
|
63
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:155
|
64
|
-
msgid "False"
|
65
|
-
msgstr ""
|
66
|
-
|
67
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:175
|
68
|
-
msgid "access.status.open"
|
69
|
-
msgstr ""
|
70
|
-
|
71
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:176
|
72
|
-
msgid "access.status.embargoed"
|
73
|
-
msgstr ""
|
74
|
-
|
75
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:177
|
76
|
-
msgid "access.status.restricted"
|
77
|
-
msgstr ""
|
78
|
-
|
79
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/ui.py:178
|
80
|
-
msgid "access.status.metadata-only"
|
81
|
-
msgstr ""
|
82
|
-
|
83
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/services/schema/validation.py:35
|
84
|
-
#, python-format
|
85
|
-
msgid "Invalid value %(identifier)s of identifier type %(type)s"
|
86
|
-
msgstr ""
|
87
|
-
|
88
|
-
#: /Users/m/w/cesnet/oarepo-runtime/oarepo_runtime/translations/default_translations.py:6
|
89
|
-
msgid "Contact"
|
90
|
-
msgstr ""
|
91
|
-
|
oarepo_runtime/uow.py
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
import traceback
|
3
|
-
|
4
|
-
from flask import current_app
|
5
|
-
from invenio_indexer.api import bulk
|
6
|
-
from invenio_records_resources.services.uow import (
|
7
|
-
RecordCommitOp,
|
8
|
-
RecordDeleteOp,
|
9
|
-
UnitOfWork,
|
10
|
-
)
|
11
|
-
from opensearchpy.helpers import BulkIndexError, bulk
|
12
|
-
from opensearchpy.helpers import expand_action as default_expand_action
|
13
|
-
|
14
|
-
log = logging.getLogger("bulk_uow")
|
15
|
-
|
16
|
-
|
17
|
-
class CachingUnitOfWork(UnitOfWork):
|
18
|
-
def __init__(self, *args, **kwargs):
|
19
|
-
super().__init__(*args, **kwargs)
|
20
|
-
self.cache = {}
|
21
|
-
|
22
|
-
|
23
|
-
class BulkRecordCommitOp(RecordCommitOp):
|
24
|
-
def __init__(self, rc: RecordCommitOp):
|
25
|
-
super().__init__(rc._record, rc._indexer, rc._index_refresh)
|
26
|
-
self._previous = rc
|
27
|
-
|
28
|
-
def on_register(self, uow):
|
29
|
-
self._previous.on_register(uow)
|
30
|
-
|
31
|
-
def on_commit(self, uow):
|
32
|
-
"""Postponed."""
|
33
|
-
|
34
|
-
def get_index_action(self):
|
35
|
-
if self._indexer is None:
|
36
|
-
return None
|
37
|
-
|
38
|
-
index = self._indexer.record_to_index(self._record)
|
39
|
-
arguments = {}
|
40
|
-
body = self._indexer._prepare_record(self._record, index, arguments)
|
41
|
-
index = self._indexer._prepare_index(index)
|
42
|
-
|
43
|
-
action = {
|
44
|
-
"_op_type": "index",
|
45
|
-
"_index": index,
|
46
|
-
"_id": str(self._record.id),
|
47
|
-
"_version": self._record.revision_id,
|
48
|
-
"_version_type": self._indexer._version_type,
|
49
|
-
"_source": body,
|
50
|
-
}
|
51
|
-
action.update(arguments)
|
52
|
-
return action
|
53
|
-
|
54
|
-
|
55
|
-
class BulkRecordDeleteOp(RecordDeleteOp):
|
56
|
-
def __init__(self, rc: RecordDeleteOp):
|
57
|
-
super().__init__(rc._record, rc._indexer, rc._index_refresh)
|
58
|
-
self._previous = rc
|
59
|
-
|
60
|
-
def on_register(self, uow):
|
61
|
-
self._previous.on_register(uow)
|
62
|
-
|
63
|
-
def on_commit(self, uow):
|
64
|
-
"""Postponed."""
|
65
|
-
|
66
|
-
def get_index_action(self):
|
67
|
-
if self._indexer is None:
|
68
|
-
return None
|
69
|
-
index = self._indexer.record_to_index(self._record)
|
70
|
-
index = self._indexer._prepare_index(index)
|
71
|
-
|
72
|
-
action = {
|
73
|
-
"_op_type": "delete",
|
74
|
-
"_index": index,
|
75
|
-
"_id": str(self._record.id),
|
76
|
-
}
|
77
|
-
return action
|
78
|
-
|
79
|
-
|
80
|
-
class BulkUnitOfWork(CachingUnitOfWork):
|
81
|
-
_last_stack_trace = None
|
82
|
-
_last_exception = None
|
83
|
-
|
84
|
-
def register(self, op):
|
85
|
-
if isinstance(op, RecordCommitOp):
|
86
|
-
op = BulkRecordCommitOp(op)
|
87
|
-
elif isinstance(op, RecordDeleteOp):
|
88
|
-
op = BulkRecordDeleteOp(op)
|
89
|
-
return super().register(op)
|
90
|
-
|
91
|
-
def commit(self):
|
92
|
-
super().commit()
|
93
|
-
|
94
|
-
# do bulk indexing
|
95
|
-
bulk_data = []
|
96
|
-
indexer = None
|
97
|
-
for op in self._operations:
|
98
|
-
if isinstance(op, BulkRecordCommitOp) or isinstance(op, BulkRecordDeleteOp):
|
99
|
-
indexer = indexer or op._indexer
|
100
|
-
index_action = op.get_index_action()
|
101
|
-
if index_action:
|
102
|
-
bulk_data.append(index_action)
|
103
|
-
if indexer:
|
104
|
-
req_timeout = current_app.config["INDEXER_BULK_REQUEST_TIMEOUT"]
|
105
|
-
try:
|
106
|
-
resp = bulk(
|
107
|
-
indexer.client,
|
108
|
-
bulk_data,
|
109
|
-
stats_only=True,
|
110
|
-
request_timeout=req_timeout,
|
111
|
-
expand_action_callback=default_expand_action,
|
112
|
-
refresh=True,
|
113
|
-
)
|
114
|
-
except BulkIndexError as e:
|
115
|
-
raise e
|
116
|
-
|
117
|
-
def _mark_dirty(self):
|
118
|
-
"""Mark the unit of work as dirty."""
|
119
|
-
if self._dirty:
|
120
|
-
if self._last_stack_trace:
|
121
|
-
log.error(
|
122
|
-
f"UnitOfWork already committed or rolled back at {self._last_stack_trace}. "
|
123
|
-
f"Previous exception was {self._last_exception}"
|
124
|
-
)
|
125
|
-
|
126
|
-
raise RuntimeError(
|
127
|
-
f"The unit of work is already committed or rolledback. "
|
128
|
-
f"Set error level for logger 'bulk_uow' to at least WARNING "
|
129
|
-
f"to see the stack trace of the previous invocation."
|
130
|
-
)
|
131
|
-
|
132
|
-
self._dirty = True
|
133
|
-
if log.getEffectiveLevel() >= logging.WARNING:
|
134
|
-
try:
|
135
|
-
self._last_stack_trace = "\n"
|
136
|
-
self._last_stack_trace += "\n".join(traceback.format_stack())
|
137
|
-
except:
|
138
|
-
pass
|
139
|
-
|
140
|
-
try:
|
141
|
-
self._last_exception = traceback.format_exc()
|
142
|
-
except:
|
143
|
-
pass
|
144
|
-
|
145
|
-
|
146
|
-
__all__ = ["BulkUnitOfWork"]
|
oarepo_runtime/utils/__init__.py
DELETED
File without changes
|
@@ -1,37 +0,0 @@
|
|
1
|
-
def try_sequence(*funcs, ignored_exceptions=(), raised_exception=Exception):
|
2
|
-
raised_exceptions = []
|
3
|
-
for func in funcs:
|
4
|
-
try:
|
5
|
-
return func()
|
6
|
-
except ignored_exceptions as e:
|
7
|
-
raised_exceptions.append(e)
|
8
|
-
raise raised_exception(raised_exceptions) from raised_exceptions[-1]
|
9
|
-
|
10
|
-
|
11
|
-
class class_property:
|
12
|
-
def __init__(self, getter=None, setter=None):
|
13
|
-
if getter is not None and not isinstance(getter, classmethod):
|
14
|
-
getter = classmethod(getter)
|
15
|
-
if setter is not None and not isinstance(setter, classmethod):
|
16
|
-
setter = classmethod(setter)
|
17
|
-
self.__get = getter
|
18
|
-
self.__set = setter
|
19
|
-
|
20
|
-
if getter:
|
21
|
-
info = getter.__get__(object) # just need the info attrs.
|
22
|
-
self.__doc__ = info.__doc__
|
23
|
-
self.__name__ = info.__name__
|
24
|
-
self.__module__ = info.__module__
|
25
|
-
|
26
|
-
def __get__(self, obj, type=None): # NOSONAR - this is a descriptor
|
27
|
-
if obj and type is None:
|
28
|
-
type = obj.__class__ # NOSONAR - this is a descriptor
|
29
|
-
return self.__get.__get__(obj, type)()
|
30
|
-
|
31
|
-
def __set__(self, obj, value):
|
32
|
-
if obj is None:
|
33
|
-
return self
|
34
|
-
return self.__set.__get__(obj)(value)
|
35
|
-
|
36
|
-
def setter(self, setter):
|
37
|
-
return self.__class__(self.__get, setter)
|
@@ -1,35 +0,0 @@
|
|
1
|
-
from flask import current_app
|
2
|
-
from flask_principal import Identity, UserNeed, identity_loaded
|
3
|
-
from invenio_access.models import User
|
4
|
-
|
5
|
-
|
6
|
-
def get_user_and_identity(user_id=None, username=None, email=None):
|
7
|
-
def lookup_user():
|
8
|
-
if user_id is not None:
|
9
|
-
return User.query.filter_by(id=user_id).one()
|
10
|
-
elif username is not None:
|
11
|
-
return User.query.filter_by(username=username).one()
|
12
|
-
elif email is not None:
|
13
|
-
return User.query.filter_by(email=email).one()
|
14
|
-
else:
|
15
|
-
raise ValueError(
|
16
|
-
"At least one of user_id, username, or email must be provided."
|
17
|
-
)
|
18
|
-
|
19
|
-
user = lookup_user()
|
20
|
-
|
21
|
-
identity = Identity(user.id)
|
22
|
-
identity.provides.add(UserNeed(user.id))
|
23
|
-
if (
|
24
|
-
hasattr(current_app.wsgi_app, "mounts")
|
25
|
-
and "/api" in current_app.wsgi_app.mounts
|
26
|
-
):
|
27
|
-
# called from UI
|
28
|
-
api_app = current_app.wsgi_app.mounts["/api"]
|
29
|
-
else:
|
30
|
-
# called from API
|
31
|
-
api_app = current_app
|
32
|
-
with api_app.app_context():
|
33
|
-
with current_app.test_request_context("/api"):
|
34
|
-
identity_loaded.send(api_app, identity=identity)
|
35
|
-
return user, identity
|
oarepo_runtime/utils/index.py
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
from invenio_search import current_search_client
|
2
|
-
from invenio_search.utils import build_alias_name
|
3
|
-
from invenio_search.engine import dsl
|
4
|
-
|
5
|
-
def prefixed_index(index):
|
6
|
-
return dsl.Index(
|
7
|
-
build_alias_name(
|
8
|
-
index._name,
|
9
|
-
),
|
10
|
-
using = current_search_client
|
11
|
-
)
|
oarepo_runtime/utils/path.py
DELETED
@@ -1,97 +0,0 @@
|
|
1
|
-
import dataclasses
|
2
|
-
from typing import Any, Dict, Iterator, List, Optional, Union
|
3
|
-
|
4
|
-
|
5
|
-
@dataclasses.dataclass
|
6
|
-
class PathPrefix:
|
7
|
-
key: str
|
8
|
-
matched_path: Union[int, None]
|
9
|
-
sub_prefixes: List["PathPrefix"] = dataclasses.field(default_factory=list)
|
10
|
-
|
11
|
-
|
12
|
-
@dataclasses.dataclass
|
13
|
-
class PathStackEntry:
|
14
|
-
parent_data: Dict[str, Any]
|
15
|
-
prefix: PathPrefix
|
16
|
-
index: Optional[int] = None
|
17
|
-
|
18
|
-
@property
|
19
|
-
def key(self):
|
20
|
-
return self.prefix.key
|
21
|
-
|
22
|
-
@property
|
23
|
-
def current(self):
|
24
|
-
ret = self.parent_data[self.prefix.key]
|
25
|
-
if self.index is not None:
|
26
|
-
ret = ret[self.index]
|
27
|
-
return ret
|
28
|
-
|
29
|
-
def set(self, value):
|
30
|
-
if self.index is None:
|
31
|
-
self.parent_data[self.prefix.key] = value
|
32
|
-
else:
|
33
|
-
self.parent_data[self.prefix.key][self.index] = value
|
34
|
-
|
35
|
-
def enter(self, prefix: PathPrefix):
|
36
|
-
current = self.current
|
37
|
-
if not isinstance(current, dict):
|
38
|
-
return []
|
39
|
-
if prefix.key not in current:
|
40
|
-
return []
|
41
|
-
child = current[prefix.key]
|
42
|
-
if isinstance(child, (list, tuple)):
|
43
|
-
return [
|
44
|
-
# the data in the entry is parent data, that's why current is here
|
45
|
-
PathStackEntry(parent_data=current, prefix=prefix, index=idx)
|
46
|
-
for idx, x in enumerate(child)
|
47
|
-
]
|
48
|
-
else:
|
49
|
-
return [
|
50
|
-
# the data in the entry is parent data, that's why current is here
|
51
|
-
PathStackEntry(parent_data=current, prefix=prefix)
|
52
|
-
]
|
53
|
-
|
54
|
-
|
55
|
-
class PathTraversal:
|
56
|
-
"""A helper class for getting data at multiple paths"""
|
57
|
-
|
58
|
-
def __init__(self, paths):
|
59
|
-
self.paths = paths
|
60
|
-
self._create_path_tree()
|
61
|
-
|
62
|
-
def _create_path_tree(self):
|
63
|
-
"""
|
64
|
-
Create tree of PathPrefix objects from a list of paths
|
65
|
-
"""
|
66
|
-
root = PathPrefix("", None)
|
67
|
-
for path_idx, pth in enumerate(self.paths):
|
68
|
-
node = root
|
69
|
-
split_path = pth.split("/")
|
70
|
-
for idx, entry in enumerate(split_path):
|
71
|
-
try:
|
72
|
-
node = next(x for x in node.sub_prefixes if x.key == entry)
|
73
|
-
except StopIteration:
|
74
|
-
child = PathPrefix(
|
75
|
-
entry, path_idx if idx + 1 == len(split_path) else None
|
76
|
-
)
|
77
|
-
node.sub_prefixes.append(child)
|
78
|
-
node = child
|
79
|
-
self._path_tree = root
|
80
|
-
|
81
|
-
def iter(self, data) -> Iterator[List[PathStackEntry]]:
|
82
|
-
"""
|
83
|
-
yields List[PathStackEntry] for each matching path
|
84
|
-
"""
|
85
|
-
queue = [[PathStackEntry({"": data}, self._path_tree, None)]]
|
86
|
-
while queue:
|
87
|
-
prefix_node: PathPrefix
|
88
|
-
stack = queue.pop()
|
89
|
-
top: PathStackEntry = stack[-1]
|
90
|
-
prefix = top.prefix
|
91
|
-
if prefix.matched_path is not None:
|
92
|
-
yield stack
|
93
|
-
for sub_prefix in reversed(prefix.sub_prefixes):
|
94
|
-
children = top.enter(sub_prefix)
|
95
|
-
for child in children:
|
96
|
-
queue.append(stack + [child])
|
97
|
-
return data
|