~ubuntu-branches/ubuntu/wily/prewikka/wily

« back to all changes in this revision

Viewing changes to prewikka/templates/utils.py

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2010-03-18 17:34:33 UTC
  • mfrom: (1.1.11 upstream) (8.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100318173433-2dyo1uo0r570y4i9
Tags: 1.0.0-1
New upstream release 1.0.0

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