Last change
on this file since 927 was 799, checked in by slederer, on Oct 15, 2009 at 6:37:56 PM |
Änderungen am Parser, so dass er funktioniert
|
-
Property svn:keywords
set to
Id
-
Property svn:mime-type
set to
text/x-python
|
File size:
1.0 KB
|
Line | |
---|
1 | '''
|
---|
2 | Directive Objects
|
---|
3 |
|
---|
4 | Created on 30.06.2009
|
---|
5 |
|
---|
6 | @author: hmueller
|
---|
7 | '''
|
---|
8 |
|
---|
9 | from resource import Resource
|
---|
10 |
|
---|
11 | PrettyNames = {}
|
---|
12 |
|
---|
13 | #
|
---|
14 | # Type definitions
|
---|
15 | #
|
---|
16 | class Path(str):
|
---|
17 | pass
|
---|
18 |
|
---|
19 | class Time(str):
|
---|
20 | pass
|
---|
21 |
|
---|
22 | class Acl(str):
|
---|
23 | pass
|
---|
24 |
|
---|
25 | class Password(str):
|
---|
26 | pass
|
---|
27 |
|
---|
28 | class Res(str):
|
---|
29 | pass
|
---|
30 | #
|
---|
31 | # The Resource Item
|
---|
32 | #
|
---|
33 |
|
---|
34 | class Item(Resource):
|
---|
35 | def __init__(self, name, default=None, type=None, required=False):
|
---|
36 | self.name = name
|
---|
37 | self.default = default
|
---|
38 | if default:
|
---|
39 | self.value = default
|
---|
40 | else:
|
---|
41 | self.value = None
|
---|
42 | self.type = type
|
---|
43 | self.required = required
|
---|
44 |
|
---|
45 | def __repr__(self):
|
---|
46 | return "Item(%s, %s, %s, %s)" % (self.name,
|
---|
47 | str(self.default),
|
---|
48 | str(self.type),
|
---|
49 | self.required)
|
---|
50 |
|
---|
51 | def __lt__(self, other):
|
---|
52 | return self.name < other.name
|
---|
53 |
|
---|
54 | def prettyName(self):
|
---|
55 | return PrettyNames.get(self.name, self.name)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.