Skip to content

Commit b13fb34

Browse files
committed
Formatting
1 parent 461bc66 commit b13fb34

3 files changed

Lines changed: 42 additions & 16 deletions

File tree

cmake/target/tools/cat.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@
44

55

66
def parse_args():
7-
""" Parse command line arguments. """
7+
"""Parse command line arguments."""
88
parser = argparse.ArgumentParser(description="Concatenate input files.")
9-
parser.add_argument("--output", type=argparse.FileType('w'), help="Output file name", default=sys.stdout)
10-
parser.add_argument("file", type=Path, nargs="+", help="Files to concatenate together")
9+
parser.add_argument(
10+
"--output",
11+
type=argparse.FileType("w"),
12+
help="Output file name",
13+
default=sys.stdout,
14+
)
15+
parser.add_argument(
16+
"file", type=Path, nargs="+", help="Files to concatenate together"
17+
)
1118
return parser.parse_args()
1219

20+
1321
def main():
14-
""" Main function to handle command line arguments and output. """
22+
"""Main function to handle command line arguments and output."""
1523
args = parse_args()
1624
for file in args.file:
1725
with open(file, "r") as file_handle:
1826
print("".join(file_handle.readlines()), end="", file=args.output)
1927

28+
2029
if __name__ == "__main__":
21-
main()
30+
main()

cmake/target/tools/property_writer.py

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,42 @@
99

1010

1111
def parse_args():
12-
""" Parse command line arguments. """
12+
"""Parse command line arguments."""
1313
parser = argparse.ArgumentParser(description="Write properties to a file.")
14-
parser.add_argument("directive", type=str, help="Directive: SET, APPEND, or DEFINE",
15-
choices=["SET", "DEFINE", "APPEND"])
16-
parser.add_argument("values", type=str, nargs="+", help="Value(s) to write to property call")
17-
parser.add_argument("--file", type=Path, help="File to write the property to", default=None)
18-
parser.add_argument("--append", action="store_true", help="Append to the file instead of overwriting",
19-
default=False)
14+
parser.add_argument(
15+
"directive",
16+
type=str,
17+
help="Directive: SET, APPEND, or DEFINE",
18+
choices=["SET", "DEFINE", "APPEND"],
19+
)
20+
parser.add_argument(
21+
"values", type=str, nargs="+", help="Value(s) to write to property call"
22+
)
23+
parser.add_argument(
24+
"--file", type=Path, help="File to write the property to", default=None
25+
)
26+
parser.add_argument(
27+
"--append",
28+
action="store_true",
29+
help="Append to the file instead of overwriting",
30+
default=False,
31+
)
2032

2133
parsed = parser.parse_args()
22-
parsed.file = sys.stdout if parsed.file is None else open(parsed.file, "a" if parsed.append else "w")
34+
parsed.file = (
35+
sys.stdout
36+
if parsed.file is None
37+
else open(parsed.file, "a" if parsed.append else "w")
38+
)
2339
return parsed
2440

41+
2542
def main():
26-
""" Main function to handle command line arguments and write properties. """
43+
"""Main function to handle command line arguments and write properties."""
2744
args = parse_args()
2845
format_string = SET if args.directive == "SET" else DEFINE
2946
print(format_string.format(" ".join(args.values)), file=args.file)
3047

48+
3149
if __name__ == "__main__":
32-
main()
50+
main()

cmake/test/src/test_implementation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ def test_override_implementation(IMPLEMENTATION_TEST):
3939
def test_non_built_implementation(IMPLEMENTATION_TEST):
4040
"""Check the override target that wasn't use was not built along with the override platform target"""
4141
cmake.assert_process_success(IMPLEMENTATION_TEST)
42-

0 commit comments

Comments
 (0)