Show More
@@ -504,7 +504,7 b' def fill(context, mapping, args):' | |||||
504 |
|
504 | |||
505 | return templatefilters.fill(text, width, initindent, hangindent) |
|
505 | return templatefilters.fill(text, width, initindent, hangindent) | |
506 |
|
506 | |||
507 |
@templatefunc('pad(text, width[, fillchar=\' \'[, |
|
507 | @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])') | |
508 | def pad(context, mapping, args): |
|
508 | def pad(context, mapping, args): | |
509 | """Pad text with a |
|
509 | """Pad text with a | |
510 | fill character.""" |
|
510 | fill character.""" | |
@@ -518,14 +518,14 b' def pad(context, mapping, args):' | |||||
518 |
|
518 | |||
519 | text = evalstring(context, mapping, args[0]) |
|
519 | text = evalstring(context, mapping, args[0]) | |
520 |
|
520 | |||
521 |
|
|
521 | left = False | |
522 | fillchar = ' ' |
|
522 | fillchar = ' ' | |
523 | if len(args) > 2: |
|
523 | if len(args) > 2: | |
524 | fillchar = evalstring(context, mapping, args[2]) |
|
524 | fillchar = evalstring(context, mapping, args[2]) | |
525 | if len(args) > 3: |
|
525 | if len(args) > 3: | |
526 |
|
|
526 | left = evalboolean(context, mapping, args[3]) | |
527 |
|
527 | |||
528 |
if |
|
528 | if left: | |
529 | return text.rjust(width, fillchar) |
|
529 | return text.rjust(width, fillchar) | |
530 | else: |
|
530 | else: | |
531 | return text.ljust(width, fillchar) |
|
531 | return text.ljust(width, fillchar) |
General Comments 0
You need to be logged in to leave comments.
Login now