root/livinglogic.python.xist/src/ll/xist/ns/form.py @ 2520:b322c0ceba5d

Revision 2520:b322c0ceba5d, 1.8 KB (checked in by Walter Doerwald <walter@…>, 14 years ago)

Moved source files into src directory (to avoid import problems when
importing from the directory where setup.py is in).

Line 
1#! /usr/bin/env python
2# -*- coding: iso-8859-1 -*-
3
4## Copyright 1999-2006 by LivingLogic AG, Bayreuth/Germany.
5## Copyright 1999-2006 by Walter Dörwald
6##
7## All Rights Reserved
8##
9## See xist/__init__.py for the license
10
11"""
12<par>An &xist; module that contains elements that are useful for
13forms. These are just abbreviations for the various
14<lit>&lt;input type=<rep>...</rep>&gt;</lit> elements.</par>
15"""
16
17__version__ = "$Revision$".split()[1]
18# $Source$
19
20from ll.xist import xsc
21from ll.xist.ns import html
22
23
24class checkbox(html.input):
25    class Attrs(html.input.Attrs):
26        type = None
27
28    def convert(self, converter):
29        e = html.input(self.attrs, type=u"checkbox")
30        return e.convert(converter)
31
32
33class edit(html.input):
34    class Attrs(html.input.Attrs):
35        type = None
36
37    def convert(self, converter):
38        e = html.input(self.attrs, type=u"text")
39        return e.convert(converter)
40
41
42class radio(html.input):
43    class Attrs(html.input.Attrs):
44        type = None
45
46    def convert(self, converter):
47        e = html.input(self.attrs, type=u"radio")
48        return e.convert(converter)
49
50
51class submit(html.input):
52    class Attrs(html.input.Attrs):
53        type = None
54
55    def convert(self, converter):
56        e = html.input(self.attrs, type=u"submit")
57        return e.convert(converter)
58
59
60class memo(html.textarea):
61    class Attrs(html.textarea.Attrs):
62        class value(xsc.TextAttr): pass
63
64    def convert(self, converter):
65        e = html.textarea(self[u"value"], self.attrs.without([u"value"]))
66        return e.convert(converter)
67
68
69class hidden(html.input):
70    class Attrs(html.input.Attrs):
71        type = None
72
73    def __unicode__(self):
74        return u""
75
76    def convert(self, converter):
77        e = html.input(self.attrs, type=u"hidden")
78        return e.convert(converter)
79
80
81class __ns__(xsc.Namespace):
82    xmlname = "form"
83    xmlurl = "http://xmlns.livinglogic.de/xist/ns/form"
84__ns__.makemod(vars())
Note: See TracBrowser for help on using the browser.