From b9e8786ef86b4ef89af84aab1a2a2c44d09826b9 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Mon, 5 Jan 2009 18:14:34 +0530 Subject: changes on quality module bzr revid: mra@tinyerp.com-20090105124434-oll8rix427lv524l --- addons/base_module_quality/base_module_quality.py | 46 +++++++---------------- 1 file changed, 14 insertions(+), 32 deletions(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 0564d7c9066..f8cf125cbc2 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -86,7 +86,7 @@ class abstract_quality_check(object): self.tests.append(x3) # raise 'Not Implemented' - def run_test(self, cr, uid, module_path="", module_state=""): + def run_test(self, cr, uid, module_path=""): ''' this method should do the test and fill the score, result and result_details var ''' @@ -114,40 +114,22 @@ class abstract_quality_check(object): result_ids[obj] = ids return result_ids - def format_table(self, test='', header=[], data_list=[]): - res_format = {} - if test=='method': - detail = "" - detail += "\n===Method Test===\n" - res_format['detail'] = detail - if not data_list[2]: - detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % (header[0].ljust(40), header[1].ljust(16), header[2].ljust(20), header[3].ljust(16)) - for res in data_list[1]: - detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[1][res][0], data_list[1][res][1], data_list[1][res][2]) - res_format['detail'] = detail + '\n|}' - res_format['summary'] = data_list[0] - elif test=='pylint': - res_format['summary'] = data_list[0] - res_format['detail'] = data_list[1] - elif test=='speed': - detail = "" - detail += "\n===Speed Test===\n" - res_format['detail'] = detail - if not data_list[2]: - detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % (header[0].ljust(40), header[1].ljust(10), header[2].ljust(10), header[3].ljust(10), header[4].ljust(10), header[5].ljust(20)) - for data in data_list[1]: - detail += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (data[0], data[1], data[2], data[3], data[4], data[5]) - res_format['detail'] = detail + '\n|}\n' - res_format['summary'] = data_list[0] - elif test=='terp': - res_format['summary'] = data_list[0] - res_format['detail'] = data_list[1] - return res_format + def format_table(self, header=[], data_list=[]): + detail = "" + if header[0]=='method': + detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % (header[1].ljust(40), header[2].ljust(16), header[3].ljust(20), header[4].ljust(16)) + for res in data_list[0]: + detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[0][res][0], data_list[0][res][1], data_list[0][res][2]) + detail = detail + '\n|}' + elif header[0]=='speed': + detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % (header[1].ljust(40), header[2].ljust(10), header[3].ljust(10), header[4].ljust(10), header[5].ljust(10), header[6].ljust(20)) + for data in data_list[0]: + detail += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (data[0], data[1], data[2], data[3], data[4], data[5]) + detail = detail + '\n|}\n' + return detail def add_quatation(self, x, y): return x/y - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: -- cgit v1.2.3 From aef3884e59c6b1aec0e0f127e3e6c1969f4289a9 Mon Sep 17 00:00:00 2001 From: qdp Date: Mon, 5 Jan 2009 17:25:46 +0100 Subject: improvements on base_module_quality bzr revid: qdp@tinyerp.com-20090105162546-yr8su19er4gkih48 --- addons/base_module_quality/base_module_quality.py | 27 ++++++----------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index f8cf125cbc2..8ded5d15005 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -28,31 +28,18 @@ class abstract_quality_check(object): This Class provide... ''' -# #This float have to store the rating of the module. -# #Used to compute the final score (average of all scores). -# score = 0.0 -# -# #This char have to store the result. -# #Used to display the result of the test. -# result = "" -# -# #This char have to store the result with more details. -# #Used to provide more details if necessary. -# result_details = "" -# -# #This bool defines if the test can be run only if the module is installed. -# #True => the module have to be installed. -# #False => the module can be uninstalled. -# bool_installed_only = True - def __init__(self): ''' this method should initialize the var ''' #This float have to store the rating of the module. #Used to compute the final score (average of all scores). + #0 <= self.score <= 1 self.score = 0.0 + #This char have to store the name of the test. + self.name = "" + #This char have to store the result. #Used to display the result of the test. self.result = "" @@ -66,13 +53,13 @@ class abstract_quality_check(object): #False => the module can be uninstalled. self.bool_installed_only = True - #This variable is use to make result of test should have more weight (Some tests are more critical than others) - self.ponderation = 0.0 + self.ponderation = 1.0 #Specify test got an error on module self.error = False + #The tests have to subscribe itselfs in this list, that contains all the test that have to be performed. self.tests = [] self.list_folders = os.listdir(config['addons_path']+'/base_module_quality/') for item in self.list_folders: @@ -90,7 +77,7 @@ class abstract_quality_check(object): ''' this method should do the test and fill the score, result and result_details var ''' -# raise 'Not Implemented' + raise 'Not Implemented' def get_objects(self, cr, uid, module): # This function returns all object of the given module.. -- cgit v1.2.3 From 9ac4708047bf57345624001a486d0cba32428001 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Wed, 7 Jan 2009 15:03:01 +0530 Subject: small changes bzr revid: mra@tinyerp.com-20090107093301-riilvjtanc4ibqdq --- addons/base_module_quality/base_module_quality.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 8ded5d15005..21c17e99a1e 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -59,7 +59,7 @@ class abstract_quality_check(object): #Specify test got an error on module self.error = False - #The tests have to subscribe itselfs in this list, that contains all the test that have to be performed. + #The tests have to subscribe itselfs in this list, that contains all the test that have to be performed. self.tests = [] self.list_folders = os.listdir(config['addons_path']+'/base_module_quality/') for item in self.list_folders: -- cgit v1.2.3 From 1d2fef3edfc768aa681dd609db2516d34fae27a0 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Wed, 7 Jan 2009 18:37:53 +0530 Subject: quality module bzr revid: mra@tinyerp.com-20090107130753-n0or93qkfcuj96b6 --- addons/base_module_quality/base_module_quality.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 21c17e99a1e..6db637ab32e 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -103,16 +103,15 @@ class abstract_quality_check(object): def format_table(self, header=[], data_list=[]): detail = "" - if header[0]=='method': - detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % (header[1].ljust(40), header[2].ljust(16), header[3].ljust(20), header[4].ljust(16)) - for res in data_list[0]: - detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[0][res][0], data_list[0][res][1], data_list[0][res][2]) - detail = detail + '\n|}' - elif header[0]=='speed': - detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % (header[1].ljust(40), header[2].ljust(10), header[3].ljust(10), header[4].ljust(10), header[5].ljust(10), header[6].ljust(20)) - for data in data_list[0]: - detail += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (data[0], data[1], data[2], data[3], data[4], data[5]) - detail = detail + '\n|}\n' + header_list = [] + final_list = [] + for head in data_list[1]: + header_list.append(head) + detail += (header[0]) % tuple(header_list) + for res in data_list[0]: + data_list[0][res].append(res) + detail += (header[1]) % tuple(data_list[0][res]) + detail = detail + '\n|}' return detail def add_quatation(self, x, y): -- cgit v1.2.3 From 78d2de2600f3d383edffacb6c0b213b8d8200817 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 7 Jan 2009 19:53:15 +0530 Subject: Corrected terp test on Quality Module bzr revid: jvo@tinyerp.com-20090107142315-xb8qq0u9coexf04m --- addons/base_module_quality/base_module_quality.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 6db637ab32e..1be9de1ec5b 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -25,7 +25,7 @@ from tools import config class abstract_quality_check(object): ''' - This Class provide... + This Class provides... ''' def __init__(self): -- cgit v1.2.3 From 5b6bcfb55917f2755e4998ed5f684a1b19f8d872 Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 8 Jan 2009 09:49:26 +0100 Subject: *imrpovements bzr revid: qdp@tinyerp.com-20090108084926-n4dxtv1bczx9id1t --- addons/base_module_quality/base_module_quality.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 1be9de1ec5b..48a4d6dc69a 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -21,6 +21,7 @@ ############################################################################## import pooler import os +import osv from tools import config class abstract_quality_check(object): @@ -77,7 +78,8 @@ class abstract_quality_check(object): ''' this method should do the test and fill the score, result and result_details var ''' - raise 'Not Implemented' + + raise osv.except_osv(_('Programming Error'), _('Test Is Not Implemented')) def get_objects(self, cr, uid, module): # This function returns all object of the given module.. @@ -103,14 +105,12 @@ class abstract_quality_check(object): def format_table(self, header=[], data_list=[]): detail = "" - header_list = [] - final_list = [] - for head in data_list[1]: - header_list.append(head) - detail += (header[0]) % tuple(header_list) - for res in data_list[0]: - data_list[0][res].append(res) - detail += (header[1]) % tuple(data_list[0][res]) + detail += (header[0]) % tuple(header[1]) + frow = '\n|-' + for i in header[1]: + frow += '\n| %s' + for key, value in data_list.items(): + detail += (frow) % tuple(value) detail = detail + '\n|}' return detail -- cgit v1.2.3 From 8a06bea953c16c90d4bef269638b5d6b467b89a9 Mon Sep 17 00:00:00 2001 From: qdp Date: Thu, 8 Jan 2009 14:03:20 +0100 Subject: base_module_quality improvements: *added note field *improved transability *improved output *cleaned *modified format_table method bzr revid: qdp@tinyerp.com-20090108130320-ypcc4jxbx51jv1ra --- addons/base_module_quality/base_module_quality.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/base_module_quality/base_module_quality.py') diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 48a4d6dc69a..4590a51dfe3 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -41,6 +41,9 @@ class abstract_quality_check(object): #This char have to store the name of the test. self.name = "" + #This char have to store the aim of the test and eventually a note. + self.note = "" + #This char have to store the result. #Used to display the result of the test. self.result = "" -- cgit v1.2.3