Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/buildbot/buildbot/test/mail/freshcvs.3
blob: f9ff199af0bc31370ed22dc1fb500d53eac0fa18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Return-Path: <twisted-commits-admin@twistedmatrix.com>
Delivered-To: warner-twistedcvs@luther.lothar.com
Received: (qmail 32220 invoked by uid 1000); 14 Jan 2003 21:50:04 -0000
Delivered-To: warner-twistedcvs@lothar.com
Received: (qmail 7923 invoked by uid 13574); 14 Jan 2003 21:49:48 -0000
Received: from unknown (HELO pyramid.twistedmatrix.com) ([64.123.27.105]) (envelope-sender <twisted-commits-admin@twistedmatrix.com>)
          by 130.94.181.6 (qmail-ldap-1.03) with SMTP
          for <warner-twistedcvs@lothar.com>; 14 Jan 2003 21:49:48 -0000
Received: from localhost ([127.0.0.1] helo=pyramid.twistedmatrix.com)
	by pyramid.twistedmatrix.com with esmtp (Exim 3.35 #1 (Debian))
	id 18YYr0-0005en-00; Tue, 14 Jan 2003 15:44:14 -0600
Received: from acapnotic by pyramid.twistedmatrix.com with local (Exim 3.35 #1 (Debian))
	id 18YYq7-0005eQ-00
	for <twisted-commits@twistedmatrix.com>; Tue, 14 Jan 2003 15:43:19 -0600
To: twisted-commits@twistedmatrix.com
From: itamarst CVS <itamarst@twistedmatrix.com>
Reply-To: twisted-python@twistedmatrix.com
X-Mailer: CVSToys
From: itamarst CVS <itamarst@twistedmatrix.com>
Reply-To: twisted-python@twistedmatrix.com
Message-Id: <E18YYq7-0005eQ-00@pyramid.twistedmatrix.com>
Subject: [Twisted-commits] submit formmethod now subclass of Choice
Sender: twisted-commits-admin@twistedmatrix.com
Errors-To: twisted-commits-admin@twistedmatrix.com
X-BeenThere: twisted-commits@twistedmatrix.com
X-Mailman-Version: 2.0.11
Precedence: bulk
List-Help: <mailto:twisted-commits-request@twistedmatrix.com?subject=help>
List-Post: <mailto:twisted-commits@twistedmatrix.com>
List-Subscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commits>,
	<mailto:twisted-commits-request@twistedmatrix.com?subject=subscribe>
List-Id: <twisted-commits.twistedmatrix.com>
List-Unsubscribe: <http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commits>,
	<mailto:twisted-commits-request@twistedmatrix.com?subject=unsubscribe>
List-Archive: <http://twistedmatrix.com/pipermail/twisted-commits/>
Date: Tue, 14 Jan 2003 15:43:19 -0600
Status:   

Modified files:
Twisted/twisted/web/woven/form.py 1.20 1.21
Twisted/twisted/python/formmethod.py 1.12 1.13

Log message:
submit formmethod now subclass of Choice


Index: Twisted/twisted/web/woven/form.py
diff -u Twisted/twisted/web/woven/form.py:1.20 Twisted/twisted/web/woven/form.py:1.21
--- Twisted/twisted/web/woven/form.py:1.20	Tue Jan 14 12:07:29 2003
+++ Twisted/twisted/web/woven/form.py	Tue Jan 14 13:43:16 2003
@@ -140,8 +140,8 @@
 
     def input_submit(self, request, content, arg):
         div = content.div()
-        for value in arg.buttons:
-            div.input(type="submit", name=arg.name, value=value)
+        for tag, value, desc in arg.choices:
+            div.input(type="submit", name=arg.name, value=tag)
             div.text(" ")
         if arg.reset:
             div.input(type="reset")

Index: Twisted/twisted/python/formmethod.py
diff -u Twisted/twisted/python/formmethod.py:1.12 Twisted/twisted/python/formmethod.py:1.13
--- Twisted/twisted/python/formmethod.py:1.12	Tue Jan 14 12:07:30 2003
+++ Twisted/twisted/python/formmethod.py	Tue Jan 14 13:43:17 2003
@@ -180,19 +180,13 @@
         return 1
 
 
-class Submit(Argument):
+class Submit(Choice):
     """Submit button or a reasonable facsimile thereof."""
 
-    def __init__(self, name, buttons=["Submit"], reset=0, shortDesc=None, longDesc=None):
-        Argument.__init__(self, name, shortDesc=shortDesc, longDesc=longDesc)
-        self.buttons = buttons
+    def __init__(self, name, choices=[("Submit", "submit", "Submit form")],
+                 reset=0, shortDesc=None, longDesc=None):
+        Choice.__init__(self, name, choices=choices, shortDesc=shortDesc, longDesc=longDesc)
         self.reset = reset
-
-    def coerce(self, val):
-        if val in self.buttons:
-            return val
-        else:
-            raise InputError, "no such action"
 
 
 class PresentationHint:

.

_______________________________________________
Twisted-commits mailing list
Twisted-commits@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-commits