annotate MoinMoin/action/__init__.py @ 4183:fc20a076aad0

Accomodate for consolidation of Request/Response
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sat, 21 Jun 2008 16:57:20 +0200
parents 85884c67228d
children 40acd13fb3d6
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
3 MoinMoin - Action Implementation
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5 Actions are triggered by the user clicking on special links on the page
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
6 (e.g. the "edit" link). The name of the action is passed in the "action"
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
7 CGI parameter.
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 The sub-package "MoinMoin.action" contains external actions, you can
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10 place your own extensions there (similar to extension macros). User
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11 actions that start with a capital letter will be displayed in a list
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12 at the bottom of each page.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
14 User actions starting with a lowercase letter can be used to work
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15 together with a user macro; those actions a likely to work only if
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16 invoked BY that macro, and are thus hidden from the user interface.
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
17
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
18 Additionally to the usual stuff, we provide an ActionBase class here with
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
19 some of the usual base functionality for an action, like checking
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
20 actions_excluded, making and checking tickets, rendering some form,
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
21 displaying errors and doing stuff after an action. Also utility functions
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
22 regarding actions are located here.
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
23
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1875
diff changeset
24 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
25 2006 MoinMoin:ThomasWaldmann
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
26 2008 MoinMoin:FlorianKrupicka
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
27 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
28 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
29
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
30 from MoinMoin.util import pysupport
2714
eb37036e3350 temporary fix missing http headers for action=content
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2294
diff changeset
31 from MoinMoin import config, wikiutil
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
32 from MoinMoin.Page import Page
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
33
1132
f9d8b80f5afb implement list of known actions similar to list of known macros
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1110
diff changeset
34 # create a list of extension actions from the package directory
1133
db56bd53fc32 cleanup plugin related code / attributes, remove unused stuff
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1132
diff changeset
35 modules = pysupport.getPackageModules(__file__)
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
36
1132
f9d8b80f5afb implement list of known actions similar to list of known macros
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1110
diff changeset
37 # builtin-stuff (see do_<name> below):
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2286
diff changeset
38 names = ['show', 'recall', 'raw', 'format', 'content', 'print', 'refresh', 'goto', ]
1132
f9d8b80f5afb implement list of known actions similar to list of known macros
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1110
diff changeset
39
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
40 class ActionBase:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
41 """ action base class with some generic stuff to inherit
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
42
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
43 Note: the action name is the class name of the derived class
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
44 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
45 def __init__(self, pagename, request):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
46 self.request = request
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
47 self.form = request.form
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
48 self.cfg = request.cfg
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
49 self._ = _ = request.getText
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
50 self.pagename = pagename
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
51 self.actionname = self.__class__.__name__
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
52 self.use_ticket = False # set this to True if you want to use a ticket
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
53 self.user_html = '''Just checking.''' # html fragment for make_form
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
54 self.form_cancel = "cancel" # form key for cancelling action
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
55 self.form_cancel_label = _("Cancel") # label for the cancel button
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
56 self.form_trigger = "doit" # form key for triggering action (override with e.g. 'rename')
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
57 self.form_trigger_label = _("Do it.") # label for the trigger button
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
58 self.page = Page(request, pagename)
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
59 self.error = ''
3358
795ee44690a0 ActionBase: default to POST
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3355
diff changeset
60 self.method = 'POST'
1751
95485f94760d action/__init__.py:fixed wrong definition
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1750
diff changeset
61 self.enctype = 'multipart/form-data'
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
62
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
63 # CHECKS -----------------------------------------------------------------
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
64 def is_excluded(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
65 """ Return True if action is excluded """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
66 return self.actionname in self.cfg.actions_excluded
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
67
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
68 def is_allowed(self):
3355
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
69 """
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
70 Return True if action is allowed (by ACL), or
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
71 return a tuple (allowed, message) to show a
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
72 message other than the default.
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
73 """
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
74 return True
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
75
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
76 def check_condition(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
77 """ Check if some other condition is not allowing us to do that action,
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
78 return error msg or None if there is no problem.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
79
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
80 You can use this to e.g. check if a page exists.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
81 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
82 return None
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
83
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
84 def ticket_ok(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
85 """ Return True if we check for tickets and there is some valid ticket
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
86 in the form data or if we don't check for tickets at all.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
87 Use this to make sure someone really used the web interface.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
88 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
89 if not self.use_ticket:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
90 return True
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
91 # Require a valid ticket. Make outside attacks harder by
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
92 # requiring two full HTTP transactions
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
93 ticket = self.form.get('ticket', [''])[0]
1573
1453513eaa7e use tickets for editing, cfg.edit_ticketing, make tickets more safe, invalidate old tickets
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1550
diff changeset
94 return wikiutil.checkTicket(self.request, ticket)
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
95
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
96 # UI ---------------------------------------------------------------------
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
97 def get_form_html(self, buttons_html):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
98 """ Override this to assemble the inner part of the form,
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
99 for convenience we give him some pre-assembled html for the buttons.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
100 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
101 _ = self._
1384
d1ceb31f3d02 make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1358
diff changeset
102 f = self.request.formatter
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
103 prompt = _("Execute action %(actionname)s?") % {'actionname': self.actionname}
1384
d1ceb31f3d02 make more use of formatter
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1358
diff changeset
104 return f.paragraph(1) + f.text(prompt) + f.paragraph(0) + f.rawHTML(buttons_html)
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
105
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
106 def make_buttons(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
107 """ return a list of form buttons for the action form """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
108 return [
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
109 (self.form_trigger, self.form_trigger_label),
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
110 (self.form_cancel, self.form_cancel_label),
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
111 ]
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
112
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
113 def make_form(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
114 """ Make some form html for later display.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
115
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
116 The form might contain an error that happened when trying to do the action.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
117 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
118 from MoinMoin.widget.dialog import Dialog
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
119 _ = self._
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
120
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
121 if self.error:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
122 error_html = u'<p class="error">%s</p>\n' % self.error
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
123 else:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
124 error_html = ''
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
125
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
126 buttons = self.make_buttons()
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
127 buttons_html = []
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
128 for button in buttons:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
129 buttons_html.append('<input type="submit" name="%s" value="%s">' % button)
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
130 buttons_html = "".join(buttons_html)
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
131
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
132 if self.use_ticket:
1573
1453513eaa7e use tickets for editing, cfg.edit_ticketing, make tickets more safe, invalidate old tickets
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1550
diff changeset
133 ticket_html = '<input type="hidden" name="ticket" value="%s">' % wikiutil.createTicket(self.request)
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
134 else:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
135 ticket_html = ''
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
136
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
137 d = {
1751
95485f94760d action/__init__.py:fixed wrong definition
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1750
diff changeset
138 'method': self.method,
4168
2edbd96f3179 Replaced request.getScriptname() with a werkzeug property
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4141
diff changeset
139 'baseurl': self.request.script_root,
1751
95485f94760d action/__init__.py:fixed wrong definition
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1750
diff changeset
140 'enctype': self.enctype,
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
141 'error_html': error_html,
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
142 'actionname': self.actionname,
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
143 'pagename': self.pagename,
3040
8608b258f8e6 bug fix of MoinMoinBugs/MoveAttachmentNotWorkingWithModPython (thanks to Boleslaw Kulbabinski) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
144 'pagename_quoted': wikiutil.quoteWikinameURL(self.pagename),
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
145 'ticket_html': ticket_html,
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
146 'user_html': self.get_form_html(buttons_html),
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
147 }
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
148
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
149 form_html = '''
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
150 %(error_html)s
3040
8608b258f8e6 bug fix of MoinMoinBugs/MoveAttachmentNotWorkingWithModPython (thanks to Boleslaw Kulbabinski) (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2966
diff changeset
151 <form action="%(baseurl)s/%(pagename_quoted)s" method="%(method)s" enctype="%(enctype)s">
2842
31e9f486d1ce Fix two ActionBase form bugs: two method arguments in same form tag, input tag without a div (or any else 'container' around it)
Ville-Pekka Vainio <vpivaini AT cs DOT helsinki DOT fi>
parents: 2714
diff changeset
152 <div>
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
153 <input type="hidden" name="action" value="%(actionname)s">
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
154 %(ticket_html)s
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
155 %(user_html)s
2842
31e9f486d1ce Fix two ActionBase form bugs: two method arguments in same form tag, input tag without a div (or any else 'container' around it)
Ville-Pekka Vainio <vpivaini AT cs DOT helsinki DOT fi>
parents: 2714
diff changeset
156 </div>
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
157 </form>''' % d
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
158
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
159 return Dialog(self.request, content=form_html)
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
160
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
161 def render_msg(self, msg, msgtype):
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
162 """ Called to display some message (can also be the action form) """
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
163 self.request.theme.add_msg(msg, msgtype)
3354
3f2e51a2dd08 ActionBase: use do_show to honour request.rev
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3234
diff changeset
164 do_show(self.pagename, self.request)
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
165
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
166 def render_success(self, msg, msgtype):
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
167 """ Called to display some message when the action succeeded """
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
168 self.request.theme.add_msg(msg, msgtype)
3354
3f2e51a2dd08 ActionBase: use do_show to honour request.rev
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3234
diff changeset
169 do_show(self.pagename, self.request)
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
170
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
171 def render_cancel(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
172 """ Called when user has hit the cancel button """
3354
3f2e51a2dd08 ActionBase: use do_show to honour request.rev
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3234
diff changeset
173 do_show(self.pagename, self.request)
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
174
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
175 def render(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
176 """ Render action - this is the main function called by action's
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
177 execute() function.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
178
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
179 We usually render a form here, check for posted forms, etc.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
180 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
181 _ = self._
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
182 form = self.form
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
183
1868
64507f46beb2 reduce usage of has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1816
diff changeset
184 if self.form_cancel in form:
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
185 self.render_cancel()
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
186 return
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
187
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
188 # Validate allowance, user rights and other conditions.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
189 error = None
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
190 if self.is_excluded():
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
191 error = _('Action %(actionname)s is excluded in this wiki!') % {'actionname': self.actionname }
3355
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
192 else:
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
193 allowed = self.is_allowed()
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
194 if isinstance(allowed, tuple):
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
195 allowed, msg = allowed
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
196 else:
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
197 msg = _('You are not allowed to use action %(actionname)s on this page!') % {'actionname': self.actionname }
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
198 if not allowed:
19a7a6efaa21 ActionBase: allow is_allowed() to return a tuple (allowed, message)
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 3354
diff changeset
199 error = msg
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
200 if error is None:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
201 error = self.check_condition()
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
202 if error:
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
203 self.render_msg(error, "error")
1868
64507f46beb2 reduce usage of has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1816
diff changeset
204 elif self.form_trigger in form: # user hit the trigger button
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
205 if self.ticket_ok():
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
206 success, self.error = self.do_action()
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
207 else:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
208 success = False
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
209 self.error = _('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': self.actionname }
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
210 self.do_action_finish(success)
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
211 else:
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
212 # Return a new form
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
213 self.render_msg(self.make_form(), "dialog")
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
214
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
215 # Executing the action ---------------------------------------------------
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
216 def do_action(self):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
217 """ Do the action and either return error msg or None, if there was no error. """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
218 return None
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
219
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
220 # AFTER the action -------------------------------------------------------
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
221 def do_action_finish(self, success):
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
222 """ Override this to handle success or failure (with error in self.error) of your action.
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
223 """
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
224 if success:
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
225 self.render_success(self.error, "info")
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
226 else:
2966
ba14d391c2ba Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but
Alexander Schremmer <alex AT alexanderweb DOT de>
parents: 2842
diff changeset
227 self.render_msg(self.make_form(), "dialog") # display the form again
636
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
228
b77ab6ea0c18 move wikiaction.py to action/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 634
diff changeset
229
1110
b27d720fbc8e actions: cleanup, fix imports
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1109
diff changeset
230 # Builtin Actions ------------------------------------------------------------
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
231
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
232 def do_raw(pagename, request):
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
233 """ send raw content of a page (e.g. wiki markup) """
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
234 if not request.user.may.read(pagename):
1781
5408417e650b send_page: remove some more call's request param (see cs 1777)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1751
diff changeset
235 Page(request, pagename).send_page()
621
d1e84cbab594 simplified code in wikiaction
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 620
diff changeset
236 else:
1682
30116d7d098a request.rev is either revision integer (when given in form) or None
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1573
diff changeset
237 rev = request.rev or 0
621
d1e84cbab594 simplified code in wikiaction
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 620
diff changeset
238 Page(request, pagename, rev=rev).send_raw()
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
239
1875
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
240 def do_show(pagename, request, content_only=0, count_hit=1, cacheable=1, print_mode=0):
620
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
241 """ show a page, either current revision or the revision given by rev form value.
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
242 if count_hit is non-zero, we count the request for statistics.
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
243 """
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
244 # We must check if the current page has different ACLs.
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
245 if not request.user.may.read(pagename):
1781
5408417e650b send_page: remove some more call's request param (see cs 1777)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1751
diff changeset
246 Page(request, pagename).send_page()
621
d1e84cbab594 simplified code in wikiaction
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 620
diff changeset
247 else:
4183
fc20a076aad0 Accomodate for consolidation of Request/Response
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4176
diff changeset
248 from MoinMoin.web.contexts import HTTPContext, RenderContext
fc20a076aad0 Accomodate for consolidation of Request/Response
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4176
diff changeset
249 mimetype = request.form.get('mimetype', u"text/html")
1682
30116d7d098a request.rev is either revision integer (when given in form) or None
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1573
diff changeset
250 rev = request.rev or 0
621
d1e84cbab594 simplified code in wikiaction
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 620
diff changeset
251 if rev == 0:
d1e84cbab594 simplified code in wikiaction
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 620
diff changeset
252 request.cacheable = cacheable
1875
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
253 Page(request, pagename, rev=rev, formatter=mimetype).send_page(
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
254 count_hit=count_hit,
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
255 print_mode=print_mode,
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
256 content_only=content_only,
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
257 )
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
258
620
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
259 def do_format(pagename, request):
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
260 """ send a page using a specific formatter given by mimetype form key.
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
261 Since 5.5.2006 this functionality is also done by do_show, but do_format
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
262 has a default of text/plain when no format is given.
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
263 It also does not count in statistics and also does not set the cacheable flag.
656
ad2ac49d17fe use only action=show with mimetype instead of deprecated format action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 636
diff changeset
264 DEPRECATED: remove this action when we don't need it any more for compatibility.
620
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
265 """
1868
64507f46beb2 reduce usage of has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1816
diff changeset
266 if 'mimetype' not in request.form:
620
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
267 request.form['mimetype'] = [u"text/plain"]
cb7deb83447c introduce mimetype arg for show action, keep format action as compat. stub
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 619
diff changeset
268 do_show(pagename, request, count_hit=0, cacheable=0)
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
269
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
270 def do_content(pagename, request):
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
271 """ same as do_show, but we only show the content """
2714
eb37036e3350 temporary fix missing http headers for action=content
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2294
diff changeset
272 # XXX temporary fix to make it work until Page.send_page gets refactored
4183
fc20a076aad0 Accomodate for consolidation of Request/Response
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4176
diff changeset
273 request.mimetype = 'text/html'
fc20a076aad0 Accomodate for consolidation of Request/Response
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4176
diff changeset
274 request.status_code = 200
1875
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
275 do_show(pagename, request, count_hit=0, content_only=1)
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
276
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
277 def do_print(pagename, request):
1875
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
278 """ same as do_show, but with print_mode set """
5afb427026ea refactor print_mode, fix/simplify content action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
279 do_show(pagename, request, print_mode=1)
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
280
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
281 def do_recall(pagename, request):
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
282 """ same as do_show, but never caches and never counts hits """
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
283 do_show(pagename, request, count_hit=0, cacheable=0)
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
284
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
285 def do_refresh(pagename, request):
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
286 """ Handle refresh action """
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
287 # Without arguments, refresh action will refresh the page text_html cache.
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
288 arena = request.form.get('arena', ['Page.py'])[0]
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
289 if arena == 'Page.py':
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
290 arena = Page(request, pagename)
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
291 key = request.form.get('key', ['text_html'])[0]
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
292
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
293 # Remove cache entry (if exists), and send the page
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
294 from MoinMoin import caching
682
1314fdb74689 refactor CacheEntry usage to use scope param
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 662
diff changeset
295 caching.CacheEntry(request, arena, key, scope='item').remove()
1314fdb74689 refactor CacheEntry usage to use scope param
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 662
diff changeset
296 caching.CacheEntry(request, arena, "pagelinks", scope='item').remove()
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
297 do_show(pagename, request)
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
298
615
fb4240ec8361 make goto an action (1 special case less)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 554
diff changeset
299 def do_goto(pagename, request):
fb4240ec8361 make goto an action (1 special case less)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 554
diff changeset
300 """ redirect to another page """
fb4240ec8361 make goto an action (1 special case less)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 554
diff changeset
301 target = request.form.get('target', [''])[0]
3234
a739558ca3dc Page.url() default changed to relative=False
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3040
diff changeset
302 request.http_redirect(Page(request, target).url(request))
615
fb4240ec8361 make goto an action (1 special case less)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 554
diff changeset
303
1110
b27d720fbc8e actions: cleanup, fix imports
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1109
diff changeset
304 # Dispatching ----------------------------------------------------------------
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
305 def get_names(config):
4141
049b9aaf3031 Whitespace fixes and extended logging of calls
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4139
diff changeset
306 """ Get a list of known actions.
049b9aaf3031 Whitespace fixes and extended logging of calls
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4139
diff changeset
307
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
308 @param config: a config object
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
309 @rtype: set
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
310 @return: set of known actions
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
311 """
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
312 if not hasattr(config.cache, 'action_names'):
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
313 actions = names[:]
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
314 actions.extend(wikiutil.getPlugins('action', config))
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
315 actions = set(action for action in actions
4139
e3893c082fe5 Oops, some fixes. Was already wondering why i got no output.
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4135
diff changeset
316 if not action in config.actions_excluded)
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
317 config.cache.action_names = actions # remember it
4139
e3893c082fe5 Oops, some fixes. Was already wondering why i got no output.
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4135
diff changeset
318 return config.cache.action_names
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
319
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
320 def getHandler(request, action, identifier="execute"):
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
321 """ return a handler function for a given action or None.
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
322
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
323 TODO: remove request dependency
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
324 """
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
325 # check for excluded actions
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
326 if action in request.cfg.actions_excluded:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
327 return None
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
328
51
54d5932d5a03 merge moin--main--1.3--patch-930: fix error handling in plugins, fix broken chart action
Nir Soffer <nirs@freeshell.org>
parents: 40
diff changeset
329 try:
619
0bb6b767baec wikiaction: reordered functions, added some comments - only minor changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 618
diff changeset
330 handler = wikiutil.importPlugin(request.cfg, "action", action, identifier)
53
699811601bed merge moin--main--1.3--patch-934,935: detect correctly missing plguins and missing names in plugins
Nir Soffer <nirs@freeshell.org>
parents: 51
diff changeset
331 except wikiutil.PluginMissingError:
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
332 handler = globals().get('do_' + action)
912
2f3395d42f93 some minor fixes, whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 869
diff changeset
333
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
334 return handler
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
335
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
336 def get_available_actions(config, page, user):
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
337 """ Get a list of actions available on a particular page
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
338 for a particular user.
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
339
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
340 The set does not contain actions that starts with lower case.
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
341 Themes use this set to display the actions to the user.
4141
049b9aaf3031 Whitespace fixes and extended logging of calls
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4139
diff changeset
342
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
343 @param config: a config object (for the per-wiki actions)
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
344 @param page: the page to which the actions should apply
4141
049b9aaf3031 Whitespace fixes and extended logging of calls
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 4139
diff changeset
345 @param user: the user which wants to apply an action
4135
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
346 @rtype: set
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
347 @return: set of avaiable actions
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
348 """
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
349 if not user.may.read(page.page_name):
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
350 return []
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
351
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
352
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
353 actions = get_names(config)
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
354
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
355 # Filter non ui actions (starts with lower case letter)
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
356 actions = [action for action in actions if not action[0].islower()]
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
357
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
358 # Filter actions by page type, acl and user state
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
359 excluded = []
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
360 if (page.isUnderlayPage() and not page.isStandardPage()) or \
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
361 not user.may.write(page.page_name) or \
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
362 not user.may.delete(page.page_name):
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
363 # Prevent modification of underlay only pages, or pages
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
364 # the user can't write and can't delete
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
365 excluded = [u'RenamePage', u'DeletePage', ] # AttachFile must NOT be here!
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
366
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
367 return set(action for action in actions if not action in excluded)
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
368
0fd8fd9979f8 Removed code for available actions from RequestBase
Florian Krupicka <florian.krupicka@googlemail.com>
parents: 3358
diff changeset
369