diff options
| author | qdp <qdp@tinyerp.com> | 2008-12-16 12:57:06 +0100 |
|---|---|---|
| committer | qdp <qdp@tinyerp.com> | 2008-12-16 12:57:06 +0100 |
| commit | 16b95805c4898c9ee2db059cd0f8c5d57ac141b2 (patch) | |
| tree | 70f86c5380c935d07038f8187ff107e0601242fd /addons/base_module_quality/wizard/module_quality_check.py | |
| parent | b6c69c83a22483659703f95b61c4ba4e544fd735 (diff) | |
*improvement of base_module_quality
bzr revid: qdp@tinyerp.com-20081216115706-q3d68614dl17or0z
Diffstat (limited to 'addons/base_module_quality/wizard/module_quality_check.py')
| -rw-r--r-- | addons/base_module_quality/wizard/module_quality_check.py | 64 |
1 files changed, 50 insertions, 14 deletions
diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py index de3f333338a..41d7aed7e1c 100644 --- a/addons/base_module_quality/wizard/module_quality_check.py +++ b/addons/base_module_quality/wizard/module_quality_check.py @@ -28,6 +28,7 @@ import sys import tools import os import pylint +import base_module_quality form_check = '''<?xml version="1.0"?> <form string="Quality check"> @@ -41,30 +42,65 @@ fields_check = { 'default': lambda *args: 'pylint' }, } + view_form = """<?xml version="1.0"?> <form string="Check quality"> - <field name="module_info" nolabel="1" colspan="4" height="150" width="400"/> + <notebook> + <page string="Summary"> + <field name="general_info" nolabel="1" colspan="4" height="350" width="400"/> + </page> + </notebook> </form>""" +#TODO: utiliser les nouveaux wizards pour heriter la vue et rajouter un onglet par test? +#TODO: remove the first screen which is unused view_field = { - "module_info": {'type': 'text', 'string': 'check quality', 'readonly':True}, + "general_info": {'type': 'text', 'string': 'General Info', 'readonly':True}, } + + + class wiz_quality_check(wizard.interface): + def _check(self, cr, uid, data, context): - if data['form']['test'] == 'pylint': - pool=pooler.get_pool(cr.dbname) - module_data = pool.get('ir.module.module').browse(cr, uid, data['ids']) - from pylint_test import pylint_test - ad = tools.config['addons_path'] - url = os.path.join(ad, module_data[0].name) - result = pylint_test._test_pylint(self, url) - string_ret = '' - for i in result: - string_ret = string_ret + i + ':\n' + result[i] - - return {'module_info':string_ret} + string_ret = "" + from tools import config + list_folders=os.listdir(config['addons_path']+'/base_module_quality/') + for item in list_folders: + path = config['addons_path']+'/base_module_quality/wizard/'+item + if os.path.exists(path+'/'+item+'.py') and item not in ['report','wizard', 'security']: + pool=pooler.get_pool(cr.dbname) + module_data = pool.get('ir.module.module').browse(cr, uid, data['ids']) + + ad = tools.config['addons_path'] + module_path = os.path.join(ad, module_data[0].name) + #import pylint_test + x = __import__(item) + val = x.__init__(module_path) + string_ret += val._result + + return {'general_info':string_ret} + + + #mra version + #~ result = pylint_test._test_pylint(self, url) + #~ string_ret = '' + #~ for i in result: + #~ string_ret = string_ret + i + ':\n' + result[i] + #~ string_ret = "" + #~ if data['form']['test'] == 'pylint': + #~ pool=pooler.get_pool(cr.dbname) + #~ module_data = pool.get('ir.module.module').browse(cr, uid, data['ids']) + #~ from pylint_test import pylint_test + #~ ad = tools.config['addons_path'] + #~ url = os.path.join(ad, module_data[0].name) + #~ result = pylint_test._test_pylint(self, url) + #~ string_ret = '' + #~ for i in result: + #~ string_ret = string_ret + i + ':\n' + result[i] + states = { 'init': { 'actions': [], |
