From 1ea07696714e43ae7b578df8c10252614581f9d9 Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 1 Jun 2010 15:42:46 +0530 Subject: [PATCH] [IMP]: base_module_quality: Apply minor changes bzr revid: ksa@tinyerp.co.in-20100601101246-pnwln0zovpw6q887 --- addons/base_module_quality/pep8_test/pep8_test.py | 6 +++--- addons/base_module_quality/pylint_test/pylint_test.py | 6 +++--- .../base_module_quality/structure_test/structure_test.py | 6 +++--- addons/base_module_quality/terp_test/terp_test.py | 14 +++++++------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/base_module_quality/pep8_test/pep8_test.py b/addons/base_module_quality/pep8_test/pep8_test.py index 52c0475..4aaaaa7 100644 --- a/addons/base_module_quality/pep8_test/pep8_test.py +++ b/addons/base_module_quality/pep8_test/pep8_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -48,7 +48,7 @@ PEP-8 Test , copyright of py files check, method can not call from loops list_files.append(os.path.join(i, j)) py_list = [] for file_py in list_files: - if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): + if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__openerp__.py'): file_path = os.path.join(module_path, file_py) py_list.append(file_path) diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index 8dbbce0..12400db 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -50,7 +50,7 @@ class quality_test(base_module_quality.abstract_quality_check): flag = False self.result_details += '''%s'''%(self.get_style()) for file_py in list_files: - if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): + if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__openerp__.py'): if not flag: flag = True file_path = os.path.join(module_path, file_py) diff --git a/addons/base_module_quality/structure_test/structure_test.py b/addons/base_module_quality/structure_test/structure_test.py index 466976f..10b80aa 100644 --- a/addons/base_module_quality/structure_test/structure_test.py +++ b/addons/base_module_quality/structure_test/structure_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -82,7 +82,7 @@ This test checks if the module satisfy tiny structure # module files calculation (module.py,module_view.xml,etc..) com_list = ['_unit_test.xml', '.py', '_view.xml', '_workflow.xml' , '_wizard.xml', '_report.xml', '_data.xml', '_demo.xml', '_security.xml', '_sequence.xml', '_graph.xml'] com_list = map(lambda x: module_name + x, com_list) - main_file = ['__init__.py', '__terp__.py'] + main_file = ['__init__.py', '__openerp__.py'] com_list.extend(main_file) module_dict['module'] = filter(lambda x: len(x.split(".")) > 1, module_dict['module']) score = self.get_score(module_dict['module'], com_list) diff --git a/addons/base_module_quality/terp_test/terp_test.py b/addons/base_module_quality/terp_test/terp_test.py index 993a80f..a974749 100644 --- a/addons/base_module_quality/terp_test/terp_test.py +++ b/addons/base_module_quality/terp_test/terp_test.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -49,13 +49,13 @@ class quality_test(base_module_quality.abstract_quality_check): score = 1.0 feel_good_factor = 0 feel_bad_factor = 0 - if '__terp__.py' not in list_files: + if '__openerp__.py' not in list_files: self.no_terp = True - self.result += _("The module does not contain the __terp__.py file") + self.result += _("The module does not contain the __openerp__.py file") return None result_dict = {} result_dict1 = {} - terp_file = os.path.join(module_path,'__terp__.py') + terp_file = os.path.join(module_path,'__openerp__.py') res = eval(tools.file_open(terp_file).read()) terp_keys = ['category', 'name', 'description', 'author', 'website', 'update_xml', 'init_xml', 'depends', 'version', 'active', 'installable', 'demo_xml'] for key in terp_keys: @@ -117,7 +117,7 @@ class quality_test(base_module_quality.abstract_quality_check): self.result_details += self.get_result_details(result_dict) self.result_details += self.get_result_details(result_dict1) - return [_('__terp__.py file'), score] + return [_('__openerp__.pyfile'), score] def run_test(self, cr, uid, module_path): terp_score = self.run_test_terp(cr, uid, module_path) @@ -125,7 +125,7 @@ class quality_test(base_module_quality.abstract_quality_check): if self.score*100 < self.min_score: self.message = 'Score is below than minimal score(%s%%)' % self.min_score if terp_score: - self.result = self.get_result({'__terp__.py': terp_score}) + self.result = self.get_result({'__openerp__.py': terp_score}) return None def get_result(self, dict_terp): -- 1.7.10.4