~ubuntu-branches/ubuntu/utopic/prewikka/utopic

« back to all changes in this revision

Viewing changes to prewikka/templates/utils.py

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2009-12-31 02:18:56 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091231021856-fkctle2rfpw0z8ei
Tags: 0.9.17.1-1ubuntu1
Append --prefix=/usr to setup.py install to install all modules into
the right path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
import sys
9
9
import os
10
10
import os.path
11
 
import __builtin__
12
11
from os.path import getmtime, exists
13
12
import time
14
13
import types
 
14
import __builtin__
15
15
from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion
16
16
from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple
17
17
from Cheetah.Template import Template
18
 
from Cheetah.DummyTransaction import *
 
18
from Cheetah.DummyTransaction import DummyTransaction
19
19
from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList
20
20
from Cheetah.CacheRegion import CacheRegion
21
21
import Cheetah.Filters as Filters
23
23
 
24
24
##################################################
25
25
## MODULE CONSTANTS
 
26
try:
 
27
    True, False
 
28
except NameError:
 
29
    True, False = (1==1), (1==0)
26
30
VFFSL=valueFromFrameOrSearchList
27
31
VFSL=valueFromSearchList
28
32
VFN=valueForName
29
33
currentTime=time.time
30
 
__CHEETAH_version__ = '2.2.1'
31
 
__CHEETAH_versionTuple__ = (2, 2, 1, 'final', 0)
32
 
__CHEETAH_genTime__ = 1244715457.5700941
33
 
__CHEETAH_genTimestamp__ = 'Thu Jun 11 12:17:37 2009'
 
34
__CHEETAH_version__ = '2.0.1'
 
35
__CHEETAH_versionTuple__ = (2, 0, 1, 'final', 0)
 
36
__CHEETAH_genTime__ = 1252401817.976423
 
37
__CHEETAH_genTimestamp__ = 'Tue Sep  8 11:23:37 2009'
34
38
__CHEETAH_src__ = 'prewikka/templates/utils.tmpl'
35
39
__CHEETAH_srcLastModified__ = 'Wed Jun 10 12:51:41 2009'
36
 
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
 
40
__CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine'
37
41
 
