From 652c327312aecdde34c048fe62e9b874f2634e79 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Mon, 8 May 2023 11:46:53 +0200 Subject: [PATCH] WIP: Rename caosdb -> linkahead --- .gitlab-ci.yml | 2 +- Makefile | 4 ++-- RELEASE_GUIDELINES.md | 2 +- examples/server_side_script.py | 2 +- examples/set_permissions.py | 2 +- src/doc/Makefile | 2 +- src/doc/gallery/Makefile | 2 +- src/doc/gallery/curator_permissions.py | 2 +- src/linkahead/__init__.py | 22 +++++++++---------- src/linkahead/apiutils.py | 8 +++---- src/linkahead/cached.py | 2 +- src/linkahead/common/administration.py | 8 +++---- src/linkahead/common/datatype.py | 4 ++-- src/linkahead/common/models.py | 22 +++++++++---------- src/linkahead/common/state.py | 2 +- src/linkahead/common/utils.py | 2 +- src/linkahead/common/versioning.py | 4 ++-- src/linkahead/configuration.py | 2 +- .../connection/authentication/auth_token.py | 6 ++--- .../external_credentials_provider.py | 2 +- .../connection/authentication/input.py | 2 +- .../connection/authentication/interface.py | 10 ++++----- .../connection/authentication/keyring.py | 4 ++-- .../connection/authentication/pass.py | 4 ++-- .../connection/authentication/plain.py | 2 +- .../authentication/unauthenticated.py | 4 ++-- src/linkahead/connection/connection.py | 8 +++---- src/linkahead/connection/encode.py | 2 +- src/linkahead/connection/interface.py | 2 +- src/linkahead/connection/mockup.py | 2 +- src/linkahead/connection/utils.py | 2 +- src/linkahead/exceptions.py | 2 +- src/linkahead/high_level_api.py | 6 ++--- ...sdb-ini.yml => schema-pylinkahead-ini.yml} | 0 .../utils/checkFileSystemConsistency.py | 4 ++-- src/linkahead/utils/create_revision.py | 6 ++--- src/linkahead/utils/get_entity.py | 2 +- src/linkahead/utils/linkahead_admin.py | 10 ++++----- src/linkahead/utils/plantuml.py | 6 ++--- src/linkahead/utils/register_tests.py | 6 ++--- src/linkahead/utils/server_side_scripting.py | 8 +++---- src/linkahead/yamlapi.py | 8 +++---- unittests/test_acl.py | 4 ++-- unittests/test_add_property.py | 4 ++-- unittests/test_administraction.py | 6 ++--- unittests/test_apiutils.py | 10 ++++----- unittests/test_authentication_auth_token.py | 12 +++++----- unittests/test_authentication_external.py | 4 ++-- unittests/test_authentication_keyring.py | 4 ++-- unittests/test_authentication_pass.py | 2 +- unittests/test_authentication_plain.py | 4 ++-- .../test_authentication_unauthenticated.py | 12 +++++----- unittests/test_cached.py | 6 ++--- unittests/test_concrete_property.py | 8 +++---- unittests/test_configuration.py | 4 ++-- unittests/test_connection.py | 16 +++++++------- unittests/test_connection_utils.py | 16 +++++++------- unittests/test_container.py | 4 ++-- unittests/test_datatype.py | 8 +++---- unittests/test_entity.py | 6 ++--- unittests/test_error_handling.py | 8 +++---- unittests/test_file.py | 6 ++--- unittests/test_high_level_api.py | 12 +++++----- unittests/test_issues.py | 4 ++-- unittests/test_message.py | 8 +++---- unittests/test_plantuml.py | 6 ++--- unittests/test_property.py | 6 ++--- unittests/test_query.py | 4 ++-- unittests/test_record.py | 4 ++-- unittests/test_record_type.py | 6 ++--- unittests/test_schema.py | 4 ++-- unittests/test_server_side_scripting.py | 8 +++---- unittests/test_state.py | 6 ++--- unittests/test_utils.py | 4 ++-- unittests/test_versioning.py | 8 +++---- unittests/test_yamlapi.py | 4 ++-- 76 files changed, 215 insertions(+), 215 deletions(-) rename src/linkahead/{schema-pycaosdb-ini.yml => schema-pylinkahead-ini.yml} (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0430a4f6..24017531 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/Makefile b/Makefile index 0a0888ad..d15c830d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> @@ -40,7 +40,7 @@ style: .PHONY: style lint: - pylint --unsafe-load-any-extension=y -d all -e E,F src/caosdb/common + pylint --unsafe-load-any-extension=y -d all -e E,F src/linkahead/common .PHONY: lint unittest: diff --git a/RELEASE_GUIDELINES.md b/RELEASE_GUIDELINES.md index 95ee8e31..b3025f00 100644 --- a/RELEASE_GUIDELINES.md +++ b/RELEASE_GUIDELINES.md @@ -1,7 +1,7 @@ # Release Guidelines for the CaosDB Python Client Library This document specifies release guidelines in addition to the general release -guidelines of the CaosDB Project +guidelines of the LinkAhead Project ([RELEASE_GUIDELINES.md](https://gitlab.com/caosdb/caosdb/blob/dev/RELEASE_GUIDELINES.md)) ## General Prerequisites diff --git a/examples/server_side_script.py b/examples/server_side_script.py index 71bd9c05..0c5013eb 100755 --- a/examples/server_side_script.py +++ b/examples/server_side_script.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/examples/set_permissions.py b/examples/set_permissions.py index 8162b11b..8eef49fe 100755 --- a/examples/set_permissions.py +++ b/examples/set_permissions.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (c) 2019 IndiScale GmbH # Copyright (c) 2019 Daniel Hornung <d.hornung@indiscale.com> diff --git a/src/doc/Makefile b/src/doc/Makefile index 64219c59..0f1d3c6a 100644 --- a/src/doc/Makefile +++ b/src/doc/Makefile @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Daniel Hornung <d.hornung@indiscale.com> diff --git a/src/doc/gallery/Makefile b/src/doc/gallery/Makefile index 658f9a6a..b8ed911d 100644 --- a/src/doc/gallery/Makefile +++ b/src/doc/gallery/Makefile @@ -1,4 +1,4 @@ -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2022 Daniel Hornung <d.hornung@indiscale.com> diff --git a/src/doc/gallery/curator_permissions.py b/src/doc/gallery/curator_permissions.py index 16b4b7f6..36eb4500 100644 --- a/src/doc/gallery/curator_permissions.py +++ b/src/doc/gallery/curator_permissions.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> diff --git a/src/linkahead/__init__.py b/src/linkahead/__init__.py index acf323e8..0bc70972 100644 --- a/src/linkahead/__init__.py +++ b/src/linkahead/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -34,24 +34,24 @@ from os import environ, getcwd from os.path import expanduser, join # Import of convenience methods: -import caosdb.apiutils -from caosdb.common import administration -from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, +import linkahead.apiutils +from linkahead.common import administration +from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, LIST, REFERENCE, TEXT) -from caosdb.common.state import State, Transition +from linkahead.common.state import State, Transition # Import of the basic API classes: -from caosdb.common.models import (ACL, ALL, FIX, NONE, OBLIGATORY, RECOMMENDED, +from linkahead.common.models import (ACL, ALL, FIX, NONE, OBLIGATORY, RECOMMENDED, SUGGESTED, Container, DropOffBox, Entity, File, Info, Message, Permissions, Property, Query, QueryTemplate, Record, RecordType, delete, execute_query, get_global_acl, get_known_permissions, raise_errors) -from caosdb.utils.get_entity import get_entity_by_name, get_entity_by_path, get_entity_by_id -from caosdb.configuration import _read_config_files, configure, get_config -from caosdb.connection.connection import configure_connection, get_connection -from caosdb.exceptions import * +from linkahead.utils.get_entity import get_entity_by_name, get_entity_by_path, get_entity_by_id +from linkahead.configuration import _read_config_files, configure, get_config +from linkahead.connection.connection import configure_connection, get_connection +from linkahead.exceptions import * try: - from caosdb.version import version as __version__ + from linkahead.version import version as __version__ except ModuleNotFoundError: version = "uninstalled" __version__ = version diff --git a/src/linkahead/apiutils.py b/src/linkahead/apiutils.py index a5a936c5..c522e34e 100644 --- a/src/linkahead/apiutils.py +++ b/src/linkahead/apiutils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -35,12 +35,12 @@ from collections.abc import Iterable from subprocess import call from typing import Optional, Any, Dict, List -from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, +from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, REFERENCE, TEXT, is_reference) -from caosdb.common.models import (Container, Entity, File, Property, Query, +from linkahead.common.models import (Container, Entity, File, Property, Query, Record, RecordType, execute_query, get_config, SPECIAL_ATTRIBUTES) -from caosdb.exceptions import CaosDBException +from linkahead.exceptions import CaosDBException logger = logging.getLogger(__name__) diff --git a/src/linkahead/cached.py b/src/linkahead/cached.py index 4f735bb8..33124d61 100644 --- a/src/linkahead/cached.py +++ b/src/linkahead/cached.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2023 Henrik tom Wörden <h.tomwoerden@indiscale.com> diff --git a/src/linkahead/common/administration.py b/src/linkahead/common/administration.py index a27aaf04..12c738f1 100644 --- a/src/linkahead/common/administration.py +++ b/src/linkahead/common/administration.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -29,9 +29,9 @@ import re import string import random -from caosdb.common.utils import xml2str -from caosdb.connection.connection import get_connection -from caosdb.exceptions import (EntityDoesNotExistError, HTTPClientError, +from linkahead.common.utils import xml2str +from linkahead.connection.connection import get_connection +from linkahead.exceptions import (EntityDoesNotExistError, HTTPClientError, HTTPForbiddenError, HTTPResourceNotFoundError, ServerConfigurationException) from lxml import etree diff --git a/src/linkahead/common/datatype.py b/src/linkahead/common/datatype.py index 03ff6d02..50d923d9 100644 --- a/src/linkahead/common/datatype.py +++ b/src/linkahead/common/datatype.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 IndiScale GmbH # Copyright (C) 2020 Henrik tom Wörden, IndiScale GmbH @@ -148,7 +148,7 @@ def get_id_of_datatype(datatype): EmptyUniqueQueryError If there is no entity with the name of the datatype. """ - from caosdb import execute_query + from linkahead import execute_query if is_list_datatype(datatype): datatype = get_list_datatype(datatype) diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 9ba54c49..7b6db6d8 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -49,16 +49,16 @@ from random import randint from tempfile import NamedTemporaryFile from warnings import warn -from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, INTEGER, TEXT, +from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, INTEGER, TEXT, is_list_datatype, is_reference) -from caosdb.common.state import State -from caosdb.common.utils import uuid, xml2str -from caosdb.common.timezone import TimeZone -from caosdb.common.versioning import Version -from caosdb.configuration import get_config -from caosdb.connection.connection import get_connection -from caosdb.connection.encode import MultipartParam, multipart_encode -from caosdb.exceptions import (AmbiguousEntityError, AuthorizationError, +from linkahead.common.state import State +from linkahead.common.utils import uuid, xml2str +from linkahead.common.timezone import TimeZone +from linkahead.common.versioning import Version +from linkahead.configuration import get_config +from linkahead.connection.connection import get_connection +from linkahead.connection.encode import MultipartParam, multipart_encode +from linkahead.exceptions import (AmbiguousEntityError, AuthorizationError, CaosDBConnectionError, CaosDBException, ConsistencyError, EmptyUniqueQueryError, EntityDoesNotExistError, EntityError, @@ -529,7 +529,7 @@ class Entity: Add a simple integer property with the name ``TestProp`` and the value 27 to a Record: - >>> import caosdb as db + >>> import linkahead as db >>> rec = db.Record(name="TestRec").add_parent(name="TestType") >>> rec.add_property("TestProp", value=27) # specified by name, you could equally use the property's id if it is known diff --git a/src/linkahead/common/state.py b/src/linkahead/common/state.py index cb74022b..82f314e8 100644 --- a/src/linkahead/common/state.py +++ b/src/linkahead/common/state.py @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> diff --git a/src/linkahead/common/utils.py b/src/linkahead/common/utils.py index f0ce740d..b333e3e0 100644 --- a/src/linkahead/common/utils.py +++ b/src/linkahead/common/utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/common/versioning.py b/src/linkahead/common/versioning.py index 2875486a..64d66609 100644 --- a/src/linkahead/common/versioning.py +++ b/src/linkahead/common/versioning.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -27,7 +27,7 @@ Currently this module defines nothing but a single class, `Version`. """ from __future__ import absolute_import -from caosdb.common.utils import xml2str +from linkahead.common.utils import xml2str from lxml import etree diff --git a/src/linkahead/configuration.py b/src/linkahead/configuration.py index 1c108ac1..fcceba1a 100644 --- a/src/linkahead/configuration.py +++ b/src/linkahead/configuration.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/authentication/auth_token.py b/src/linkahead/connection/authentication/auth_token.py index 68812386..761abcc7 100644 --- a/src/linkahead/connection/authentication/auth_token.py +++ b/src/linkahead/connection/authentication/auth_token.py @@ -1,7 +1,7 @@ #! -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -29,8 +29,8 @@ An Authentictor which only uses only a pre-supplied authentication token. """ from __future__ import absolute_import, unicode_literals, print_function from .interface import AbstractAuthenticator, CaosDBServerConnection -from caosdb.connection.utils import auth_token_to_cookie -from caosdb.exceptions import LoginFailedError +from linkahead.connection.utils import auth_token_to_cookie +from linkahead.exceptions import LoginFailedError def get_authentication_provider(): diff --git a/src/linkahead/connection/authentication/external_credentials_provider.py b/src/linkahead/connection/authentication/external_credentials_provider.py index 1cf4cefc..91158c90 100644 --- a/src/linkahead/connection/authentication/external_credentials_provider.py +++ b/src/linkahead/connection/authentication/external_credentials_provider.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/authentication/input.py b/src/linkahead/connection/authentication/input.py index 7edec7c8..27992073 100644 --- a/src/linkahead/connection/authentication/input.py +++ b/src/linkahead/connection/authentication/input.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/authentication/interface.py b/src/linkahead/connection/authentication/interface.py index f2cc5001..ad1147eb 100644 --- a/src/linkahead/connection/authentication/interface.py +++ b/src/linkahead/connection/authentication/interface.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,10 +28,10 @@ Implementing modules muts provide a `get_authentication_provider()` method. """ from abc import ABCMeta, abstractmethod, abstractproperty import logging -from caosdb.connection.utils import urlencode -from caosdb.connection.interface import CaosDBServerConnection -from caosdb.connection.utils import parse_auth_token, auth_token_to_cookie -from caosdb.exceptions import LoginFailedError +from linkahead.connection.utils import urlencode +from linkahead.connection.interface import CaosDBServerConnection +from linkahead.connection.utils import parse_auth_token, auth_token_to_cookie +from linkahead.exceptions import LoginFailedError # meta class compatible with Python 2 *and* 3: ABC = ABCMeta('ABC', (object, ), {'__slots__': ()}) diff --git a/src/linkahead/connection/authentication/keyring.py b/src/linkahead/connection/authentication/keyring.py index 99d18413..5ed63634 100644 --- a/src/linkahead/connection/authentication/keyring.py +++ b/src/linkahead/connection/authentication/keyring.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -30,7 +30,7 @@ retrieve the password. import sys import importlib from getpass import getpass -from caosdb.exceptions import ConfigurationError +from linkahead.exceptions import ConfigurationError from .external_credentials_provider import ExternalCredentialsProvider from .interface import CredentialsAuthenticator diff --git a/src/linkahead/connection/authentication/pass.py b/src/linkahead/connection/authentication/pass.py index 853cdf0e..8067a890 100644 --- a/src/linkahead/connection/authentication/pass.py +++ b/src/linkahead/connection/authentication/pass.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,7 +28,7 @@ password. """ from subprocess import check_output, CalledProcessError -from caosdb.exceptions import ConfigurationError +from linkahead.exceptions import ConfigurationError from .interface import CredentialsAuthenticator from .external_credentials_provider import ExternalCredentialsProvider diff --git a/src/linkahead/connection/authentication/plain.py b/src/linkahead/connection/authentication/plain.py index 83dd5929..162cd365 100644 --- a/src/linkahead/connection/authentication/plain.py +++ b/src/linkahead/connection/authentication/plain.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/authentication/unauthenticated.py b/src/linkahead/connection/authentication/unauthenticated.py index 65febae8..8c220acd 100644 --- a/src/linkahead/connection/authentication/unauthenticated.py +++ b/src/linkahead/connection/authentication/unauthenticated.py @@ -1,7 +1,7 @@ #! -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -30,7 +30,7 @@ cookies. """ from __future__ import absolute_import, unicode_literals, print_function from .interface import AbstractAuthenticator, CaosDBServerConnection -from caosdb.exceptions import LoginFailedError +from linkahead.exceptions import LoginFailedError def get_authentication_provider(): diff --git a/src/linkahead/connection/connection.py b/src/linkahead/connection/connection.py index 46dadea9..84e9add5 100644 --- a/src/linkahead/connection/connection.py +++ b/src/linkahead/connection/connection.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -38,8 +38,8 @@ from requests.exceptions import ConnectionError as HTTPConnectionError from urllib3.poolmanager import PoolManager from requests.adapters import HTTPAdapter -from caosdb.configuration import get_config -from caosdb.exceptions import (CaosDBException, HTTPClientError, +from linkahead.configuration import get_config +from linkahead.exceptions import (CaosDBException, HTTPClientError, ConfigurationError, CaosDBConnectionError, HTTPForbiddenError, @@ -48,7 +48,7 @@ from caosdb.exceptions import (CaosDBException, HTTPClientError, HTTPServerError, HTTPURITooLongError) try: - from caosdb.version import version + from linkahead.version import version except ModuleNotFoundError: version = "uninstalled" diff --git a/src/linkahead/connection/encode.py b/src/linkahead/connection/encode.py index 0b826cc4..6b328285 100644 --- a/src/linkahead/connection/encode.py +++ b/src/linkahead/connection/encode.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/interface.py b/src/linkahead/connection/interface.py index a6f73917..d56900d8 100644 --- a/src/linkahead/connection/interface.py +++ b/src/linkahead/connection/interface.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/mockup.py b/src/linkahead/connection/mockup.py index b37670b8..8da79133 100644 --- a/src/linkahead/connection/mockup.py +++ b/src/linkahead/connection/mockup.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/connection/utils.py b/src/linkahead/connection/utils.py index 095d4703..90ec6b5b 100644 --- a/src/linkahead/connection/utils.py +++ b/src/linkahead/connection/utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/exceptions.py b/src/linkahead/exceptions.py index fdd2e11f..97c6d708 100644 --- a/src/linkahead/exceptions.py +++ b/src/linkahead/exceptions.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/src/linkahead/high_level_api.py b/src/linkahead/high_level_api.py index 427a095a..e7e9beab 100644 --- a/src/linkahead/high_level_api.py +++ b/src/linkahead/high_level_api.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -30,12 +30,12 @@ A high level API for accessing CaosDB entities from within python. This is refactored from apiutils. """ -from caosdb.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, +from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, REFERENCE, TEXT, is_list_datatype, get_list_datatype, is_reference) -import caosdb as db +import linkahead as db from .apiutils import get_type_of_entity_with, create_flat_list import warnings diff --git a/src/linkahead/schema-pycaosdb-ini.yml b/src/linkahead/schema-pylinkahead-ini.yml similarity index 100% rename from src/linkahead/schema-pycaosdb-ini.yml rename to src/linkahead/schema-pylinkahead-ini.yml diff --git a/src/linkahead/utils/checkFileSystemConsistency.py b/src/linkahead/utils/checkFileSystemConsistency.py index a142c1dd..ddbb085a 100755 --- a/src/linkahead/utils/checkFileSystemConsistency.py +++ b/src/linkahead/utils/checkFileSystemConsistency.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -26,7 +26,7 @@ """requests the server to execute checkFileSystemConsistency job.""" import sys -import caosdb as db +import linkahead as db from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter diff --git a/src/linkahead/utils/create_revision.py b/src/linkahead/utils/create_revision.py index 419e1c9f..5f6ecc81 100644 --- a/src/linkahead/utils/create_revision.py +++ b/src/linkahead/utils/create_revision.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -23,8 +23,8 @@ # """provides utilities for creating revisions of database entries.""" -import caosdb as db -from caosdb import INTEGER, LIST +import linkahead as db +from linkahead import INTEGER, LIST def bend_references(from_id, to_id, except_for=None): diff --git a/src/linkahead/utils/get_entity.py b/src/linkahead/utils/get_entity.py index a27aafa9..ea9f3228 100644 --- a/src/linkahead/utils/get_entity.py +++ b/src/linkahead/utils/get_entity.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2023 Henrik tom Wörden <h.tomwoerden@indiscale.com> # Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> diff --git a/src/linkahead/utils/linkahead_admin.py b/src/linkahead/utils/linkahead_admin.py index 09a8f64a..e9a2c09b 100755 --- a/src/linkahead/utils/linkahead_admin.py +++ b/src/linkahead/utils/linkahead_admin.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -31,9 +31,9 @@ import getpass import sys from argparse import ArgumentParser, RawDescriptionHelpFormatter -import caosdb as db -from caosdb import administration as admin -from caosdb.exceptions import HTTPClientError +import linkahead as db +from linkahead import administration as admin +from linkahead.exceptions import HTTPClientError __all__ = [] __version__ = 0.3 @@ -412,7 +412,7 @@ USAGE subparser = subparsers.add_parser( "delete_user", - help="Delete a user from caosdb's internal user database.") + help="Delete a user from linkahead's internal user database.") subparser.set_defaults(call=do_delete_user) subparser.add_argument(metavar='USERNAME', dest="user_name", help="The name of the user who is to be deleted.") diff --git a/src/linkahead/utils/plantuml.py b/src/linkahead/utils/plantuml.py index 6252a489..1f925cbd 100644 --- a/src/linkahead/utils/plantuml.py +++ b/src/linkahead/utils/plantuml.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -36,8 +36,8 @@ plantuml FILENAME.pu -> FILENAME.png import os import shutil -import caosdb as db -from caosdb.common.datatype import is_reference, get_referenced_recordtype +import linkahead as db +from linkahead.common.datatype import is_reference, get_referenced_recordtype from typing import List, Optional diff --git a/src/linkahead/utils/register_tests.py b/src/linkahead/utils/register_tests.py index 9d0afcbb..3035f69d 100644 --- a/src/linkahead/utils/register_tests.py +++ b/src/linkahead/utils/register_tests.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 Alexander Schlemmer <alexander.schlemmer@ds.mpg.de> # Copyright (C) 2022 Timm Fitschen <t.fitschen@indiscale.com> @@ -19,8 +19,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -import caosdb as db -from caosdb import administration as admin +import linkahead as db +from linkahead import administration as admin """ This module implements a registration procedure for integration tests which diff --git a/src/linkahead/utils/server_side_scripting.py b/src/linkahead/utils/server_side_scripting.py index 7e5ee439..6a419191 100644 --- a/src/linkahead/utils/server_side_scripting.py +++ b/src/linkahead/utils/server_side_scripting.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -28,9 +28,9 @@ Helper functions for calling server-side scripts. from urllib.parse import quote from lxml import etree -from caosdb.connection.connection import get_connection -from caosdb.connection.utils import urlencode -from caosdb.connection.encode import (MultipartParam, multipart_encode, +from linkahead.connection.connection import get_connection +from linkahead.connection.utils import urlencode +from linkahead.connection.encode import (MultipartParam, multipart_encode, ReadableMultiparts) diff --git a/src/linkahead/yamlapi.py b/src/linkahead/yamlapi.py index 80bb4b13..ba1f183d 100644 --- a/src/linkahead/yamlapi.py +++ b/src/linkahead/yamlapi.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,9 +28,9 @@ import yaml from lxml import etree from lxml.etree import Element import re -import caosdb -import caosdb.common.utils as utils -from caosdb.connection.connection import get_connection +import linkahead +import linkahead.common.utils as utils +from linkahead.connection.connection import get_connection import warnings diff --git a/unittests/test_acl.py b/unittests/test_acl.py index 633c25ad..c004979f 100644 --- a/unittests/test_acl.py +++ b/unittests/test_acl.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2022 Timm Fitschen <f.fitschen@indiscale.com> @@ -18,7 +18,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. # -import caosdb as db +import linkahead as db from lxml import etree diff --git a/unittests/test_add_property.py b/unittests/test_add_property.py index 0d3183b4..2989adec 100644 --- a/unittests/test_add_property.py +++ b/unittests/test_add_property.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -24,7 +24,7 @@ # ** end header # from pytest import raises -import caosdb as db +import linkahead as db def test_no_parameter(): diff --git a/unittests/test_administraction.py b/unittests/test_administraction.py index 25a7d0de..7f40aa94 100644 --- a/unittests/test_administraction.py +++ b/unittests/test_administraction.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -25,8 +25,8 @@ # pylint: disable=missing-docstring from __future__ import unicode_literals from pytest import raises -from caosdb import administration, configure_connection, get_connection -from caosdb.connection.mockup import MockUpServerConnection, MockUpResponse +from linkahead import administration, configure_connection, get_connection +from linkahead.connection.mockup import MockUpServerConnection, MockUpResponse def setup_module(): diff --git a/unittests/test_apiutils.py b/unittests/test_apiutils.py index bda381cf..4c15230d 100644 --- a/unittests/test_apiutils.py +++ b/unittests/test_apiutils.py @@ -1,5 +1,5 @@ # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2022 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -27,13 +27,13 @@ import pytest -import caosdb as db -import caosdb.apiutils -from caosdb.apiutils import (apply_to_ids, compare_entities, create_id_query, +import linkahead as db +import linkahead.apiutils +from linkahead.apiutils import (apply_to_ids, compare_entities, create_id_query, empty_diff, EntityMergeConflictError, resolve_reference, merge_entities) -from caosdb.common.models import SPECIAL_ATTRIBUTES +from linkahead.common.models import SPECIAL_ATTRIBUTES def test_apply_to_ids(): diff --git a/unittests/test_authentication_auth_token.py b/unittests/test_authentication_auth_token.py index d0eb6b90..356eb53c 100644 --- a/unittests/test_authentication_auth_token.py +++ b/unittests/test_authentication_auth_token.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -29,11 +29,11 @@ Unit tests for the module caosdb.connection.authentication.auth_token from __future__ import unicode_literals from pytest import raises from unittest.mock import Mock -from caosdb.connection.authentication import auth_token as at -from caosdb.connection.mockup import MockUpServerConnection, MockUpResponse -from caosdb.connection.utils import parse_auth_token -from caosdb.exceptions import LoginFailedError -from caosdb import configure_connection +from linkahead.connection.authentication import auth_token as at +from linkahead.connection.mockup import MockUpServerConnection, MockUpResponse +from linkahead.connection.utils import parse_auth_token +from linkahead.exceptions import LoginFailedError +from linkahead import configure_connection def test_get_authentication_provider(): diff --git a/unittests/test_authentication_external.py b/unittests/test_authentication_external.py index a8fc6f79..66a584ca 100644 --- a/unittests/test_authentication_external.py +++ b/unittests/test_authentication_external.py @@ -1,7 +1,7 @@ #! -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -29,7 +29,7 @@ Tests for the external_credentials_provider modul. from __future__ import unicode_literals import logging from pytest import raises -from caosdb.connection.authentication import ( +from linkahead.connection.authentication import ( external_credentials_provider as ecp ) diff --git a/unittests/test_authentication_keyring.py b/unittests/test_authentication_keyring.py index 71551449..d3b07479 100644 --- a/unittests/test_authentication_keyring.py +++ b/unittests/test_authentication_keyring.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -27,7 +27,7 @@ Tests for the caosdb.connection.authentication.keyring module. """ import sys from pytest import raises -from caosdb.connection.authentication.keyring import KeyringCaller +from linkahead.connection.authentication.keyring import KeyringCaller def test_initialization(): diff --git a/unittests/test_authentication_pass.py b/unittests/test_authentication_pass.py index 45bda08a..f3f5b671 100644 --- a/unittests/test_authentication_pass.py +++ b/unittests/test_authentication_pass.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen diff --git a/unittests/test_authentication_plain.py b/unittests/test_authentication_plain.py index 146b5988..55fbc459 100644 --- a/unittests/test_authentication_plain.py +++ b/unittests/test_authentication_plain.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,7 +28,7 @@ Unit tests for the modul caosdb.connection.authentication.plain. from __future__ import unicode_literals -from caosdb.connection.authentication.plain import PlainTextCredentialsProvider +from linkahead.connection.authentication.plain import PlainTextCredentialsProvider from pytest import raises diff --git a/unittests/test_authentication_unauthenticated.py b/unittests/test_authentication_unauthenticated.py index 45a709fc..efd419b3 100644 --- a/unittests/test_authentication_unauthenticated.py +++ b/unittests/test_authentication_unauthenticated.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -29,11 +29,11 @@ Unit tests for the module caosdb.connection.authentication.unauthenticated. from __future__ import unicode_literals from pytest import raises from unittest.mock import Mock -from caosdb.connection.authentication import unauthenticated -from caosdb.connection.mockup import MockUpServerConnection, MockUpResponse -from caosdb.connection.utils import parse_auth_token -from caosdb.exceptions import LoginFailedError -from caosdb import configure_connection +from linkahead.connection.authentication import unauthenticated +from linkahead.connection.mockup import MockUpServerConnection, MockUpResponse +from linkahead.connection.utils import parse_auth_token +from linkahead.exceptions import LoginFailedError +from linkahead import configure_connection from .test_authentication_auth_token import response_with_auth_token diff --git a/unittests/test_cached.py b/unittests/test_cached.py index ce302d67..d49b7fb3 100644 --- a/unittests/test_cached.py +++ b/unittests/test_cached.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2023 Henrik tom Wörden <h.tomwoerden@indiscale.com> # Copyright (C) 2023 IndiScale GmbH <info@indiscale.com> @@ -21,10 +21,10 @@ """ Test the caosdb.cached module """ -from caosdb.cached import (cached_get_entity_by, cache_clear, cache_info, cache_fill, +from linkahead.cached import (cached_get_entity_by, cache_clear, cache_info, cache_fill, AccessType, cache_initialize, cached_query) from unittest.mock import patch -import caosdb as db +import linkahead as db from copy import deepcopy import pytest diff --git a/unittests/test_concrete_property.py b/unittests/test_concrete_property.py index 0e5c2853..e70668f0 100644 --- a/unittests/test_concrete_property.py +++ b/unittests/test_concrete_property.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -24,9 +24,9 @@ """Tests for the _ConcreteProperty class.""" -from caosdb import configure_connection -from caosdb.common.models import _ConcreteProperty -from caosdb.connection.mockup import MockUpServerConnection +from linkahead import configure_connection +from linkahead.common.models import _ConcreteProperty +from linkahead.connection.mockup import MockUpServerConnection # pylint: disable=missing-docstring from nose.tools import assert_equal as eq from nose.tools import assert_is_not_none as there diff --git a/unittests/test_configuration.py b/unittests/test_configuration.py index b135e7cd..6ef147a8 100644 --- a/unittests/test_configuration.py +++ b/unittests/test_configuration.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -23,7 +23,7 @@ # import pytest -import caosdb as db +import linkahead as db from os import environ, getcwd, remove from os.path import expanduser, isfile, join from pytest import raises diff --git a/unittests/test_connection.py b/unittests/test_connection.py index 6cc23d87..a31ca626 100644 --- a/unittests/test_connection.py +++ b/unittests/test_connection.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,16 +28,16 @@ from __future__ import print_function, unicode_literals import re from builtins import bytes, str # pylint: disable=redefined-builtin -from caosdb import execute_query -from caosdb.configuration import _reset_config, get_config -from caosdb.connection.authentication.interface import CredentialsAuthenticator -from caosdb.connection.connection import (CaosDBServerConnection, +from linkahead import execute_query +from linkahead.configuration import _reset_config, get_config +from linkahead.connection.authentication.interface import CredentialsAuthenticator +from linkahead.connection.connection import (CaosDBServerConnection, _DefaultCaosDBServerConnection, configure_connection) -from caosdb.connection.mockup import (MockUpResponse, MockUpServerConnection, +from linkahead.connection.mockup import (MockUpResponse, MockUpServerConnection, _request_log_message) -from caosdb.connection.utils import make_uri_path, quote, urlencode -from caosdb.exceptions import (ConfigurationError, LoginFailedError, +from linkahead.connection.utils import make_uri_path, quote, urlencode +from linkahead.exceptions import (ConfigurationError, LoginFailedError, CaosDBConnectionError) from nose.tools import assert_equal as eq from nose.tools import assert_false as falz diff --git a/unittests/test_connection_utils.py b/unittests/test_connection_utils.py index 3890ae05..e07eab42 100644 --- a/unittests/test_connection_utils.py +++ b/unittests/test_connection_utils.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -28,16 +28,16 @@ from pytest import raises from nose.tools import (assert_equal as eq, assert_raises as raiz, assert_true as tru, assert_is_not_none as there, assert_false as falz) -from caosdb.exceptions import ConfigurationError, LoginFailedError -from caosdb.connection.utils import parse_auth_token, auth_token_to_cookie -from caosdb.connection.connection import ( +from linkahead.exceptions import ConfigurationError, LoginFailedError +from linkahead.connection.utils import parse_auth_token, auth_token_to_cookie +from linkahead.connection.connection import ( configure_connection, CaosDBServerConnection, _DefaultCaosDBServerConnection) -from caosdb.connection.mockup import (MockUpServerConnection, MockUpResponse, +from linkahead.connection.mockup import (MockUpServerConnection, MockUpResponse, _request_log_message) -from caosdb.configuration import get_config, _reset_config -from caosdb.connection.authentication.interface import CredentialsAuthenticator -from caosdb import execute_query +from linkahead.configuration import get_config, _reset_config +from linkahead.connection.authentication.interface import CredentialsAuthenticator +from linkahead import execute_query def setup_module(): diff --git a/unittests/test_container.py b/unittests/test_container.py index 0ac4be44..113dd622 100644 --- a/unittests/test_container.py +++ b/unittests/test_container.py @@ -2,7 +2,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -25,7 +25,7 @@ """Tests for the Container class.""" from __future__ import absolute_import -import caosdb as db +import linkahead as db def test_get_property_values(): diff --git a/unittests/test_datatype.py b/unittests/test_datatype.py index 9b3c6267..5a5e82cc 100644 --- a/unittests/test_datatype.py +++ b/unittests/test_datatype.py @@ -1,5 +1,5 @@ # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (c) 2020 IndiScale GmbH # Copyright (c) 2020 Daniel Hornung (d.hornung@indiscale.com) @@ -19,9 +19,9 @@ # # ** end header from pytest import raises -import caosdb as db -from caosdb.common import datatype -from caosdb.common.models import _parse_value +import linkahead as db +from linkahead.common import datatype +from linkahead.common.models import _parse_value def test_list(): diff --git a/unittests/test_entity.py b/unittests/test_entity.py index f2891fda..f91613a0 100644 --- a/unittests/test_entity.py +++ b/unittests/test_entity.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -27,9 +27,9 @@ import unittest from lxml import etree import os -from caosdb import (INTEGER, Entity, Property, Record, RecordType, +from linkahead import (INTEGER, Entity, Property, Record, RecordType, configure_connection) -from caosdb.connection.mockup import MockUpServerConnection +from linkahead.connection.mockup import MockUpServerConnection UNITTESTDIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/unittests/test_error_handling.py b/unittests/test_error_handling.py index 7f974e7d..590755b9 100644 --- a/unittests/test_error_handling.py +++ b/unittests/test_error_handling.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2020 Florian Spreckelsen <f.spreckelsen@indiscale.com> @@ -26,9 +26,9 @@ be TransactionErrors at first which may have one or more level of children. """ -import caosdb as db -from caosdb.common.models import raise_errors -from caosdb.exceptions import (AuthorizationError, +import linkahead as db +from linkahead.common.models import raise_errors +from linkahead.exceptions import (AuthorizationError, EntityDoesNotExistError, EntityError, EntityHasNoDatatypeError, TransactionError, UniqueNamesError, diff --git a/unittests/test_file.py b/unittests/test_file.py index 3c80af7f..dd974cb1 100644 --- a/unittests/test_file.py +++ b/unittests/test_file.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -22,8 +22,8 @@ # ** end header # """Tests for the File class.""" -from caosdb import File, Record, configure_connection -from caosdb.connection.mockup import MockUpServerConnection +from linkahead import File, Record, configure_connection +from linkahead.connection.mockup import MockUpServerConnection # pylint: disable=missing-docstring from nose.tools import assert_equal as eq from nose.tools import assert_is_not_none as there diff --git a/unittests/test_high_level_api.py b/unittests/test_high_level_api.py index a9e55c9c..69bb9879 100644 --- a/unittests/test_high_level_api.py +++ b/unittests/test_high_level_api.py @@ -1,4 +1,4 @@ -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -23,19 +23,19 @@ # A. Schlemmer, 02/2022 -import caosdb as db -from caosdb.high_level_api import (convert_to_entity, convert_to_python_object, +import linkahead as db +from linkahead.high_level_api import (convert_to_entity, convert_to_python_object, new_high_level_entity) -from caosdb.high_level_api import (CaosDBPythonUnresolvedParent, +from linkahead.high_level_api import (CaosDBPythonUnresolvedParent, CaosDBPythonUnresolvedReference, CaosDBPythonRecord, CaosDBPythonFile, high_level_type_for_standard_type, standard_type_for_high_level_type, high_level_type_for_role, CaosDBPythonEntity) -from caosdb.apiutils import compare_entities +from linkahead.apiutils import compare_entities -from caosdb.common.datatype import (is_list_datatype, +from linkahead.common.datatype import (is_list_datatype, get_list_datatype, is_reference) diff --git a/unittests/test_issues.py b/unittests/test_issues.py index 2c45a6d7..158e5617 100644 --- a/unittests/test_issues.py +++ b/unittests/test_issues.py @@ -1,4 +1,4 @@ -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (c) 2022 IndiScale GmbH # Copyright (c) 2022 Daniel Hornung (d.hornung@indiscale.com) @@ -22,7 +22,7 @@ import os import lxml -import caosdb as db +import linkahead as db from pytest import raises diff --git a/unittests/test_message.py b/unittests/test_message.py index 5e100305..7c18095b 100644 --- a/unittests/test_message.py +++ b/unittests/test_message.py @@ -1,7 +1,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -23,13 +23,13 @@ # # ** end header # -import caosdb as db +import linkahead as db from copy import deepcopy def test_messages_dict_behavior(): - from caosdb.common.models import Message - from caosdb.common.models import _Messages + from linkahead.common.models import Message + from linkahead.common.models import _Messages msgs = _Messages() diff --git a/unittests/test_plantuml.py b/unittests/test_plantuml.py index a507c36b..4605ebcb 100644 --- a/unittests/test_plantuml.py +++ b/unittests/test_plantuml.py @@ -2,7 +2,7 @@ # encoding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2022 Henrik tom Wörden <h.tomwoerden@indiscale.com> @@ -29,9 +29,9 @@ test plantuml utility import tempfile import pytest -import caosdb as db +import linkahead as db import shutil -from caosdb.utils.plantuml import to_graphics +from linkahead.utils.plantuml import to_graphics @pytest.fixture diff --git a/unittests/test_property.py b/unittests/test_property.py index 7c756117..6e92af09 100644 --- a/unittests/test_property.py +++ b/unittests/test_property.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -26,8 +26,8 @@ """Tests for the Property class.""" import os -import caosdb as db -from caosdb import Entity, Property, Record +import linkahead as db +from linkahead import Entity, Property, Record # pylint: disable=missing-docstring from lxml import etree diff --git a/unittests/test_query.py b/unittests/test_query.py index 12622ea4..2c13f4b6 100644 --- a/unittests/test_query.py +++ b/unittests/test_query.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2021 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Timm Fitschen <f.fitschen@indiscale.com> @@ -22,7 +22,7 @@ # ** end header # from lxml import etree -import caosdb as db +import linkahead as db def test_query_parsing(): diff --git a/unittests/test_record.py b/unittests/test_record.py index c08a3eb1..92c0f84a 100644 --- a/unittests/test_record.py +++ b/unittests/test_record.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -26,7 +26,7 @@ # """Tests for the Record class.""" # pylint: disable=missing-docstring -from caosdb import Entity, Record, RecordType +from linkahead import Entity, Record, RecordType def test_is_entity(): diff --git a/unittests/test_record_type.py b/unittests/test_record_type.py index f31c56de..594f9c64 100644 --- a/unittests/test_record_type.py +++ b/unittests/test_record_type.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -22,8 +22,8 @@ # ** end header # """Tests for the RecordType class.""" -from caosdb import Entity, RecordType, configure_connection -from caosdb.connection.mockup import MockUpServerConnection +from linkahead import Entity, RecordType, configure_connection +from linkahead.connection.mockup import MockUpServerConnection # pylint: disable=missing-docstring from nose.tools import assert_equal as eq from nose.tools import assert_is_not_none as there diff --git a/unittests/test_schema.py b/unittests/test_schema.py index fc3f63a4..feb84e3b 100644 --- a/unittests/test_schema.py +++ b/unittests/test_schema.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2022 Indiscale GmbH <info@indiscale.com> # Copyright (C) 2021 Alexander Schlemmer @@ -27,7 +27,7 @@ from jsonschema.exceptions import ValidationError from pytest import raises from glob import glob import os -from caosdb.configuration import config_to_yaml, validate_yaml_schema +from linkahead.configuration import config_to_yaml, validate_yaml_schema from configparser import ConfigParser diff --git a/unittests/test_server_side_scripting.py b/unittests/test_server_side_scripting.py index b699c448..7749af98 100644 --- a/unittests/test_server_side_scripting.py +++ b/unittests/test_server_side_scripting.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -25,9 +25,9 @@ import json from urllib.parse import parse_qs from unittest.mock import Mock -from caosdb.utils import server_side_scripting as sss -from caosdb.connection.mockup import MockUpServerConnection, MockUpResponse -from caosdb import configure_connection +from linkahead.utils import server_side_scripting as sss +from linkahead.connection.mockup import MockUpServerConnection, MockUpResponse +from linkahead import configure_connection _REMOVE_FILES_AFTERWARDS = [] diff --git a/unittests/test_state.py b/unittests/test_state.py index 202c7a02..d2bb08b7 100644 --- a/unittests/test_state.py +++ b/unittests/test_state.py @@ -1,7 +1,7 @@ import pytest -import caosdb as db -from caosdb import State, Transition -from caosdb.common.models import parse_xml, ACL +import linkahead as db +from linkahead import State, Transition +from linkahead.common.models import parse_xml, ACL from lxml import etree diff --git a/unittests/test_utils.py b/unittests/test_utils.py index 42d18ba0..cd91de59 100644 --- a/unittests/test_utils.py +++ b/unittests/test_utils.py @@ -1,7 +1,7 @@ # coding: utf-8 # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2018 Research Group Biomedical Physics, # Max-Planck-Institute for Dynamics and Self-Organization Göttingen @@ -24,7 +24,7 @@ """Tests for caosdb.common.utils.""" from __future__ import unicode_literals from lxml.etree import Element -from caosdb.common.utils import xml2str +from linkahead.common.utils import xml2str def test_xml2str(): diff --git a/unittests/test_versioning.py b/unittests/test_versioning.py index 5047069c..2862d902 100644 --- a/unittests/test_versioning.py +++ b/unittests/test_versioning.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # # ** header v3.0 -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> # Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> @@ -23,9 +23,9 @@ # from __future__ import absolute_import -from caosdb import Record -from caosdb.common.utils import xml2str -from caosdb.common.versioning import Version +from linkahead import Record +from linkahead.common.utils import xml2str +from linkahead.common.versioning import Version from .test_property import testrecord from lxml import etree diff --git a/unittests/test_yamlapi.py b/unittests/test_yamlapi.py index cdb1e049..0b0aca47 100644 --- a/unittests/test_yamlapi.py +++ b/unittests/test_yamlapi.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# This file is a part of the CaosDB Project. +# This file is a part of the LinkAhead Project. # # Copyright (C) 2021 IndiScale GmbH <info@indiscale.com> # Copyright (C) 2021 Alexander Kreft <akreft@trineo.org> @@ -22,7 +22,7 @@ import os import warnings import tempfile -from caosdb.yamlapi import (append_sublist, kv_to_xml, +from linkahead.yamlapi import (append_sublist, kv_to_xml, dict_to_xml, yaml_to_xml, process, yaml_file_to_xml) -- GitLab