py: Reformat all Python files consistently

This commit is the unmodified results of running
```
black $(git ls-files '*.py')
```
with black version 19.10b0. See #2046.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall
2020-11-17 15:07:09 +00:00
parent 053d2ae2b4
commit 905b22a17e
26 changed files with 6928 additions and 4875 deletions

View File

@@ -3,14 +3,14 @@
import sys
if len(sys.argv) < 4:
print('Usage: {0} <filename> <variable> <output>')
print("Usage: {0} <filename> <variable> <output>")
with open(sys.argv[1], 'rb') as f:
in_data = f.read().decode('utf-8', 'backslashreplace')
b = [r'\x{:02x}'.format(ord(c)) for c in in_data]
with open(sys.argv[1], "rb") as f:
in_data = f.read().decode("utf-8", "backslashreplace")
b = [r"\x{:02x}".format(ord(c)) for c in in_data]
out_data = "const char {0}[] = \"".format(sys.argv[2])
out_data += "".join(b) + "\";"
out_data = 'const char {0}[] = "'.format(sys.argv[2])
out_data += "".join(b) + '";'
with open(sys.argv[3], 'w') as f:
with open(sys.argv[3], "w") as f:
f.write(out_data)