Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
357:d98b7391d76c | 358:f147b778511a |
---|---|
73 def get_next_id(self): | 73 def get_next_id(self): |
74 return sat_next_id() | 74 return sat_next_id() |
75 | 75 |
76 def get_const(self, name): | 76 def get_const(self, name): |
77 """Return a constant""" | 77 """Return a constant""" |
78 try: | |
79 _const = os.environ['SAT_CONST_%s' % name] | |
80 if _const: | |
81 debug(_("Constant %(name)s overrided with [%(value)s]") % {'name':name, 'value': _const}) | |
82 return _const | |
83 except KeyError: | |
84 pass | |
78 if not CONST.has_key(name): | 85 if not CONST.has_key(name): |
79 error(_('Trying to access an undefined constant')) | 86 error(_('Trying to access an undefined constant')) |
80 raise Exception | 87 raise Exception |
81 return CONST[name] | 88 return CONST[name] |
82 | 89 |