remove references to global environment variable APYCOT_ROOT
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 09 Jul 2014 15:44:09 +0200
changeset 9891 3386fd89c914
parent 9875 d4f6f4c77e9c
child 9892 928732ec00dd
remove references to global environment variable APYCOT_ROOT
__init__.py
cwconfig.py
server/schemaserial.py
server/sqlutils.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__
 
--- 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
--- 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
--- 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.