diff options
| author | Christophe Simonis <christophe@cobalt> | 2008-12-15 14:36:27 +0100 |
|---|---|---|
| committer | Christophe Simonis <christophe@cobalt> | 2008-12-15 14:36:27 +0100 |
| commit | 929e87aaef0e9005fa336830d6f7ff41aef25487 (patch) | |
| tree | cf138ab556e00cdc8e1b8148af124801381d378a /addons/base_module_publish/wizard/module_zip.py | |
| parent | 6af4fbbbed7122479be3045eb3d28d580277818d (diff) | |
[FIX] base_module_publish: convert module name to string
[IMP] base_module_publish: password is hidden
bzr revid: christophe@cobalt-20081215133627-1sj43xbav1ehv47b
Diffstat (limited to 'addons/base_module_publish/wizard/module_zip.py')
| -rw-r--r-- | addons/base_module_publish/wizard/module_zip.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/base_module_publish/wizard/module_zip.py b/addons/base_module_publish/wizard/module_zip.py index 4014927bf99..c582358df0a 100644 --- a/addons/base_module_publish/wizard/module_zip.py +++ b/addons/base_module_publish/wizard/module_zip.py @@ -56,21 +56,22 @@ def createzip(cr, uid, moduleid, context, b64enc=True, src=True): _('Can not export module that is not installed!')) ad = tools.config['addons_path'] - if os.path.isdir(os.path.join(ad, module.name)): + name = str(module.name) + if os.path.isdir(os.path.join(ad, name)): archname = StringIO.StringIO('wb') archive = PyZipFile(archname, "w", ZIP_DEFLATED) - archive.writepy(os.path.join(ad, module.name)) - _zippy(archive, ad, module.name, src=src) + archive.writepy(os.path.join(ad, name)) + _zippy(archive, ad, name, src=src) archive.close() val =archname.getvalue() archname.close() - elif os.path.isfile(os.path.join(ad, module.name + '.zip')): - val = file(os.path.join(ad, module.name + '.zip'), 'rb').read() + elif os.path.isfile(os.path.join(ad, name + '.zip')): + val = file(os.path.join(ad, name + '.zip'), 'rb').read() else: raise wizard.except_wizard(_('Error'), _('Could not find the module to export!')) if b64enc: val =base64.encodestring(val) - return {'module_file':val, 'module_filename': module.name + '-' + \ + return {'module_file':val, 'module_filename': name + '-' + \ (module.installed_version or '0') + '.zip'} |
