From d10cfab877aa2fe682a35ac0af065ca89b672596 Mon Sep 17 00:00:00 2001 From: Tristan Rowley Date: Fri, 3 Jan 2020 22:00:27 +0000 Subject: [PATCH] can pass strings through mapped commands now --- actions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/actions.py b/actions.py index 6704705..21a11c2 100644 --- a/actions.py +++ b/actions.py @@ -918,6 +918,10 @@ class Actions(object): ( r"set_shader_speed_layer_([0-2])_amount", self.shaders.set_speed_layer_to_amount ), } + def detect_types(self, args): + a = [ int(arg) if str(arg).isnumeric() else str(arg) for arg in list(args) ] + return a + def get_callback_for_method(self, method_name, argument): for a in self.parserlist: regex = a[0] @@ -926,7 +930,7 @@ class Actions(object): if matches: found_method = me - parsed_args = list(map(int,matches.groups())) + parsed_args = self.detect_types(matches.groups()) #list(map(int,matches.groups())) if argument is not None: args = parsed_args + [argument] else: