summaryrefslogtreecommitdiff
path: root/addons/base_module_quality/base_module_quality.py
diff options
context:
space:
mode:
authorqdp <qdp@tinyerp.com>2009-01-15 11:36:15 +0100
committerqdp <qdp@tinyerp.com>2009-01-15 11:36:15 +0100
commita2a55cbe3162420cfd3035123d3bbdec6c264325 (patch)
tree786a5e2eac393cdb2be11ff25aa3b36071fee6c6 /addons/base_module_quality/base_module_quality.py
parent3f53a2fd6a3cd254f6683de09bd4294c3e3e154c (diff)
[IMP] improved to get higher score on pylint
bzr revid: qdp@tinyerp.com-20090115103615-8qunbjw23fajwhxp
Diffstat (limited to 'addons/base_module_quality/base_module_quality.py')
-rw-r--r--addons/base_module_quality/base_module_quality.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py
index 0477e201cbb..b50ad8d20b0 100644
--- a/addons/base_module_quality/base_module_quality.py
+++ b/addons/base_module_quality/base_module_quality.py
@@ -23,6 +23,7 @@ import pooler
import os
import osv
from tools import config
+from tools.translate import _
class abstract_quality_check(object):
'''
@@ -52,24 +53,28 @@ class abstract_quality_check(object):
#Used to provide more details if necessary.
self.result_details = ""
- #This bool defines if the test can be run only if the module is installed.
+ #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.
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)
+ #This variable is used to give result of test more weight,
+ #because some tests are more critical than others.
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.
+ #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/')
+ self.list_folders = os.listdir(config['addons_path'] +
+ '/base_module_quality/')
for item in self.list_folders:
self.item = item
path = config['addons_path']+'/base_module_quality/'+item
- if os.path.exists(path+'/'+item+'.py') and item not in ['report', 'wizard', 'security']:
+ if os.path.exists(path + '/' + item + '.py') and item not in ['report', 'wizard', 'security']:
item2 = 'base_module_quality.' + item +'.' + item
x = __import__(item2)
x2 = getattr(x, item)
@@ -87,7 +92,8 @@ class abstract_quality_check(object):
def get_objects(self, cr, uid, module):
# This function returns all object of the given module..
pool = pooler.get_pool(cr.dbname)
- ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module), ('model','=','ir.model')])
+ ids2 = pool.get('ir.model.data').search(cr, uid,
+ [('module', '=', module), ('model', '=', 'ir.model')])
model_list = []
model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
for model in model_data: