Show More
@@ -217,6 +217,7 b' def buildfunc(exp, context):' | |||||
217 |
|
217 | |||
218 | def date(context, mapping, args): |
|
218 | def date(context, mapping, args): | |
219 | if not (1 <= len(args) <= 2): |
|
219 | if not (1 <= len(args) <= 2): | |
|
220 | # i18n: "date" is a keyword | |||
220 | raise error.ParseError(_("date expects one or two arguments")) |
|
221 | raise error.ParseError(_("date expects one or two arguments")) | |
221 |
|
222 | |||
222 | date = args[0][0](context, mapping, args[0][1]) |
|
223 | date = args[0][0](context, mapping, args[0][1]) | |
@@ -244,6 +245,7 b' def diff(context, mapping, args):' | |||||
244 |
|
245 | |||
245 | def fill(context, mapping, args): |
|
246 | def fill(context, mapping, args): | |
246 | if not (1 <= len(args) <= 4): |
|
247 | if not (1 <= len(args) <= 4): | |
|
248 | # i18n: "fill" is a keyword | |||
247 | raise error.ParseError(_("fill expects one to four arguments")) |
|
249 | raise error.ParseError(_("fill expects one to four arguments")) | |
248 |
|
250 | |||
249 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
251 | text = stringify(args[0][0](context, mapping, args[0][1])) | |
@@ -254,6 +256,7 b' def fill(context, mapping, args):' | |||||
254 | try: |
|
256 | try: | |
255 | width = int(stringify(args[1][0](context, mapping, args[1][1]))) |
|
257 | width = int(stringify(args[1][0](context, mapping, args[1][1]))) | |
256 | except ValueError: |
|
258 | except ValueError: | |
|
259 | # i18n: "fill" is a keyword | |||
257 | raise error.ParseError(_("fill expects an integer width")) |
|
260 | raise error.ParseError(_("fill expects an integer width")) | |
258 | try: |
|
261 | try: | |
259 | initindent = stringify(_evalifliteral(args[2], context, mapping)) |
|
262 | initindent = stringify(_evalifliteral(args[2], context, mapping)) | |
@@ -267,6 +270,7 b' def pad(context, mapping, args):' | |||||
267 | """usage: pad(text, width, fillchar=' ', right=False) |
|
270 | """usage: pad(text, width, fillchar=' ', right=False) | |
268 | """ |
|
271 | """ | |
269 | if not (2 <= len(args) <= 4): |
|
272 | if not (2 <= len(args) <= 4): | |
|
273 | # i18n: "pad" is a keyword | |||
270 | raise error.ParseError(_("pad() expects two to four arguments")) |
|
274 | raise error.ParseError(_("pad() expects two to four arguments")) | |
271 |
|
275 | |||
272 | width = int(args[1][1]) |
|
276 | width = int(args[1][1]) | |
@@ -422,6 +426,7 b' def shortest(context, mapping, args):' | |||||
422 | """usage: shortest(node, minlength=4) |
|
426 | """usage: shortest(node, minlength=4) | |
423 | """ |
|
427 | """ | |
424 | if not (1 <= len(args) <= 2): |
|
428 | if not (1 <= len(args) <= 2): | |
|
429 | # i18n: "shortest" is a keyword | |||
425 | raise error.ParseError(_("shortest() expects one or two arguments")) |
|
430 | raise error.ParseError(_("shortest() expects one or two arguments")) | |
426 |
|
431 | |||
427 | node = stringify(args[0][0](context, mapping, args[0][1])) |
|
432 | node = stringify(args[0][0](context, mapping, args[0][1])) | |
@@ -471,6 +476,7 b' def shortest(context, mapping, args):' | |||||
471 |
|
476 | |||
472 | def strip(context, mapping, args): |
|
477 | def strip(context, mapping, args): | |
473 | if not (1 <= len(args) <= 2): |
|
478 | if not (1 <= len(args) <= 2): | |
|
479 | # i18n: "strip" is a keyword | |||
474 | raise error.ParseError(_("strip expects one or two arguments")) |
|
480 | raise error.ParseError(_("strip expects one or two arguments")) | |
475 |
|
481 | |||
476 | text = stringify(args[0][0](context, mapping, args[0][1])) |
|
482 | text = stringify(args[0][0](context, mapping, args[0][1])) |
General Comments 0
You need to be logged in to leave comments.
Login now