Skip to content

Commit 972ea1b

Browse files
authored
Merge pull request #261 from antoniovazquezblanco/py1
svdtools/patch: Refactor entry code
2 parents a3883d3 + cd2fbe6 commit 972ea1b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

svdtools/patch.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ def process_device(svd, device, update_fields=True):
18491849
sort_recursive(svd.getroot())
18501850

18511851

1852-
def main(yaml_file):
1852+
def main(yaml_file: Path):
18531853
# Load the specified YAML root file
18541854
with open(yaml_file) as f:
18551855
root = yaml.safe_load(f)
@@ -1876,8 +1876,7 @@ def main(yaml_file):
18761876
from argparse import ArgumentParser
18771877

18781878
parser = ArgumentParser()
1879-
parser.add_argument("patch-file")
1879+
parser.add_argument("patch-file", type=Path)
18801880
arguments = vars(parser.parse_args())
1881-
path = arguments["patch-file"]
1882-
path = Path(path).resolve()
1883-
main(path)
1881+
patch_file = arguments["patch-file"].resolve()
1882+
main(patch_file)

0 commit comments

Comments
 (0)