Skip to content
Snippets Groups Projects
Commit f3c02950 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

MAINT: better import deprecation

parent 454ef90f
No related branches found
No related tags found
1 merge request!111MAINT: LinkAhead rename
Pipeline #41137 passed
linkahead
\ No newline at end of file
"""
Deprecated
"""
from warnings import warn
from linkahead import *
warn(("CaosDB was renamed to LinkAhead. Please import the library as `import linkahead`. Using the"
" old name (caosdb) is deprecated."), DeprecationWarning)
...@@ -33,28 +33,37 @@ the current working directory will be read additionally, if it exists. ...@@ -33,28 +33,37 @@ the current working directory will be read additionally, if it exists.
from os import environ, getcwd from os import environ, getcwd
# Import of the connection function (which is used to connect to the DB): # Import of the connection function (which is used to connect to the DB):
from os.path import expanduser, join from os.path import expanduser, join
from warnings import warn
# Import of convenience methods: # Import of convenience methods:
import linkahead.apiutils import linkahead.apiutils
from linkahead.common import administration from linkahead.common import administration
from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER, from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE,
LIST, REFERENCE, TEXT) INTEGER, LIST, REFERENCE, TEXT)
from linkahead.common.state import State, Transition
# Import of the basic API classes: # Import of the basic API classes:
from linkahead.common.models import (ACL, ALL, FIX, NONE, OBLIGATORY, RECOMMENDED, from linkahead.common.models import (ACL, ALL, FIX, NONE, OBLIGATORY,
SUGGESTED, Container, DropOffBox, Entity, RECOMMENDED, SUGGESTED, Container,
File, Info, Message, Permissions, Property, DropOffBox, Entity, File, Info, Message,
Query, QueryTemplate, Record, RecordType, Permissions, Property, Query,
delete, execute_query, get_global_acl, QueryTemplate, Record, RecordType, delete,
execute_query, get_global_acl,
get_known_permissions, raise_errors) get_known_permissions, raise_errors)
from linkahead.utils.get_entity import get_entity_by_name, get_entity_by_path, get_entity_by_id from linkahead.common.state import State, Transition
from linkahead.configuration import _read_config_files, configure, get_config from linkahead.configuration import _read_config_files, configure, get_config
from linkahead.connection.connection import configure_connection, get_connection from linkahead.connection.connection import (configure_connection,
get_connection)
from linkahead.exceptions import * from linkahead.exceptions import *
from linkahead.utils.get_entity import (get_entity_by_id, get_entity_by_name,
get_entity_by_path)
try: try:
from linkahead.version import version as __version__ from linkahead.version import version as __version__
except ModuleNotFoundError: except ModuleNotFoundError:
version = "uninstalled" version = "uninstalled"
__version__ = version __version__ = version
if __name__.split('.')[0] == 'caosdb':
warn(("CaosDB was renamed to LinkAhead. Please import the library as `import linkahead`. Using the"
" old name (caosdb) is deprecated."), DeprecationWarning)
_read_config_files() _read_config_files()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment