summaryrefslogtreecommitdiff
path: root/odoo/tools/config.py
diff options
context:
space:
mode:
author=?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= <stephane.bidoul@acsone.eu>2016-09-27 12:00:44 +0200
committerSimon Lejeune <sle@openerp.com>2016-09-30 12:05:49 +0200
commit389c2ba97ba83dea01949d2a3cad295bd710d9ef (patch)
tree9505bb68bce48a29df770936a25fe49744dbcca9 /odoo/tools/config.py
parentffd3c513ed3178fc87a79b9244ef5967d5ebcdef (diff)
[REF] packaging: make odoo a namespaced package
by auto-extending addons path with odoo.addons.__path__. This patch also introduce * an explicit declaration of odoo.addons as a namespace package This is necessary because the standard way of declaring namespace packages in setup.py does not work as long as odoo/__init__.py contains code. * a more reliable way to find odoo root path.
Diffstat (limited to 'odoo/tools/config.py')
-rw-r--r--odoo/tools/config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/tools/config.py b/odoo/tools/config.py
index c400f61531b..07af83e7e3e 100644
--- a/odoo/tools/config.py
+++ b/odoo/tools/config.py
@@ -87,7 +87,7 @@ class configmanager(object):
self.config_file = fname
self._LOGLEVELS = dict([
- (getattr(loglevels, 'LOG_%s' % x), getattr(logging, x))
+ (getattr(loglevels, 'LOG_%s' % x), getattr(logging, x))
for x in ('CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG', 'NOTSET')
])
@@ -427,7 +427,7 @@ class configmanager(object):
elif isinstance(self.options[arg], basestring) and self.casts[arg].type in optparse.Option.TYPE_CHECKER:
self.options[arg] = optparse.Option.TYPE_CHECKER[self.casts[arg].type](self.casts[arg], arg, self.options[arg])
- self.options['root_path'] = os.path.abspath(os.path.expanduser(os.path.expandvars(os.path.dirname(odoo.__file__))))
+ self.options['root_path'] = os.path.abspath(os.path.expanduser(os.path.expandvars(os.path.join(os.path.dirname(__file__), '..'))))
if not self.options['addons_path'] or self.options['addons_path']=='None':
default_addons = []
base_addons = os.path.join(self.options['root_path'], 'addons')