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.
from os import environ, getcwd
# Import of the connection function (which is used to connect to the DB):
from os.path import expanduser, join
from warnings import warn
# Import of convenience methods:
import linkahead.apiutils
from linkahead.common import administration
from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE, INTEGER,
LIST, REFERENCE, TEXT)
from linkahead.common.state import State, Transition
from linkahead.common.datatype import (BOOLEAN, DATETIME, DOUBLE, FILE,
INTEGER, LIST, REFERENCE, TEXT)
# Import of the basic API classes:
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,
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 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.connection.connection import configure_connection, get_connection
from linkahead.connection.connection import (configure_connection,
get_connection)
from linkahead.exceptions import *
from linkahead.utils.get_entity import (get_entity_by_id, get_entity_by_name,
get_entity_by_path)
try:
from linkahead.version import version as __version__
except ModuleNotFoundError:
version = "uninstalled"
__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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment