# HG changeset patch # User Aurelien Campeas # Date 1404913449 -7200 # Node ID 3386fd89c914219c64b0747301a89bc5b0b77b69 # Parent d4f6f4c77e9c94ccbf1630541dcd335f2cfbf1b0 remove references to global environment variable APYCOT_ROOT diff -r d4f6f4c77e9c -r 3386fd89c914 __init__.py --- a/__init__.py Tue Jun 17 12:03:30 2014 +0200 +++ b/__init__.py Wed Jul 09 15:44:09 2014 +0200 @@ -44,10 +44,8 @@ from logilab.common.logging_ext import set_log_methods from yams.constraints import BASE_CONVERTERS -if os.environ.get('APYCOT_ROOT'): - logging.basicConfig(level=logging.CRITICAL) -else: - logging.basicConfig() +# pre python 2.7.2 safety +logging.basicConfig() from cubicweb.__pkginfo__ import version as __version__ diff -r d4f6f4c77e9c -r 3386fd89c914 cwconfig.py --- a/cwconfig.py Tue Jun 17 12:03:30 2014 +0200 +++ b/cwconfig.py Wed Jul 09 15:44:09 2014 +0200 @@ -827,13 +827,6 @@ else: _INSTANCES_DIR = join(_INSTALL_PREFIX, 'etc', 'cubicweb.d') - if os.environ.get('APYCOT_ROOT'): - _cubes_init = join(CubicWebNoAppConfiguration.CUBES_DIR, '__init__.py') - if not exists(_cubes_init): - file(join(_cubes_init), 'w').close() - if not exists(_INSTANCES_DIR): - os.makedirs(_INSTANCES_DIR) - # set to true during repair (shell, migration) to allow some things which # wouldn't be possible otherwise repairing = False diff -r d4f6f4c77e9c -r 3386fd89c914 server/schemaserial.py --- a/server/schemaserial.py Tue Jun 17 12:03:30 2014 +0200 +++ b/server/schemaserial.py Wed Jul 09 15:44:09 2014 +0200 @@ -309,19 +309,14 @@ """synchronize schema and permissions in the database according to current schema """ - quiet = os.environ.get('APYCOT_ROOT') - if not quiet: - _title = '-> storing the schema in the database ' - print _title, + _title = '-> storing the schema in the database ' + print _title, execute = cnx.execute eschemas = schema.entities() - if not quiet: - pb_size = (len(eschemas + schema.relations()) - + len(CONSTRAINTS) - + len([x for x in eschemas if x.specializes()])) - pb = ProgressBar(pb_size, title=_title) - else: - pb = None + pb_size = (len(eschemas + schema.relations()) + + len(CONSTRAINTS) + + len([x for x in eschemas if x.specializes()])) + pb = ProgressBar(pb_size, title=_title) groupmap = group_mapping(cnx, interactive=False) # serialize all entity types, assuring CWEType is serialized first for proper # is / is_instance_of insertion @@ -366,8 +361,7 @@ execute(rql, kwargs, build_descr=False) if pb is not None: pb.update() - if not quiet: - print + print # high level serialization functions diff -r d4f6f4c77e9c -r 3386fd89c914 server/sqlutils.py --- a/server/sqlutils.py Tue Jun 17 12:03:30 2014 +0200 +++ b/server/sqlutils.py Wed Jul 09 15:44:09 2014 +0200 @@ -47,7 +47,7 @@ return subprocess.call(cmd) -def sqlexec(sqlstmts, cursor_or_execute, withpb=not os.environ.get('APYCOT_ROOT'), +def sqlexec(sqlstmts, cursor_or_execute, withpb=True, pbtitle='', delimiter=';', cnx=None): """execute sql statements ignoring DROP/ CREATE GROUP or USER statements error.