Skip to content

Commit 3f4e905

Browse files
Run black code formatter on split.py
1 parent 9bbb474 commit 3f4e905

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

split.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66
import os
77
import sys
88

9-
border = '// ----------------------------------------------------------------------------'
9+
border = (
10+
"// ----------------------------------------------------------------------------"
11+
)
1012

1113
args_parser = argparse.ArgumentParser(description=__doc__)
1214
args_parser.add_argument(
13-
"-e", "--extension", help="extension of the implementation file (default: cc)",
14-
default="cc"
15+
"-e",
16+
"--extension",
17+
help="extension of the implementation file (default: cc)",
18+
default="cc",
1519
)
1620
args_parser.add_argument(
1721
"-o", "--out", help="where to write the files (default: out)", default="out"
1822
)
1923
args = args_parser.parse_args()
2024

2125
cur_dir = os.path.dirname(sys.argv[0])
22-
lib_name = 'httplib'
23-
header_name = '/' + lib_name + '.h'
24-
source_name = '/' + lib_name + '.' + args.extension
26+
lib_name = "httplib"
27+
header_name = "/" + lib_name + ".h"
28+
source_name = "/" + lib_name + "." + args.extension
2529
# get the input file
2630
in_file = cur_dir + header_name
2731
# get the output file
@@ -49,18 +53,18 @@
4953

5054
in_implementation = False
5155
cc_out = args.out + source_name
52-
with open(h_out, 'w') as fh, open(cc_out, 'w') as fc:
56+
with open(h_out, "w") as fh, open(cc_out, "w") as fc:
5357
fc.write('#include "httplib.h"\n')
54-
fc.write('namespace httplib {\n')
58+
fc.write("namespace httplib {\n")
5559
for line in lines:
5660
is_border_line = border in line
5761
if is_border_line:
5862
in_implementation = not in_implementation
5963
elif in_implementation:
60-
fc.write(line.replace('inline ', ''))
64+
fc.write(line.replace("inline ", ""))
6165
else:
6266
fh.write(line)
63-
fc.write('} // namespace httplib\n')
67+
fc.write("} // namespace httplib\n")
6468

6569
print("Wrote {} and {}".format(h_out, cc_out))
6670
else:

0 commit comments

Comments
 (0)