From 108e0d9f2852d92031f7788965d2f4475dfd6d01 Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Mon, 15 Apr 2024 14:40:53 +0200 Subject: [PATCH] isort --- dsp_permissions_scripts/oap/oap_get.py | 14 ++++++++------ dsp_permissions_scripts/oap/oap_model.py | 4 +++- dsp_permissions_scripts/oap/oap_serialize.py | 4 +++- dsp_permissions_scripts/oap/oap_set.py | 11 +++++++---- dsp_permissions_scripts/template.py | 6 ++++-- tests/test_oap_serialization.py | 6 ++++-- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/dsp_permissions_scripts/oap/oap_get.py b/dsp_permissions_scripts/oap/oap_get.py index 1d9eac63..8a2c251b 100644 --- a/dsp_permissions_scripts/oap/oap_get.py +++ b/dsp_permissions_scripts/oap/oap_get.py @@ -1,14 +1,16 @@ -from typing import Any, Iterable +from typing import Any +from typing import Iterable from urllib.parse import quote_plus from dsp_permissions_scripts.models.errors import ApiError -from dsp_permissions_scripts.oap.oap_model import Oap, OapRetrieveConfig, ResourceOap, ValueOap +from dsp_permissions_scripts.oap.oap_model import Oap +from dsp_permissions_scripts.oap.oap_model import OapRetrieveConfig +from dsp_permissions_scripts.oap.oap_model import ResourceOap +from dsp_permissions_scripts.oap.oap_model import ValueOap from dsp_permissions_scripts.utils.dsp_client import DspClient from dsp_permissions_scripts.utils.get_logger import get_logger -from dsp_permissions_scripts.utils.project import ( - get_all_resource_class_iris_of_project, - get_project_iri_and_onto_iris_by_shortcode, -) +from dsp_permissions_scripts.utils.project import get_all_resource_class_iris_of_project +from dsp_permissions_scripts.utils.project import get_project_iri_and_onto_iris_by_shortcode from dsp_permissions_scripts.utils.scope_serialization import create_scope_from_string logger = get_logger(__name__) diff --git a/dsp_permissions_scripts/oap/oap_model.py b/dsp_permissions_scripts/oap/oap_model.py index 71cc86f2..8e8acb52 100644 --- a/dsp_permissions_scripts/oap/oap_model.py +++ b/dsp_permissions_scripts/oap/oap_model.py @@ -2,7 +2,9 @@ from typing import Literal -from pydantic import BaseModel, ConfigDict, model_validator +from pydantic import BaseModel +from pydantic import ConfigDict +from pydantic import model_validator from dsp_permissions_scripts.models.scope import PermissionScope diff --git a/dsp_permissions_scripts/oap/oap_serialize.py b/dsp_permissions_scripts/oap/oap_serialize.py index 64993788..5c347b85 100644 --- a/dsp_permissions_scripts/oap/oap_serialize.py +++ b/dsp_permissions_scripts/oap/oap_serialize.py @@ -2,7 +2,9 @@ from pathlib import Path from typing import Literal -from dsp_permissions_scripts.oap.oap_model import Oap, ResourceOap, ValueOap +from dsp_permissions_scripts.oap.oap_model import Oap +from dsp_permissions_scripts.oap.oap_model import ResourceOap +from dsp_permissions_scripts.oap.oap_model import ValueOap from dsp_permissions_scripts.utils.get_logger import get_logger logger = get_logger(__name__) diff --git a/dsp_permissions_scripts/oap/oap_set.py b/dsp_permissions_scripts/oap/oap_set.py index 7c20f68b..e1e48d71 100644 --- a/dsp_permissions_scripts/oap/oap_set.py +++ b/dsp_permissions_scripts/oap/oap_set.py @@ -1,14 +1,17 @@ # pylint: disable=too-many-arguments -from concurrent.futures import ThreadPoolExecutor, as_completed -from datetime import datetime import itertools import re +from concurrent.futures import ThreadPoolExecutor +from concurrent.futures import as_completed +from datetime import datetime -from dsp_permissions_scripts.models.errors import ApiError, PermissionsAlreadyUpToDate +from dsp_permissions_scripts.models.errors import ApiError +from dsp_permissions_scripts.models.errors import PermissionsAlreadyUpToDate from dsp_permissions_scripts.models.scope import PermissionScope from dsp_permissions_scripts.oap.oap_get import get_resource -from dsp_permissions_scripts.oap.oap_model import Oap, ValueOap +from dsp_permissions_scripts.oap.oap_model import Oap +from dsp_permissions_scripts.oap.oap_model import ValueOap from dsp_permissions_scripts.utils.dsp_client import DspClient from dsp_permissions_scripts.utils.get_logger import get_logger from dsp_permissions_scripts.utils.scope_serialization import create_string_from_scope diff --git a/dsp_permissions_scripts/template.py b/dsp_permissions_scripts/template.py index 5435011f..4148e4ce 100644 --- a/dsp_permissions_scripts/template.py +++ b/dsp_permissions_scripts/template.py @@ -1,6 +1,7 @@ from dsp_permissions_scripts.ap.ap_delete import delete_ap_of_group_on_server from dsp_permissions_scripts.ap.ap_get import get_aps_of_project -from dsp_permissions_scripts.ap.ap_model import Ap, ApValue +from dsp_permissions_scripts.ap.ap_model import Ap +from dsp_permissions_scripts.ap.ap_model import ApValue from dsp_permissions_scripts.ap.ap_serialize import serialize_aps_of_project from dsp_permissions_scripts.ap.ap_set import apply_updated_aps_on_server from dsp_permissions_scripts.doap.doap_get import get_doaps_of_project @@ -11,7 +12,8 @@ from dsp_permissions_scripts.models.host import Hosts from dsp_permissions_scripts.models.scope import PUBLIC from dsp_permissions_scripts.oap.oap_get import get_all_oaps_of_project -from dsp_permissions_scripts.oap.oap_model import Oap, OapRetrieveConfig +from dsp_permissions_scripts.oap.oap_model import Oap +from dsp_permissions_scripts.oap.oap_model import OapRetrieveConfig from dsp_permissions_scripts.oap.oap_serialize import serialize_oaps from dsp_permissions_scripts.oap.oap_set import apply_updated_oaps_on_server from dsp_permissions_scripts.utils.authentication import login diff --git a/tests/test_oap_serialization.py b/tests/test_oap_serialization.py index 1847352a..80983fce 100644 --- a/tests/test_oap_serialization.py +++ b/tests/test_oap_serialization.py @@ -4,8 +4,10 @@ from dsp_permissions_scripts.models import group from dsp_permissions_scripts.models.scope import PermissionScope -from dsp_permissions_scripts.oap.oap_model import Oap, ResourceOap -from dsp_permissions_scripts.oap.oap_serialize import deserialize_oaps, serialize_oaps +from dsp_permissions_scripts.oap.oap_model import Oap +from dsp_permissions_scripts.oap.oap_model import ResourceOap +from dsp_permissions_scripts.oap.oap_serialize import deserialize_oaps +from dsp_permissions_scripts.oap.oap_serialize import serialize_oaps from tests.test_scope_serialization import compare_scopes