OLD | NEW |
| (Empty) |
1 Return-Path: <twisted-commits-admin@twistedmatrix.com> | |
2 Delivered-To: warner-twistedcvs@luther.lothar.com | |
3 Received: (qmail 32220 invoked by uid 1000); 14 Jan 2003 21:50:04 -0000 | |
4 Delivered-To: warner-twistedcvs@lothar.com | |
5 Received: (qmail 7923 invoked by uid 13574); 14 Jan 2003 21:49:48 -0000 | |
6 Received: from unknown (HELO pyramid.twistedmatrix.com) ([64.123.27.105]) (envel
ope-sender <twisted-commits-admin@twistedmatrix.com>) | |
7 by 130.94.181.6 (qmail-ldap-1.03) with SMTP | |
8 for <warner-twistedcvs@lothar.com>; 14 Jan 2003 21:49:48 -0000 | |
9 Received: from localhost ([127.0.0.1] helo=pyramid.twistedmatrix.com) | |
10 by pyramid.twistedmatrix.com with esmtp (Exim 3.35 #1 (Debian)) | |
11 id 18YYr0-0005en-00; Tue, 14 Jan 2003 15:44:14 -0600 | |
12 Received: from acapnotic by pyramid.twistedmatrix.com with local (Exim 3.35 #1 (
Debian)) | |
13 id 18YYq7-0005eQ-00 | |
14 for <twisted-commits@twistedmatrix.com>; Tue, 14 Jan 2003 15:43:19 -0600 | |
15 To: twisted-commits@twistedmatrix.com | |
16 From: itamarst CVS <itamarst@twistedmatrix.com> | |
17 Reply-To: twisted-python@twistedmatrix.com | |
18 X-Mailer: CVSToys | |
19 From: itamarst CVS <itamarst@twistedmatrix.com> | |
20 Reply-To: twisted-python@twistedmatrix.com | |
21 Message-Id: <E18YYq7-0005eQ-00@pyramid.twistedmatrix.com> | |
22 Subject: [Twisted-commits] submit formmethod now subclass of Choice | |
23 Sender: twisted-commits-admin@twistedmatrix.com | |
24 Errors-To: twisted-commits-admin@twistedmatrix.com | |
25 X-BeenThere: twisted-commits@twistedmatrix.com | |
26 X-Mailman-Version: 2.0.11 | |
27 Precedence: bulk | |
28 List-Help: <mailto:twisted-commits-request@twistedmatrix.com?subject=help> | |
29 List-Post: <mailto:twisted-commits@twistedmatrix.com> | |
30 List-Subscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commi
ts>, | |
31 <mailto:twisted-commits-request@twistedmatrix.com?subject=subscribe> | |
32 List-Id: <twisted-commits.twistedmatrix.com> | |
33 List-Unsubscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-com
mits>, | |
34 <mailto:twisted-commits-request@twistedmatrix.com?subject=unsubscribe> | |
35 List-Archive: <http://twistedmatrix.com/pipermail/twisted-commits/> | |
36 Date: Tue, 14 Jan 2003 15:43:19 -0600 | |
37 Status: | |
38 | |
39 Modified files: | |
40 Twisted/twisted/web/woven/form.py 1.20 1.21 | |
41 Twisted/twisted/python/formmethod.py 1.12 1.13 | |
42 | |
43 Log message: | |
44 submit formmethod now subclass of Choice | |
45 | |
46 | |
47 ViewCVS links: | |
48 http://twistedmatrix.com/users/jh.twistd/viewcvs/cgi/viewcvs.cgi/twisted/web/wov
en/form.py.diff?r1=text&tr1=1.20&r2=text&tr2=1.21&cvsroot=Twisted | |
49 http://twistedmatrix.com/users/jh.twistd/viewcvs/cgi/viewcvs.cgi/twisted/python/
formmethod.py.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&cvsroot=Twisted | |
50 | |
51 Index: Twisted/twisted/web/woven/form.py | |
52 diff -u Twisted/twisted/web/woven/form.py:1.20 Twisted/twisted/web/woven/form.py
:1.21 | |
53 --- Twisted/twisted/web/woven/form.py:1.20 Tue Jan 14 12:07:29 2003 | |
54 +++ Twisted/twisted/web/woven/form.py Tue Jan 14 13:43:16 2003 | |
55 @@ -140,8 +140,8 @@ | |
56 | |
57 def input_submit(self, request, content, arg): | |
58 div = content.div() | |
59 - for value in arg.buttons: | |
60 - div.input(type="submit", name=arg.name, value=value) | |
61 + for tag, value, desc in arg.choices: | |
62 + div.input(type="submit", name=arg.name, value=tag) | |
63 div.text(" ") | |
64 if arg.reset: | |
65 div.input(type="reset") | |
66 | |
67 Index: Twisted/twisted/python/formmethod.py | |
68 diff -u Twisted/twisted/python/formmethod.py:1.12 Twisted/twisted/python/formmet
hod.py:1.13 | |
69 --- Twisted/twisted/python/formmethod.py:1.12 Tue Jan 14 12:07:30 2003 | |
70 +++ Twisted/twisted/python/formmethod.py Tue Jan 14 13:43:17 2003 | |
71 @@ -180,19 +180,13 @@ | |
72 return 1 | |
73 | |
74 | |
75 -class Submit(Argument): | |
76 +class Submit(Choice): | |
77 """Submit button or a reasonable facsimile thereof.""" | |
78 | |
79 - def __init__(self, name, buttons=["Submit"], reset=0, shortDesc=None, longD
esc=None): | |
80 - Argument.__init__(self, name, shortDesc=shortDesc, longDesc=longDesc) | |
81 - self.buttons = buttons | |
82 + def __init__(self, name, choices=[("Submit", "submit", "Submit form")], | |
83 + reset=0, shortDesc=None, longDesc=None): | |
84 + Choice.__init__(self, name, choices=choices, shortDesc=shortDesc, longD
esc=longDesc) | |
85 self.reset = reset | |
86 - | |
87 - def coerce(self, val): | |
88 - if val in self.buttons: | |
89 - return val | |
90 - else: | |
91 - raise InputError, "no such action" | |
92 | |
93 | |
94 class PresentationHint: | |
95 | |
96 . | |
97 | |
98 _______________________________________________ | |
99 Twisted-commits mailing list | |
100 Twisted-commits@twistedmatrix.com | |
101 http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commits | |
OLD | NEW |