#344747: add env var CW_MODE
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 23 Jul 2009 15:15:58 +0200
changeset 2449 888d698af3f9
parent 2446 440cb4ea7e5c
child 2450 d1529b46b638
#344747: add env var CW_MODE
cwconfig.py
doc/book/en/admin/setup.rst
--- a/cwconfig.py	Thu Jul 23 14:51:40 2009 +0200
+++ b/cwconfig.py	Thu Jul 23 15:15:58 2009 +0200
@@ -149,7 +149,7 @@
         CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ
         # create __init__ file
         file(join(CUBES_DIR, '__init__.py'), 'w').close()
-    elif exists(join(CW_SOFTWARE_ROOT, '.hg')):
+    elif exists(join(CW_SOFTWARE_ROOT, '.hg')) or os.environ.get('CW_MODE') == 'user':
         mode = 'dev'
         CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes')))
     else:
--- a/doc/book/en/admin/setup.rst	Thu Jul 23 14:51:40 2009 +0200
+++ b/doc/book/en/admin/setup.rst	Thu Jul 23 15:15:58 2009 +0200
@@ -106,15 +106,16 @@
 Add the following lines to either `.bashrc` or `.bash_profile` to configure
 your development environment ::
 
-  export PYTHONPATH=/full/path/to/cubicweb-forest
+    export PYTHONPATH=/full/path/to/cubicweb-forest
 
-If you installed the debian packages, no configuration is required.
-Your new cubes will be placed in `/usr/share/cubicweb/cubes` and
-your applications will be placed in `/etc/cubicweb.d`.
+If you installed *CubicWeb* with packages, no configuration is required and your
+new cubes will be placed in `/usr/share/cubicweb/cubes` and your applications
+will be placed in `/etc/cubicweb.d`.
 
-To use others directories then you will have to configure the
-following environment variables as follows::
+You may run a system-wide install of *CubicWeb* in "user mode" and use it for
+development by setting the following environment variable::
 
+    export CW_MODE=user
     export CW_CUBES_PATH=~/lib/cubes
     export CW_INSTANCES_DIR=~/etc/cubicweb.d/
     export CW_INSTANCES_DATA_DIR=$CW_INSTANCES_DIR