38
42
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
39
43
    raise AssertionError(
52
56
 
53
57
    def __init__(self, *args, **KWs):
54
58
 
55
 
        super(utils, self).__init__(*args, **KWs)
 
59
        Template.__init__(self, *args, **KWs)
56
60
        if not self._CHEETAH__instanceInitialized:
57
61
            cheetahKWArgs = {}
58
62
            allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split()
80
84
        ########################################
81
85
        ## START - generated method body
82
86
        
83
 
        write(u'''  <table>
 
87
        write('''  <table>
84
88
    <thead>
85
89
      <tr>
86
90
        <td>Name</td>
96
100
        <td>''')
97
101
        _v = VFFSL(SL,"analyzer.name",True) or "n/a"
98
102
        if _v is not None: write(_filter(_v))
99
 
        write(u'''</td>
 
103
        write('''</td>
100
104
        <td>
101
105
''')
102
106
        if VFFSL(SL,"analyzer.model",True): # generated from line 17, col 11
103
 
            write(u'''            ''')
104
 
            _v = VFFSL(SL,"analyzer.model",True) # u'$analyzer.model' on line 18, col 13
105
 
            if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.model')) # from line 18, col 13.
106
 
            write(u'''
 
107
            write('''            ''')
 
108
            _v = VFFSL(SL,"analyzer.model",True) # '$analyzer.model' on line 18, col 13
 
109
            if _v is not None: write(_filter(_v, rawExpr='$analyzer.model')) # from line 18, col 13.
 
110
            write('''
107
111
''')
108
112
            if VFFSL(SL,"analyzer.version",True): # generated from line 19, col 13
109
 
                write(u'''              ''')
110
 
                _v = VFFSL(SL,"analyzer.version",True) # u'$analyzer.version' on line 20, col 15
111
 
                if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.version')) # from line 20, col 15.
112
 
                write(u'''
 
113
                write('''              ''')
 
114
                _v = VFFSL(SL,"analyzer.version",True) # '$analyzer.version' on line 20, col 15
 
115
                if _v is not None: write(_filter(_v, rawExpr='$analyzer.version')) # from line 20, col 15.
 
116
                write('''
113
117
''')
114
118
        else: # generated from line 22, col 11
115
 
            write(u'''            n/a
 
119
            write('''            n/a
116
120
''')
117
 
        write(u'''        </td>
 
121
        write('''        </td>
118
122
        <td>
119
123
''')
120
124
        if VFFSL(SL,"analyzer.ostype",True): # generated from line 27, col 11
121
 
            write(u'''            ''')
122
 
            _v = VFFSL(SL,"analyzer.ostype",True) # u'$analyzer.ostype' on line 28, col 13
123
 
            if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.ostype')) # from line 28, col 13.
124
 
            write(u'''
 
125
            write('''            ''')
 
126
            _v = VFFSL(SL,"analyzer.ostype",True) # '$analyzer.ostype' on line 28, col 13
 
127
            if _v is not None: write(_filter(_v, rawExpr='$analyzer.ostype')) # from line 28, col 13.
 
128
            write('''
125
129
''')
126
130
            if VFFSL(SL,"analyzer.osversion",True): # generated from line 29, col 13
127
 
                write(u'''              ''')
128
 
                _v = VFFSL(SL,"analyzer.osversion",True) # u'$analyzer.osversion' on line 30, col 15
129
 
                if _v is not None: write(_filter(_v, rawExpr=u'$analyzer.osversion')) # from line 30, col 15.
130
 
                write(u'''
 
131
                write('''              ''')
 
132
                _v = VFFSL(SL,"analyzer.osversion",True) # '$analyzer.osversion' on line 30, col 15
 
133
                if _v is not None: write(_filter(_v, rawExpr='$analyzer.osversion')) # from line 30, col 15.
 
134
                write('''
131
135
''')
132
136
        else: # generated from line 32, col 11
133
 
            write(u'''            n/a
 
137
            write('''            n/a
134
138
''')
135
 
        write(u'''        </td>
 
139
        write('''        </td>
136
140
        <td>''')
137
141
        _v = VFFSL(SL,"analyzer.node_name",True) or "n/a"
138
142
        if _v is not None: write(_filter(_v))
139
 
        write(u'''</td>
 
143
        write('''</td>
140
144
        <td>''')
141
145
        _v = VFFSL(SL,"analyzer.node_location",True) or "n/a"
142
146
        if _v is not None: write(_filter(_v))
143
 
        write(u'''</td>
 
147
        write('''</td>
144
148
        <td>
145
149
''')
146
150
        if len(VFFSL(SL,"analyzer.node_addresses",True)) > 0: # generated from line 39, col 11
147
151
            for address in VFFSL(SL,"analyzer.node_addresses",True): # generated from line 40, col 13
148
 
                write(u'''              ''')
149
 
                _v = VFFSL(SL,"address",True) # u'$address' on line 41, col 15
150
 
                if _v is not None: write(_filter(_v, rawExpr=u'$address')) # from line 41, col 15.
151
 
                write(u'''<br/>
 
152
                write('''              ''')
 
153
                _v = VFFSL(SL,"address",True) # '$address' on line 41, col 15
 
154
                if _v is not None: write(_filter(_v, rawExpr='$address')) # from line 41, col 15.
 
155
                write('''<br/>
152
156
''')
153
157
        else: # generated from line 43, col 11
154
 
            write(u'''            n/a
 
158
            write('''            n/a
155
159
''')
156
 
        write(u'''        </td>
 
160
        write('''        </td>
157
161
      </tr>
158
162
    </tbody>
159
163
  </table>