base module quality..format the form

bzr revid: mra@tinyerp.com-20081224072046-i2e91527kxqy6iia
This commit is contained in:
mra (Open ERP) 2008-12-24 12:50:46 +05:30
parent 22e08146f9
commit dd30ce0e8b
5 changed files with 11 additions and 19 deletions

View File

@ -15,9 +15,9 @@
</field>
</record>
<act_window
id="act_view_wiz_quality_check"
name="wizard quality chekc"
res_model="wizard.quality.check"
id="act_view_wiz_quality_check"
name="Wizard Quality Check"
res_model="wizard.quality.check"
src_model="ir.module.module"
target="new"
view_mode="form"

View File

@ -31,11 +31,10 @@ class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
self.result = """
===Method Test===
===Method Test===:
This test checks if the module classes are raising exception when calling basic methods or no.
"""
self.bool_installed_only = True
return None
@ -79,15 +78,13 @@ This test checks if the module classes are raising exception when calling basic
temp.append('Exception')
ex_count += 1
result[obj] = temp
self.result+=('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % ('Object Name'.ljust(40), 'search()'.ljust(16), 'fields_view_get()'.ljust(20), 'read()'.ljust(16))
self.result += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % ('Object Name'.ljust(40), 'search()'.ljust(16), 'fields_view_get()'.ljust(20), 'read()'.ljust(16))
for res in result:
self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, result[res][0],result[res][1], result[res][2])
self.result += '\n|}'
print "RES", self.result
self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0
return None

View File

@ -31,12 +31,10 @@ class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
self.result = """
Pylint Test:
------------
===Pylint Test===:
This test checks if the module satisfy the current coding standard used by OpenERP.
"""
self.bool_installed_only = False
return None
@ -50,7 +48,7 @@ Pylint Test:
for j in os.listdir(path):
list_files.append(os.path.join(i, j))
n = 0
n = 0
score = 0.0
for file in list_files:
if file.split('.')[-1] == 'py' and not file.endswith('__init__.py') and not file.endswith('__terp__.py'):
@ -66,10 +64,10 @@ Pylint Test:
try:
score += float(res[leftchar+1:rightchar])
self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n"
self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n"
except:
score += 0
self.result += file + ": Unable to parse the result. Check the details.\n"
self.result += file + ": Unable to parse the result. Check the details.\n"
self.result_details += res
self.score = n and score / n or score

View File

@ -35,12 +35,10 @@ class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
self.result = """
===Speed Test===
===Speed Test===:
This test checks the speed of the module.
"""
self.bool_installed_only = True
return None
@ -111,7 +109,7 @@ This test checks the speed of the module.
self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, "", "", "", "Warning! Object has no demo data")
self.result += '\n|}'
self.result += '\n|}\n'
self.score = obj_counter and score/obj_counter or 0.0
return None

View File

@ -60,7 +60,6 @@ class wiz_quality_check(osv.osv_memory):
def _check(self, cr, uid, data, context={}):
string_ret = ""
from tools import config
print data
data['ids'] = data.get('module_id', False)
pool = pooler.get_pool(cr.dbname)
module_data = pool.get('ir.module.module').browse(cr, uid, [data['ids']])