From 1c81e5cceecd5c459e1c1c6d710d8bc76a2b97b6 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 3 May 2007 19:27:47 +0000 Subject: [PATCH] Removed export, -> base_module_publish module bzr revid: fp@tinyerp.com-44e0386d3d3652eea5975b564cdc4b6df1a2c2c0 --- bin/addons/base/module/module_wizard.xml | 6 -- .../module/wizard/wizard_module_export.py | 98 ------------------- 2 files changed, 104 deletions(-) delete mode 100644 bin/addons/base/module/wizard/wizard_module_export.py diff --git a/bin/addons/base/module/module_wizard.xml b/bin/addons/base/module/module_wizard.xml index 967d9c990a9..4e8bd7e0cba 100644 --- a/bin/addons/base/module/module_wizard.xml +++ b/bin/addons/base/module/module_wizard.xml @@ -8,12 +8,6 @@ model="ir.module.module" name="module.info_get"/> --> - - -
- - - - - -''' - -finish_fields = { - 'module_file': {'string': 'Module .ZIP file', 'type':'binary', 'readonly':True}, - 'module_filename': {'string': 'Filename', 'type':'char', 'size': 64, 'readonly':True}, -} - -class move_module_wizard(wizard.interface): - def zippy(self, archive, fromurl, path): - url = os.path.join(fromurl, path) - if os.path.isdir(url): - if path.split('/')[-1]=='.svn': - return False - for fname in os.listdir(url): - self.zippy(archive, fromurl, path and os.path.join(path, fname) or fname) - else: - if (path.split('.')[-1] not in ['py','pyo','pyc']) or (os.path.basename(path)=='__terp__.py'): - print 'Adding', os.path.join(fromurl, path), 'as', path - archive.write(os.path.join(fromurl, path), path) - return True - - def createzip(self, cr, uid, data, context): - module_obj=pooler.get_pool(cr.dbname).get('ir.module.module') - module_name = module_obj.browse(cr, uid, data['id']).name - - ad = tools.config['addons_path'] - if os.path.isdir(os.path.join(ad,module_name)): - archname = StringIO.StringIO('wb') - archive = PyZipFile(archname, "w", ZIP_DEFLATED) - archive.writepy(os.path.join(ad,module_name)) - self.zippy(archive, ad, module_name) - archive.close() - val =base64.encodestring(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() - val =base64.encodestring(val) - else: - raise wizard.except_wizard('Error !', 'Could not find the module to export !') - return {'module_file':val, 'module_filename': module_name+'.zip'} - - states = { - 'init': { - 'actions': [createzip], - 'result': { - 'type':'form', - 'arch':finish_form, - 'fields':finish_fields, - 'state':[('end','Close')] - } - } - } -move_module_wizard('base.module.export')