Skip to content

Commit 3246222

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent 25a5cb8 commit 3246222

File tree

3 files changed

+30
-23
lines changed

3 files changed

+30
-23
lines changed

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ Feature:
3434
Use this to specify server configuration file for the service.
3535
- added experimental multi-thread server
3636
- don't try to import all backends in backends.__init__ unless we *want* to
37-
- TAL expressions like 'request/show/whatever' return True
38-
if the request does not contain explicit @columns list
3937

4038
Fixed:
4139
- postgres backend open doesn't hide corruption in schema (sf bug 956375)
@@ -55,6 +53,8 @@ Fixed:
5553
- enforce View Permission when serving file content (sf bug 1050470)
5654
- don't index common words (sf bug 1046612)
5755
- don't wrap query.item.html in a <span> (thanks Roch'e Compaan)
56+
- TAL expressions like 'request/show/whatever' return True
57+
if the request does not contain explicit @columns list
5858
- NumberHTMLProperty should return '' not "None" if not set (thanks
5959
William)
6060
- ensure multilink ordering in RDBMS backends (thanks Marcus Priesch, sf

doc/whatsnew-0.8.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ To write extension code for Roundup you place a file in the tracker home
2828
information about how this is done.
2929

3030

31+
XXX Client.actions is now a dictionary.
32+
3133
Added support for HTTP charset selection
3234
========================================
3335

roundup/cgi/client.py

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.197 2004-11-08 23:29:45 richard Exp $
1+
# $Id: client.py,v 1.198 2004-11-11 21:10:05 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -641,26 +641,26 @@ def renderContext(self):
641641
return cgitb.pt_html(i18n=self.translator)
642642

643643
# these are the actions that are available
644-
actions = (
645-
('edit', EditItemAction),
646-
('editcsv', EditCSVAction),
647-
('new', NewItemAction),
648-
('register', RegisterAction),
649-
('confrego', ConfRegoAction),
650-
('passrst', PassResetAction),
651-
('login', LoginAction),
652-
('logout', LogoutAction),
653-
('search', SearchAction),
654-
('retire', RetireAction),
655-
('show', ShowAction),
656-
('export_csv', ExportCSVAction),
657-
)
644+
actions = {
645+
'edit': EditItemAction,
646+
'editcsv': EditCSVAction,
647+
'new': NewItemAction,
648+
'register': RegisterAction,
649+
'confrego': ConfRegoAction,
650+
'passrst': PassResetAction,
651+
'login': LoginAction,
652+
'logout': LogoutAction,
653+
'search': SearchAction,
654+
'retire': RetireAction,
655+
'show': ShowAction,
656+
'export_csv': ExportCSVAction,
657+
}
658658
def handle_action(self):
659659
''' Determine whether there should be an Action called.
660660
661661
The action is defined by the form variable :action which
662662
identifies the method on this object to call. The actions
663-
are defined in the "actions" sequence on this class.
663+
are defined in the "actions" dictionary on this class.
664664
665665
Actions may return a page (by default HTML) to return to the
666666
user, bypassing the usual template rendering.
@@ -678,12 +678,17 @@ def handle_action(self):
678678
# tracker-defined action
679679
action_klass = self.instance.cgi_actions[action]
680680
else:
681-
# go with a default
682-
for name, action_klass in self.actions:
683-
if name == action:
684-
break
681+
if isinstance(self.actions, type({})):
682+
if not self.actions.has_key(action):
683+
raise ValueError, 'No such action "%s"'%action
684+
action_class = self.actions[action]
685685
else:
686-
raise ValueError, 'No such action "%s"'%action
686+
# backwards-compatible sequence
687+
for name, action_klass in self.actions:
688+
if name == action:
689+
break
690+
else:
691+
raise ValueError, 'No such action "%s"'%action
687692

688693
# call the mapped action
689694
if isinstance(action_klass, type('')):

0 commit comments

Comments
 (0)