diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2007-04-23 19:59:02 +0000 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2007-04-23 19:59:02 +0000 |
| commit | 5e962936f204f6e37fb27bb52c9a1ffae3fdb9a0 (patch) | |
| tree | 5083123ca371acf82e87c52b48b74a0acb141ee6 /addons/base_module_publish | |
| parent | ac97b14a7fc5ab92422579a9518f4e0e4705f58c (diff) | |
Skeleton for the new module: base_module_publish
Better descriptions on __terp__.py files
bzr revid: fp@tinyerp.com-b711aae5cacf92476f0e97a0c90153084c913590
Diffstat (limited to 'addons/base_module_publish')
| -rw-r--r-- | addons/base_module_publish/__init__.py | 29 | ||||
| -rw-r--r-- | addons/base_module_publish/__terp__.py | 24 | ||||
| -rw-r--r-- | addons/base_module_publish/base_module_publish_wizard.xml | 10 | ||||
| -rw-r--r-- | addons/base_module_publish/wizard/__init__.py | 29 | ||||
| -rw-r--r-- | addons/base_module_publish/wizard/base_module_publish.py | 187 |
5 files changed, 279 insertions, 0 deletions
diff --git a/addons/base_module_publish/__init__.py b/addons/base_module_publish/__init__.py new file mode 100644 index 00000000000..cf8c8bc6020 --- /dev/null +++ b/addons/base_module_publish/__init__.py @@ -0,0 +1,29 @@ +############################################################################## +# +# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# Fabien Pinckaers <fp@tiny.Be> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import wizard diff --git a/addons/base_module_publish/__terp__.py b/addons/base_module_publish/__terp__.py new file mode 100644 index 00000000000..adb9d554de9 --- /dev/null +++ b/addons/base_module_publish/__terp__.py @@ -0,0 +1,24 @@ +{ + "name" : "Module publisher", + "version" : "1.0", + "author" : "Tiny", + "website" : "http://tinyerp.com", + "category" : "Generic Modules/Base", + "description": """ + This module can be used by developpers to automatically publish their modules + in a few click to the following websites: + * http://TinyERP.com, section module + * http://TinyForge.org + * PyPi, The python offical repository + * http://Freshmeat.net + + It adds a button "Publish module" on each module, so that you simply have + to call this button when you want to release a new version of your module. + """, + "depends" : ["base"], + "init_xml" : [ ], + "demo_xml" : [ ], + "update_xml" : [ "base_module_publish_wizard.xml" ], + "active": True, + "installable": True +} diff --git a/addons/base_module_publish/base_module_publish_wizard.xml b/addons/base_module_publish/base_module_publish_wizard.xml new file mode 100644 index 00000000000..1985280d577 --- /dev/null +++ b/addons/base_module_publish/base_module_publish_wizard.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<terp> + <data> + <wizard + id="wizard_base_module_publish" + string="Publish your module" + model="ir.module.module" + name="base_module_publish.module_publish"/> + </data> +</terp> diff --git a/addons/base_module_publish/wizard/__init__.py b/addons/base_module_publish/wizard/__init__.py new file mode 100644 index 00000000000..fb8d0d81201 --- /dev/null +++ b/addons/base_module_publish/wizard/__init__.py @@ -0,0 +1,29 @@ +############################################################################## +# +# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# Fabien Pinckaers <fp@tiny.Be> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import base_module_publish diff --git a/addons/base_module_publish/wizard/base_module_publish.py b/addons/base_module_publish/wizard/base_module_publish.py new file mode 100644 index 00000000000..ebfca9152ca --- /dev/null +++ b/addons/base_module_publish/wizard/base_module_publish.py @@ -0,0 +1,187 @@ +############################################################################## +# +# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import time +import wizard +import osv +import pooler + +intro_form = '''<?xml version="1.0"?> +<form string="Module publication"> + <separator string="Publication information" colspan="4"/> + <field name="text" colspan="4" nolabel="1"/> +</form>''' + +intro_fields = { + 'text': {'string':'Introduction', 'type':'text', 'readonly':True, 'default': lambda *args: """ +This system will automatically publish the selected module to the +Tiny ERP official website. You can use it to quickly publish a new +module or update an existing one (new version). + +Make sure you read the publication manual and modules guidelines +before continuing: + http://tinyerp.com + +Thank you for contributing ! +"""}, +} + +check_form = '''<?xml version="1.0"?> +<form string="Module publication"> + <separator string="Verify your module information" colspan="4"/> + <field name="name"/> + <field name="version"/> + <field name="author"/> + <field name="website" widget="url"/> + <field name="shortdesc" colspan="3"/> + <field name="description" colspan="3"/> +</form>''' + +check_fields = { + 'name': {'string':'Name', 'type':'char', 'size':64, 'readonly':True}, + 'shortdesc': {'string':'Small description', 'type':'char', 'size':200, 'readonly':True}, + 'author': {'string':'Author', 'type':'char', 'size':128, 'readonly':True}, + 'website': {'string':'Website', 'type':'char', 'size':200, 'readonly':True}, + 'url': {'string':'Download URL', 'type':'char', 'size':200, 'readonly':True}, + 'description': {'string':'Description', 'type':'text', 'readonly':True}, + 'version': {'string':'Version', 'type':'char', 'readonly':True}, +} + + +upload_info_form = '''<?xml version="1.0"?> +<form string="Module publication"> + <separator string="User information" colspan="4"/> + <label align="0.0" string="Please provide here your login on the Tiny ERP website." colspan="4"/> + <label align="0.0" string="If you don't have an access, you can create one online." colspan="4"/> + <field name="login"/> + <newline/> + <field name="password"/> + <separator string="Module information" colspan="4"/> + <field name="category"/> + <field name="licence"/> + <field name="url_download"/> + <label align="0.0" colspan="2" string="(Keep empty for an auto upload of the module)"/> +</form>''' + +upload_info_fields = { + 'login': {'string':'Login', 'type':'char', 'size':32, 'required':True}, + 'password': {'string':'Password', 'type':'char', 'size':32, 'required':True}, + 'category': {'string':'Category', 'type':'selection', 'size':64, 'required':True, + 'selection': [(0, 'Selection 1'), (1,'Selcetion 2')] + }, + 'licence': { + 'string':'Licence', 'type':'selection', 'size':64, 'required':True, + 'selection': [('GPL', 'GPL'), ('Other proprietary','Other proprietary')], + 'default': lambda *args: 'GPL' + }, + 'url_download': {'string':'Download URL', 'type':'char', 'size':128}, +} + +end_form = '''<?xml version="1.0"?> +<form string="Module publication"> + <separator string="Publication result" colspan="4"/> + <field name="text_end" colspan="4" nolabel="1"/> +</form>''' + +end_fields = { + 'text_end': {'string':'Summary', 'type':'text', 'readonly':True, 'default': lambda *args: """ +Thank you for contributing ! + +Your module has been successfully uploaded to the official website. +You must wait a few hours/days so that the Tiny ERP core team review +your module for approval on the website. +"""}, +} + + +def module_check(self, cr, uid, data, context): + pool = pooler.get_pool(cr.dbname) + module = pool.get('ir.module.module').browse(cr, uid, data['id'], context) + return { + 'name': module.name, + 'shortdesc': module.shortdesc, + 'author': module.author, + 'website': module.website, + 'url': module.url, + 'description': module.description, + 'version': module.latest_version + } + +class base_module_publish(wizard.interface): + states = { + 'init': { + 'actions': [], + 'result': { + 'type':'form', + 'arch':intro_form, + 'fields':intro_fields, + 'state':[ + ('end','Cancel'), + ('step1','Continue') + ] + } + }, + 'step1': { + 'actions': [module_check], + 'result': { + 'type':'form', + 'arch':check_form, + 'fields':check_fields, + 'state':[ + ('end','Cancel'), + ('init', 'Previous'), + ('step2','Continue') + ] + } + }, + 'step2': { + 'actions': [], + 'result': { + 'type':'form', + 'arch':upload_info_form, + 'fields':upload_info_fields, + 'state':[ + ('end','Cancel'), + ('step1', 'Previous'), + ('publish','Publish Now !') + ] + } + }, + 'publish': { + 'actions': [], # Action to develop: upload method + 'result': { + 'type':'form', + 'arch':end_form, + 'fields':end_fields, + 'state':[ + ('end','Close') + ] + } + } + } +base_module_publish('base_module_publish.module_publish') + |
