server/repository.py
changeset 9468 39b7a91a3f4c
parent 9467 ad66d7b3fd48
child 9469 032825bbacab
equal deleted inserted replaced
9467:ad66d7b3fd48 9468:39b7a91a3f4c
    31 import sys
    31 import sys
    32 import threading
    32 import threading
    33 import Queue
    33 import Queue
    34 from warnings import warn
    34 from warnings import warn
    35 from itertools import chain
    35 from itertools import chain
    36 from os.path import join
       
    37 from datetime import datetime
       
    38 from time import time, localtime, strftime
    36 from time import time, localtime, strftime
    39 from contextlib import contextmanager
    37 from contextlib import contextmanager
    40 from warnings import warn
    38 from warnings import warn
    41 
    39 
    42 from logilab.common.decorators import cached, clear_cache
    40 from logilab.common.decorators import cached, clear_cache
    43 from logilab.common.deprecation import deprecated
    41 from logilab.common.deprecation import deprecated
    44 from logilab.common.compat import any
       
    45 from logilab.common import flatten
       
    46 
    42 
    47 from yams import BadSchemaDefinition
    43 from yams import BadSchemaDefinition
    48 from yams.schema import role_name
    44 from yams.schema import role_name
    49 from rql import RQLSyntaxError
    45 from rql import RQLSyntaxError
    50 from rql.utils import rqlvar_maker
    46 from rql.utils import rqlvar_maker
    51 
    47 
    52 from cubicweb import (CW_SOFTWARE_ROOT, CW_MIGRATION_MAP, QueryError,
    48 from cubicweb import (CW_MIGRATION_MAP, QueryError,
    53                       UnknownEid, AuthenticationError, ExecutionError,
    49                       UnknownEid, AuthenticationError, ExecutionError,
    54                       BadConnectionId, Unauthorized, ValidationError,
    50                       BadConnectionId, Unauthorized, ValidationError,
    55                       RepositoryError, UniqueTogetherError, onevent)
    51                       UniqueTogetherError, onevent)
    56 from cubicweb import cwvreg, schema, server
    52 from cubicweb import cwvreg, schema, server
    57 from cubicweb.server import ShuttingDown, utils, hook, querier, sources
    53 from cubicweb.server import ShuttingDown, utils, hook, querier, sources
    58 from cubicweb.server.session import Session, InternalSession, InternalManager
    54 from cubicweb.server.session import Session, InternalSession, InternalManager
    59 from cubicweb.server.ssplanner import EditedEntity
    55 from cubicweb.server.ssplanner import EditedEntity
    60 
    56 
  1484                   self.pyro_appid)
  1480                   self.pyro_appid)
  1485 
  1481 
  1486 
  1482 
  1487     # these are overridden by set_log_methods below
  1483     # these are overridden by set_log_methods below
  1488     # only defining here to prevent pylint from complaining
  1484     # only defining here to prevent pylint from complaining
  1489     info = warning = error = critical = exception = debug = lambda msg,*a,**kw: None
  1485     info = warning = error = critical = exception = debug = lambda msg, *a, **kw: None
  1490 
  1486 
  1491 
  1487 
  1492 def pyro_unregister(config):
  1488 def pyro_unregister(config):
  1493     """unregister the repository from the pyro name server"""
  1489     """unregister the repository from the pyro name server"""
  1494     from logilab.common.pyro_ext import ns_unregister
  1490     from logilab.common.pyro_ext import ns_unregister