Skip to content

Commit

Permalink
tools/clean_svg: drop superfluous nargs
Browse files Browse the repository at this point in the history
If nargs=1 the result is a tuple but that's not really necessary here.
  • Loading branch information
whot committed Oct 11, 2024
1 parent 757608f commit cd02780
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/clean_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,10 @@ def clean_svg(root, tabletname):
if __name__ == "__main__":
parser = ArgumentParser(description="Clean SVG files for libwacom")
parser.add_argument(
"filename", nargs=1, type=str, help="SVG file to clean", metavar="FILE"
"filename", type=str, help="SVG file to clean", metavar="FILE"
)
parser.add_argument(
"tabletname",
nargs=1,
type=str,
help="The name of the tablet",
metavar="TABLET_NAME",
Expand All @@ -315,10 +314,10 @@ def clean_svg(root, tabletname):

ET.register_namespace("", NAMESPACE)
try:
tree = ET.parse(args.filename[0])
tree = ET.parse(args.filename)
except Exception as e:
sys.stderr.write(str(e) + "\n")
sys.exit(1)
root = tree.getroot()
clean_svg(root, args.tabletname[0])
clean_svg(root, args.tabletname)
print(to_string(root))

0 comments on commit cd02780

Please sign in to comment.