common.py | raw changeset files shortlog | integer-cache |
1.1 --- a/common.py Tue Mar 21 01:15:38 2017 +0100 1.2 +++ b/common.py Tue Mar 21 18:08:44 2017 +0100 1.3 @@ -1188,6 +1188,15 @@ 1.4 finally: 1.5 f.close() 1.6 1.7 +def indent(indent, s): 1.8 + 1.9 + "Insert 'indent' before every line in 's'." 1.10 + 1.11 + l = [] 1.12 + for line in s.split("\n"): 1.13 + l.append(indent + line) 1.14 + return "\n".join(l) 1.15 + 1.16 # General encoding. 1.17 1.18 def sorted_output(x):