Skip to content

Commit f6b0945

Browse files
authored
Merge pull request #33 from actinia-org/imports
Adjust imports
2 parents fa620a7 + 08e57cb commit f6b0945

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ bash create_own_plugin.sh actinia-ex2-plugin
100100
## Hint for the development of actinia plugins
101101

102102
### skip permission check
103-
The parameter [`skip_permission_check`](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L1420-L1422) (see [example in actinia-statistic plugin](https://github.com/mundialis/actinia_statistic_plugin/blob/master/src/actinia_statistic_plugin/vector_sampling.py#L207))
103+
The parameter [`skip_permission_check`](https://github.com/actinia-org/actinia-processing-lib/blob/1.1.1/src/actinia_processing_lib/ephemeral_processing.py#L1914-L1917) (see [example in actinia-statistic plugin](https://github.com/actinia-org/actinia-statistic-plugin/blob/0.3.1/src/actinia_statistic_plugin/vector_sampling.py#L224))
104104
should only be set to `True` if you are sure that you really don't want to check the permissions.
105105

106106
The skip of the permission check leads to a skipping of:
107-
* [the module check](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L579-L589)
108-
* [the limit of the number of processes](https://github.com/mundialis/actinia_core/blob/main/src/actinia_core/processing/actinia_processing/ephemeral_processing.py#L566-L570)
107+
* [the module check](https://github.com/actinia-org/actinia-processing-lib/blob/1.1.1/src/actinia_processing_lib/ephemeral_processing.py#L676-L688)
108+
* [the limit of the number of processes](https://github.com/actinia-org/actinia-processing-lib/blob/1.1.1/src/actinia_processing_lib/ephemeral_processing.py#L658-L667)
109109
* the limit of the processing time
110110

111111
Not skipped are:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ keywords = [
2727
"example",
2828
]
2929
dependencies = [
30+
"actinia-rest-lib>=1.0.0",
3031
"colorlog>=4.2.1",
3132
"xmltodict",
3233
]

src/actinia_example_plugin/api/project_helloworld.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from typing import ClassVar
2727

2828
from actinia_core.models.response_models import SimpleResponseModel
29-
from actinia_core.rest.base.deprecated_locations import (
29+
from actinia_rest_lib.deprecated_locations import (
3030
location_deprecated_decorator,
3131
)
3232
from flask import jsonify, make_response, request

src/actinia_example_plugin/endpoints.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,25 @@
2222
__copyright__ = "Copyright 2022-2024 mundialis GmbH & Co. KG"
2323
__maintainer__ = "mundialis GmbH & Co. KG"
2424

25-
from actinia_core.endpoints import get_endpoint_class_name
26-
from flask_restful_swagger_2 import Api
25+
from flask_restful_swagger_2 import Api, Resource
2726

2827
from actinia_example_plugin.api.helloworld import HelloWorld
2928
from actinia_example_plugin.api.project_helloworld import ProjectHelloWorld
3029

3130

31+
def get_endpoint_class_name(
32+
endpoint_class: Resource,
33+
projects_url_part: str = "projects",
34+
) -> str:
35+
"""Create the name for the given endpoint class."""
36+
endpoint_class_name = endpoint_class.__name__.lower()
37+
if projects_url_part != "projects":
38+
name = f"{endpoint_class_name}_{projects_url_part}"
39+
else:
40+
name = endpoint_class_name
41+
return name
42+
43+
3244
def create_project_endpoints(
3345
apidoc: Api,
3446
projects_url_part: str = "projects",

0 commit comments

Comments
 (0)