diff src/core/sat_main.py @ 358:f147b778511a

core: local_dir can now be overrided (usefull to launch 2 instances at the same time)
author Goffi <goffi@goffi.org>
date Mon, 06 Jun 2011 18:34:40 +0200
parents d98b7391d76c
children 312ca6f9d84a
line wrap: on
line diff
--- a/src/core/sat_main.py	Sat Jun 04 19:11:38 2011 +0200
+++ b/src/core/sat_main.py	Mon Jun 06 18:34:40 2011 +0200
@@ -75,6 +75,13 @@
 
     def get_const(self, name):
         """Return a constant"""
+        try:
+            _const = os.environ['SAT_CONST_%s' % name]
+            if _const:
+                debug(_("Constant %(name)s overrided with [%(value)s]") % {'name':name, 'value': _const})
+                return _const
+        except KeyError:
+            pass
         if not CONST.has_key(name):
             error(_('Trying to access an undefined constant'))
             raise Exception