[cwconfig] Get rid of CWDEV 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 15 Feb 2018 09:27:15 +0100
branch3.26
changeset 12265 3f57a23e9954
parent 12264 cc83524263a9
child 12266 043db1f91922
[cwconfig] Get rid of CWDEV This is in preparation of a fix for #17132990 to cleanup legacy (and probably no longer working) behaviors.
cubicweb/cwconfig.py
cubicweb/cwctl.py
--- a/cubicweb/cwconfig.py	Thu Feb 15 09:26:02 2018 +0100
+++ b/cubicweb/cwconfig.py	Thu Feb 15 09:27:15 2018 +0100
@@ -394,11 +394,6 @@
 _forced_mode = os.environ.get('CW_MODE')
 assert _forced_mode in (None, 'system', 'user')
 
-# CWDEV tells whether directories such as i18n/, web/data/, etc. (ie containing
-# some other resources than python libraries) are located with the python code
-# or as a 'shared' cube
-CWDEV = exists(join(CW_SOFTWARE_ROOT, 'i18n'))
-
 try:
     _INSTALL_PREFIX = os.environ['CW_INSTALL_PREFIX']
 except KeyError:
@@ -422,9 +417,6 @@
     if 'VIRTUAL_ENV' in os.environ:
         mode = _forced_mode or 'user'
         _CUBES_DIR = join(_INSTALL_PREFIX, 'share', 'cubicweb', 'cubes')
-    elif CWDEV and _forced_mode != 'system':
-        mode = 'user'
-        _CUBES_DIR = join(CW_SOFTWARE_ROOT, '../../cubes')
     else:
         mode = _forced_mode or 'system'
         _CUBES_DIR = join(_INSTALL_PREFIX, 'share', 'cubicweb', 'cubes')
@@ -497,15 +489,11 @@
         """return the shared data directory (i.e. directory where standard
         library views and data may be found)
         """
-        if CWDEV:
-            return join(CW_SOFTWARE_ROOT, 'web')
         return cls.cube_dir('shared')
 
     @classmethod
     def i18n_lib_dir(cls):
         """return instance's i18n directory"""
-        if CWDEV:
-            return join(CW_SOFTWARE_ROOT, 'i18n')
         return join(cls.shared_dir(), 'i18n')
 
     @classmethod
@@ -1031,8 +1019,6 @@
     @classmethod
     def migration_scripts_dir(cls):
         """cubicweb migration scripts directory"""
-        if CWDEV:
-            return join(CW_SOFTWARE_ROOT, 'misc', 'migration')
         mdir = join(_INSTALL_PREFIX, 'share', 'cubicweb', 'migration')
         if not exists(mdir):
             raise ConfigurationError('migration path %s doesn\'t exist' % mdir)
--- a/cubicweb/cwctl.py	Thu Feb 15 09:26:02 2018 +0100
+++ b/cubicweb/cwctl.py	Thu Feb 15 09:27:15 2018 +0100
@@ -44,7 +44,7 @@
 from logilab.common.decorators import clear_cache
 
 from cubicweb import ConfigurationError, ExecutionError, BadCommandUsage
-from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CWDEV, CONFIGURATIONS
+from cubicweb.cwconfig import CubicWebConfiguration as cwcfg, CONFIGURATIONS
 from cubicweb.toolsutils import Command, rm, create_dir, underline_title
 from cubicweb.__pkginfo__ import version
 
@@ -760,7 +760,7 @@
         if cubicwebversion > applcubicwebversion:
             toupgrade.append(('cubicweb', applcubicwebversion, cubicwebversion))
         # only stop once we're sure we have something to do
-        if instance_running and not (CWDEV or self.config.nostartstop):
+        if instance_running and not self.config.nostartstop:
             StopInstanceCommand(self.logger).stop_instance(appid)
         # run cubicweb/componants migration scripts
         if self.config.fs_only or toupgrade:
@@ -783,7 +783,7 @@
         if helper:
             helper.postupgrade(repo)
         print('-> instance migrated.')
-        if instance_running and not (CWDEV or self.config.nostartstop):
+        if instance_running and not self.config.nostartstop:
             # restart instance through fork to get a proper environment, avoid
             # uicfg pb (and probably gettext catalogs, to check...)
             forkcmd = '%s start %s' % (sys.argv[0], appid)