annotate data/plugin/action/loadactions.py @ 625:f4e63b74b969

FormSubmit: adapt to werkzeug MultiDict
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 25 Mar 2013 17:47:30 +0100
parents 5f499a634857
children f683dea1ac1b
rev   line source
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - loadactions Action
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 Triggers multiple actions at once.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 Actions are defined in actions[] CGI parameter,
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 where actions[] is array of action names.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 @copyright: 2008 by Peter Bodi <petrdll@centrum.sk>
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 @license: GNU GPL, see COPYING for details.
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 """
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 from MoinMoin import wikiutil
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 from MoinMoin.Page import Page
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 from MoinMoin.action import ActionBase
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16 from MoinMoin.action import getHandler
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 from submitbase import SubmitError
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
20
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 def execute(pagename, request):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 for action in request.form.get("actions[]"):
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23 handler = getHandler(request, action)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24 try:
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25 handler(pagename, request)
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 except SubmitError:
623
5f499a634857 FormSubmit: fix pep8, remove unused imports, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 622
diff changeset
27 # Stop executing next actions if there is an error
622
12465aa315be add code from ActionMarket/FormSubmit (form_submit-1.7.tar.gz) - outdated code for moin 1.7/1.8
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28 break