Apply codestyle checks to all Python code.

This commit is contained in:
Dave Page
2019-03-20 11:17:51 +00:00
parent 6a8367beb9
commit bb1e908b54
7 changed files with 129 additions and 112 deletions

View File

@@ -90,13 +90,14 @@ data 'STR#' (5002, "English") {
$"2C20 7072 6573 7320 2244 6973 6167 7265"
$"6522 2E"
};\n\n""")
with open(license, 'r') as l:
with open(license, 'r') as lines:
kind = 'RTF ' if license.lower().endswith('.rtf') else 'TEXT'
f.write('data \'%s\' (5000, "English") {\n' % kind)
def escape(s):
return s.strip().replace('\\', '\\\\').replace('"', '\\"')
for line in l:
for line in lines:
if len(line) < 1000:
f.write(' "' + escape(line) + '\\n"\n')
else:
@@ -128,6 +129,7 @@ data 'STR#' (5002, "English") {
else:
print("Failed to add license to '%s'" % dmgFile)
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.set_usage("""%prog <dmgFile> <licenseFile> [OPTIONS]