mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 01:30:07 +01:00
Python 2.7 doesn't have indent
This commit is contained in:
@@ -968,3 +968,15 @@ def updateLicenseFiles(cfg):
|
||||
text += f.read() + '\n\n'
|
||||
with open('LICENSE.txt', 'w') as f:
|
||||
f.write(text)
|
||||
|
||||
try:
|
||||
from textwrap import indent
|
||||
except ImportError:
|
||||
def indent(text, prefix, predicate=None):
|
||||
if predicate is None:
|
||||
def predicate(line):
|
||||
return line.strip()
|
||||
def prefixed_lines():
|
||||
for line in text.splitlines(True):
|
||||
yield (prefix + line if predicate(line) else line)
|
||||
return ''.join(prefixed_lines())
|
||||
|
||||
Reference in New Issue
Block a user