From 4c505f51aa77b7c86fa41dc4a79af17988b4e4ca Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 5 Dec 2008 14:57:33 +0530 Subject: [PATCH] base module quality bzr revid: mra@tinyerp.com-20081205092733-60b9iki2gxtgiolp --- addons/base_module_merge/__init__.py | 24 ++ addons/base_module_merge/__terp__.py | 44 +++ .../base_module_merge_wizard.xml | 20 ++ addons/base_module_merge/wizard/__init__.py | 25 ++ .../wizard/base_module_merge.py | 302 ++++++++++++++++++ addons/base_module_quality/__init__.py | 1 + addons/base_module_quality/__terp__.py | 6 +- .../base_module_quality.py | 27 ++ .../base_module_quality_view.xml | 0 .../base_module_quality_wizard.xml | 6 + addons/base_module_quality/wizard/__init__.py | 27 ++ .../wizard/module_quality_check.py | 85 +++++ .../wizard/pylint_test/__init__.py | 25 ++ .../wizard/pylint_test/pylint_test.py | 162 ++++++++++ 14 files changed, 751 insertions(+), 3 deletions(-) create mode 100644 addons/base_module_merge/__init__.py create mode 100644 addons/base_module_merge/__terp__.py create mode 100644 addons/base_module_merge/base_module_merge_wizard.xml create mode 100644 addons/base_module_merge/wizard/__init__.py create mode 100644 addons/base_module_merge/wizard/base_module_merge.py delete mode 100644 addons/base_module_quality/base_module_quality_view.xml create mode 100644 addons/base_module_quality/base_module_quality_wizard.xml create mode 100644 addons/base_module_quality/wizard/__init__.py create mode 100644 addons/base_module_quality/wizard/module_quality_check.py create mode 100644 addons/base_module_quality/wizard/pylint_test/__init__.py create mode 100644 addons/base_module_quality/wizard/pylint_test/pylint_test.py diff --git a/addons/base_module_merge/__init__.py b/addons/base_module_merge/__init__.py new file mode 100644 index 00000000000..8b433928f46 --- /dev/null +++ b/addons/base_module_merge/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/base_module_merge/__terp__.py b/addons/base_module_merge/__terp__.py new file mode 100644 index 00000000000..aa912d04f99 --- /dev/null +++ b/addons/base_module_merge/__terp__.py @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name" : "Module Merger", + "version" : "1.0", + "author" : "Tiny", + "website" : "http://tinyerp.com", + "category" : "Generic Modules/Base", + "description": """ + * The wizard asks a many2many of modules + * And then generate a module which is the merge of all selected modules + * The new module is provided as a .zip file + + The merge will works in all situations: + * Merging all .py files with the same name in the new module + * merging all .xml files and take care of id's. + """, + "depends" : ["base"], + "init_xml" : [ ], + "demo_xml" : [ ], + "update_xml" : [ "base_module_merge_wizard.xml" ], + "installable": True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/base_module_merge/base_module_merge_wizard.xml b/addons/base_module_merge/base_module_merge_wizard.xml new file mode 100644 index 00000000000..d9bf8755acb --- /dev/null +++ b/addons/base_module_merge/base_module_merge_wizard.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/addons/base_module_merge/wizard/__init__.py b/addons/base_module_merge/wizard/__init__.py new file mode 100644 index 00000000000..6b33adb9c66 --- /dev/null +++ b/addons/base_module_merge/wizard/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import base_module_merge +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/base_module_merge/wizard/base_module_merge.py b/addons/base_module_merge/wizard/base_module_merge.py new file mode 100644 index 00000000000..5e474b94fae --- /dev/null +++ b/addons/base_module_merge/wizard/base_module_merge.py @@ -0,0 +1,302 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import wizard +import osv +import pooler +import tools +import os +from xml.dom import minidom + +info_start_form = ''' +
+ +''' + +info_start_fields = { + 'modules_list': {'string':'Modules', 'type':'many2many','relation':'ir.module.module','help':'Select Modules which you want to merge in single module'}, +} + + +intro_start_form = ''' +
+ + + + + + + + + + +''' + +intro_start_fields = { + 'name': {'string':'Module Name', 'type':'char', 'size':64, 'required':True}, + 'directory_name': {'string':'Directory Name', 'type':'char', 'size':32, 'required':True}, + 'version': {'string':'Version', 'type':'char', 'size':16, 'required':True}, + 'author': {'string':'Author', 'type':'char', 'size':64, 'default': lambda *args: 'Tiny', 'required':True}, + 'category': {'string':'Category', 'type':'char', 'size':64, 'default': lambda *args: 'Vertical Modules/Parametrization', 'required':True}, + 'website': {'string':'Documentation URL', 'type':'char', 'size':64, 'default': lambda *args: 'http://tinyerp.com', 'required':True}, + 'description': {'string':'Full Description', 'type':'text', 'required':True}, + 'data_kind': {'string':'Type of Data', 'type':'selection', 'selection':[('demo','Demo Data'),('update','Normal Data')], 'required':True, 'default': lambda *args:'update'}, +} + +intro_save_form = ''' +
+ + + + + +