Skip to content

Commit f57659d

Browse files
committed
Reformat with black, a pep8 autoreformatting tool.
1 parent 2841efe commit f57659d

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

build/txt-to-toml.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,60 @@
44

55
def main():
66
if len(sys.argv) != 2:
7-
print('Usage: txt-to-toml.py [src.txt]')
7+
print("Usage: txt-to-toml.py [src.txt]")
88
return 1
99

1010
filename = sys.argv[1]
1111

12-
indent = ' '
12+
indent = " "
1313
in_workload = False
1414
first_test = False
1515
keys_before_test = False
1616

1717
for line in open(filename):
18-
k = ''
19-
v = ''
18+
k = ""
19+
v = ""
2020

21-
if line.strip().startswith(';'):
22-
print( (indent if in_workload else '') + line.strip().replace(';', '#') )
23-
continue
21+
if line.strip().startswith(";"):
22+
print((indent if in_workload else "") + line.strip().replace(";", "#"))
23+
continue
2424

25-
if '=' in line:
26-
(k, v) = line.strip().split('=')
25+
if "=" in line:
26+
(k, v) = line.strip().split("=")
2727
(k, v) = (k.strip(), v.strip())
2828

29-
if k == 'testTitle':
29+
if k == "testTitle":
3030
first_test = True
31-
if in_workload:
32-
print('')
31+
if in_workload:
32+
print("")
3333
in_workload = False
3434
if keys_before_test:
35-
print('')
35+
print("")
3636
keys_before_test = False
37-
print('[[test]]')
37+
print("[[test]]")
3838

39-
if k == 'testName':
39+
if k == "testName":
4040
in_workload = True
41-
print('')
42-
print(indent + '[[test.workload]]')
41+
print("")
42+
print(indent + "[[test.workload]]")
4343

4444
if not first_test:
4545
keys_before_test = True
4646

47-
if v.startswith('.'):
48-
v = '0' + v
47+
if v.startswith("."):
48+
v = "0" + v
4949

50-
if any(c.isalpha() or c in ['/', '!'] for c in v):
51-
if v != 'true' and v != 'false':
50+
if any(c.isalpha() or c in ["/", "!"] for c in v):
51+
if v != "true" and v != "false":
5252
v = "'" + v + "'"
5353

54-
if k == 'buggify':
55-
print('buggify = ' + ('true' if v == "'on'" else 'false'))
56-
elif k:
57-
print( (indent if in_workload else '') + k + ' = ' + v)
54+
if k == "buggify":
55+
print("buggify = " + ("true" if v == "'on'" else "false"))
56+
elif k:
57+
print((indent if in_workload else "") + k + " = " + v)
5858

5959
return 0
6060

6161

62-
if __name__ == '__main__':
62+
if __name__ == "__main__":
6363
sys.exit(main())

0 commit comments

Comments
 (0)