From 9579e4b4d0bffb311a909e86e30e3434e8a4422b Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Tue, 2 Jan 2024 23:48:36 -0500 Subject: [PATCH] Convert parsed path args to correct types --- py/hexagram/path.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/py/hexagram/path.py b/py/hexagram/path.py index 68cb610..fb0ebe8 100644 --- a/py/hexagram/path.py +++ b/py/hexagram/path.py @@ -42,7 +42,16 @@ class PathCommand(): if len(self.arg) > 0: self.args.append(self.arg) - ret = [self.command, self.args] + args = list() + + for arg in self.args: + try: + arg.index('.') + args.append(float(arg)) + except ValueError: + args.append(int(arg)) + + ret = [self.command, args] self.command = None self.args = list()