diff options
| author | Amit Mendapara <ame@tinyerp.com> | 2008-07-17 15:25:16 +0530 |
|---|---|---|
| committer | Amit Mendapara <ame@tinyerp.com> | 2008-07-17 15:25:16 +0530 |
| commit | a07e811cbd598d2a6928544b586318f46cf86678 (patch) | |
| tree | 6c112296ee9dd4279f95a11641b60cb719371124 /bin/addons/base/module/module.py | |
| parent | d225134d279fcbf2d4a5dde40b20738501c0aec1 (diff) | |
Imrpoved addons path support
- Imrpoved tools.file_open to override search path
- Removed addons.get_report_resource
- Code cleanup and minor changes
bzr revid: ame@tinyerp.com-20080717095516-191aflvin9ztd45z
Diffstat (limited to 'bin/addons/base/module/module.py')
| -rw-r--r-- | bin/addons/base/module/module.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index a876b436801..1ad9a844ea0 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -197,7 +197,7 @@ class module(osv.osv): def get_module_info(self, name): try: - f = tools.file_open(addons.get_module_resource(name, '__terp__.py')) + f = tools.file_open(os.path.join(name, '__terp__.py')) data = f.read() info = eval(data) if 'version' in info: @@ -387,13 +387,13 @@ class module(osv.osv): terp = self.get_module_info(mod_name) if not terp or not terp.get('installable', True): continue - if not os.path.isfile(mod_path): + if not os.path.isfile(mod_path+'.zip'): import imp # XXX must restrict to only addons paths imp.load_module(name, *imp.find_module(mod_name)) else: import zipimport - zimp = zipimport.zipimporter(mod_path) + zimp = zipimport.zipimporter(mod_path+'.zip') zimp.load_module(mod_name) id = self.create(cr, uid, { 'name': mod_name, @@ -481,7 +481,7 @@ class module(osv.osv): if not download: continue zipfile = urllib.urlopen(mod.url).read() - fname = addons.get_module_path(mod.name) + fname = addons.get_module_path(mod.name+'.zip') try: fp = file(fname, 'wb') fp.write(zipfile) |
