19
19
20
20
21
21
class Form (Element ):
22
-
23
22
"""An HTML <form> element.
24
23
25
24
>>> form = Form("POST", "/feedback")
@@ -60,7 +59,6 @@ def multipart(self, multipart):
60
59
61
60
62
61
class Input (VoidElement ):
63
-
64
62
"""An HTML <input> element.
65
63
66
64
>>> input_ = Input("text", "description")
@@ -97,7 +95,6 @@ def __init__(self, type_="text", name=""):
97
95
98
96
99
97
class TextInput (Input ):
100
-
101
98
"""An HTML text input (<input type="text">) element.
102
99
103
100
>>> input_ = TextInput("description")
@@ -121,7 +118,6 @@ def __init__(self, name="", value=""):
121
118
122
119
123
120
class SearchInput (Input ):
124
-
125
121
"""An HTML search (<input type="search">) element."""
126
122
127
123
def __init__ (self , name = "" ):
@@ -135,7 +131,6 @@ def __init__(self, name=""):
135
131
136
132
137
133
class PasswordInput (Input ):
138
-
139
134
"""An HTML password input (<input type="password">) element."""
140
135
141
136
def __init__ (self , name = "" ):
@@ -149,7 +144,6 @@ def __init__(self, name=""):
149
144
150
145
151
146
class NumberInput (Input ):
152
-
153
147
"""An HTML number input (<input type="number">) element."""
154
148
155
149
def __init__ (self , name = "" , number = None ):
@@ -173,7 +167,6 @@ def __init__(self, name="", number=None):
173
167
174
168
175
169
class DateInput (Input ):
176
-
177
170
"""An HTML date input (<input type="date">) element."""
178
171
179
172
def __init__ (self , name = "" , date = None ):
@@ -215,7 +208,6 @@ def _parse_date(v):
215
208
216
209
217
210
class TimeInput (Input ):
218
-
219
211
"""An HTML time input (<input type="time">) element."""
220
212
221
213
def __init__ (self , name = "" , time = None ):
@@ -296,7 +288,6 @@ def __init__(self, type_, name, value):
296
288
297
289
298
290
class Checkbox (_CheckableInput ):
299
-
300
291
"""An HTML checkbox (<input type="checkbox">) element.
301
292
302
293
>>> cb = Checkbox("my-name", "my-value")
@@ -309,7 +300,6 @@ def __init__(self, name="", value=""):
309
300
310
301
311
302
class RadioButton (_CheckableInput ):
312
-
313
303
"""An HTML radio button (<input type="radio">) element.
314
304
315
305
>>> cb = RadioButton("my-name", "my-value")
@@ -322,7 +312,6 @@ def __init__(self, name="", value=""):
322
312
323
313
324
314
class FileInput (Input ):
325
-
326
315
"""An HTML file input (<input type="file">) element."""
327
316
328
317
def __init__ (self , name = "" ):
@@ -333,7 +322,6 @@ def __init__(self, name=""):
333
322
334
323
335
324
class HiddenInput (Input ):
336
-
337
325
"""A hidden HTML input (<input type="hidden"/>) element."""
338
326
339
327
def __init__ (self , name , value ):
@@ -342,7 +330,6 @@ def __init__(self, name, value):
342
330
343
331
344
332
class SubmitButton (Input ):
345
-
346
333
"""An HTML form submit button (<input type="submit">) element.
347
334
348
335
>>> button = SubmitButton("My Label")
@@ -370,7 +357,6 @@ def label(self, label):
370
357
371
358
372
359
class Button (Element ):
373
-
374
360
"""An HTML <button> element.
375
361
376
362
>>> button = Button("My Label")
@@ -381,9 +367,10 @@ def __init__(self, *content):
381
367
super (Button , self ).__init__ ("button" )
382
368
self .extend (content )
383
369
370
+ disabled = boolean_html_attribute ("disabled" )
371
+
384
372
385
373
class TextArea (Element ):
386
-
387
374
"""An HTML <textarea> element.
388
375
389
376
>>> area = TextArea("element-name")
@@ -405,7 +392,6 @@ def __init__(self, name=""):
405
392
406
393
407
394
class Select (Element ):
408
-
409
395
"""An HTML selection list (<select>) element.
410
396
411
397
>>> select = Select("element-name")
@@ -513,10 +499,7 @@ def selected_value(self, selected_value):
513
499
514
500
515
501
class OptionGroup (Element ):
516
-
517
- """An HTML selection list option group (<optgroup>) element.
518
-
519
- """
502
+ """An HTML selection list option group (<optgroup>) element."""
520
503
521
504
def __init__ (self , label ):
522
505
super (OptionGroup , self ).__init__ ("optgroup" )
@@ -533,7 +516,6 @@ def create_option(self, label, value=None):
533
516
534
517
535
518
class Option (Element ):
536
-
537
519
"""An HTML selection list option (<option>) element.
538
520
539
521
>>> option = Option("Label")
@@ -579,7 +561,6 @@ def value(self, value):
579
561
580
562
581
563
class Label (Element ):
582
-
583
564
"""An HTML label (<label>) element.
584
565
585
566
>>> str(Label(Checkbox(), " My Label"))
0 commit comments