summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2012-01-09 13:41:20 +0100
committerVo Minh Thu <vmt@openerp.com>2012-01-09 13:41:20 +0100
commit455e47e5e83bbf70203f7513b876c420bd6abb06 (patch)
treee650f8ee3816e22880d3552fea1fb0230140cfa7
parent1560538f8a336e9e44c35bc8fd9b48b7bc2a2d82 (diff)
[IMP] openerp.addons: openerp.addons is used instead of
openerp.modules as the namespace of the OpenERP addons. bzr revid: vmt@openerp.com-20120109124120-06gguu3lzxv49i3j
-rwxr-xr-xopenerp-server12
-rw-r--r--openerp/addons/__init__.py2
-rw-r--r--openerp/modules/module.py2
-rw-r--r--openerp/osv/orm.py6
4 files changed, 11 insertions, 11 deletions
diff --git a/openerp-server b/openerp-server
index 44ba179830d..c44e6909687 100755
--- a/openerp-server
+++ b/openerp-server
@@ -244,7 +244,7 @@ if __name__ == "__main__":
def find_module(self, module_name, package_path):
module_parts = module_name.split('.')
- if len(module_parts) == 3 and module_name.startswith('openerp.modules.'):
+ if len(module_parts) == 3 and module_name.startswith('openerp.addons.'):
return self # We act as a loader too.
# TODO list of loadable modules can be cached instead of always
@@ -259,18 +259,18 @@ if __name__ == "__main__":
logger.warning("""
Ambiguous import: the OpenERP module `%s` is shadowed by another
module (available at %s).
- To import it, use `import openerp.modules.<module>.`.""" % (module_name, path))
+ To import it, use `import openerp.addons.<module>.`.""" % (module_name, path))
return
except ImportError, e:
# Using `import <module_name>` instead of
- # `import openerp.modules.<module_name>` is ugly but not harmful
+ # `import openerp.addons.<module_name>` is ugly but not harmful
# and kept for backward compatibility.
return self # We act as a loader too.
def load_module(self, module_name):
module_parts = module_name.split('.')
- if len(module_parts) == 3 and module_name.startswith('openerp.modules.'):
+ if len(module_parts) == 3 and module_name.startswith('openerp.addons.'):
module_part = module_parts[2]
if module_name in sys.modules:
return sys.modules[module_name]
@@ -286,7 +286,7 @@ if __name__ == "__main__":
is_shadowing = True
except ImportError, e:
# Using `import <module_name>` instead of
- # `import openerp.modules.<module_name>` is ugly but not harmful
+ # `import openerp.addons.<module_name>` is ugly but not harmful
# and kept for backward compatibility.
is_shadowing = False
@@ -295,7 +295,7 @@ if __name__ == "__main__":
mod = imp.load_module(module_name, f, path, descr)
if not is_shadowing:
sys.modules[module_part] = mod
- sys.modules['openerp.modules.' + module_part] = mod
+ sys.modules['openerp.addons.' + module_part] = mod
return mod
openerp.modules.module.initialize_sys_path()
diff --git a/openerp/addons/__init__.py b/openerp/addons/__init__.py
index 02a5c9aa0a7..9554e9bd850 100644
--- a/openerp/addons/__init__.py
+++ b/openerp/addons/__init__.py
@@ -25,7 +25,7 @@
This module serves to contain all OpenERP addons, across all configured addons
paths. For the code to manage those addons, see openerp.modules.
-Addons are made available under `openerp.modules` after
+Addons are made available under `openerp.addons` after
openerp.tools.config.parse_config() is called (so that the addons paths are
known).
diff --git a/openerp/modules/module.py b/openerp/modules/module.py
index a5c432722ea..5c50384c2bc 100644
--- a/openerp/modules/module.py
+++ b/openerp/modules/module.py
@@ -314,7 +314,7 @@ def register_module_classes(m):
try:
zip_mod_path = mod_path + '.zip'
if not os.path.isfile(zip_mod_path):
- __import__('openerp.modules.' + m)
+ __import__('openerp.addons.' + m)
else:
zimp = zipimport.zipimporter(zip_mod_path)
zimp.load_module(m)
diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py
index 23cc040af47..05da35a5aeb 100644
--- a/openerp/osv/orm.py
+++ b/openerp/osv/orm.py
@@ -608,13 +608,13 @@ class MetaModel(type):
super(MetaModel, self).__init__(name, bases, attrs)
return
- # The (OpenERP) module name can be in the `openerp.modules` namespace
+ # The (OpenERP) module name can be in the `openerp.addons` namespace
# or not. For instance module `sale` can be imported as
- # `openerp.modules.sale` (the good way) or `sale` (for backward
+ # `openerp.addons.sale` (the good way) or `sale` (for backward
# compatibility).
module_parts = self.__module__.split('.')
if len(module_parts) > 2 and module_parts[0] == 'openerp' and \
- module_parts[1] == 'modules':
+ module_parts[1] == 'addons':
module_name = self.__module__.split('.')[2]
else:
module_name = self.__module__.split('.')[0]