diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py index 1abaa288e86..34841dd41cc 100644 --- a/addons/base_module_quality/method_test/method_test.py +++ b/addons/base_module_quality/method_test/method_test.py @@ -20,9 +20,7 @@ # ############################################################################## - -import os -from tools import config +from tools.translate import _ from base_module_quality import base_module_quality import pooler diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index 930ab7d29f1..8a7f953837f 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -23,6 +23,7 @@ import os from tools import config +from tools.translate import _ from base_module_quality import base_module_quality @@ -35,6 +36,8 @@ class quality_test(base_module_quality.abstract_quality_check): self.note = _("""This test uses Pylint and checks if the module satisfies the coding standard of Python. See http://www.logilab.org/project/name/pylint for further info.\n """) self.bool_installed_only = False self.ponderation = 1.0 + self.result = "" + self.result_details = "" return None def run_test(self, cr, uid, module_path): @@ -81,7 +84,7 @@ class quality_test(base_module_quality.abstract_quality_check): return None def get_result(self, dict): - header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('File Name'), _('Result (/10)'),]) + header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('File Name'), _('Result (/10)')]) if not self.error: return self.format_table(header, data_list=dict) return "" diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index d35f6362074..33456e4729f 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -24,6 +24,7 @@ import netsvc from osv import fields, osv import os from tools import config +from tools.translate import _ import pooler import time @@ -54,11 +55,11 @@ This test checks the speed of the module. Note that at least 5 demo data is need result_dict = {} result_dict2 = {} self.result_details += _("O(1) means that the number of SQL requests to read the object does not depand on the number of objects we are reading. This feature is hardly wished.\n") - for obj in obj_ids: + for obj, ids in obj_ids.items(): obj_counter += 1 - ids = obj_ids[obj] ids = ids[:100] size = len(ids) + list2 = [] if size: list = [] @@ -80,6 +81,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need if size < 5: list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")] + list2 = [obj, _("No enough data")] else: if code_size_complexity <= (code_base_complexity + size): complexity = _("O(1)") @@ -93,18 +95,16 @@ This test checks the speed of the module. Note that at least 5 demo data is need else: list = [obj, size, "", "", "", _("Warning! Object has no demo data")] - list2 = [obj, _("No demo data")] + list2 = [obj, _("No data")] result_dict[obj] = list result_dict2[obj] = list2 - self.score = obj_counter and score / obj_counter or 0.0 self.result_details += self.get_result_details(result_dict) self.result += self.get_result(result_dict2) - return None def get_result(self, dict): - header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('Object Name'), _('Result'),]) + header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s', [_('Object Name'), _('Result')]) if not self.error: return self.format_table(header, data_list=dict) return ""