Changeset 14137
- Timestamp:
- 03/15/12 18:37:21 (12 years ago)
- Location:
- trunk/sara_cmt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sara_cmt/cmt.py
r14126 r14137 311 311 logger.error('Template does not exist: %s' % e) 312 312 313 314 context['__template_outputfiles__'][context['output']]=rendered_string # temporary to be fwd-compatible315 316 313 for outputfile, content in context['__template_outputfiles__'].items(): 317 314 write_msg = 'Writing outputfile: %s' % outputfile -
trunk/sara_cmt/sara_cmt/cluster/templatetags/cmts_extras.py
r14136 r14137 166 166 {% store variable %} # variable = '/path/to/file' 167 167 """ 168 try: 169 # RB: split_contents respects quoted 'strings containing spaces' 170 tag, path_str = token.split_contents() 171 except ValueError: 172 raise template.TemplateSyntaxError, '%r tag requires at least 1 argument' % tag 168 definition = token.split_contents() 169 170 if len(definition) != 4 and len(definition) != 2: 171 raise template.TemplateSyntaxError, '%r tag requires at least 1 arguments' % tag 172 173 tag = definition[0] 174 path_arg = definition[1] 175 #kw_as = definition[2] 176 #kw_output = definition[3] 177 178 if len(definition) == 4: 179 180 #RB: 4 arguments means: {% store /path/filename as output %} 181 #RB: old style: DONT try to resolve variable 182 #RB: instead convert filename to quoted string 183 184 path_str = "'%s'" %path_arg 185 186 else: 187 188 #RB: 2 arguments can mean: {% store 'string' %} 189 #RB: 2 arguments can mean: {% store variable %} 190 191 path_str = path_arg 173 192 174 193 # RB: parse the template thing until %endstore found
Note: See TracChangeset
for help on using the changeset viewer.