Revision 3466
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/strings.py | ||
---|---|---|
119 | 119 |
|
120 | 120 |
##### Formatting |
121 | 121 |
|
122 |
def indent(str_, level=1, indent_str=' '): |
|
123 |
indent_str *= level |
|
124 |
return ('\n'.join((indent_str+l for l in str_.rstrip().split('\n'))))+'\n' |
|
125 |
|
|
122 | 126 |
def as_tt(str_): return '@'+str_+'@' |
123 | 127 |
|
124 | 128 |
def as_code(str_, lang=None, multiline=True): |
Also available in: Unified diff
strings.py: Added indent()