From a5eb06dcc2183c991f2c586c6e0c3851ada6a411 Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Sun, 6 Jan 2019 04:22:17 -0800 Subject: [PATCH 1/4] Added in dash (-) notation for ports --- Interlace/lib/core/input.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 36c00f9..5305c4a 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -64,7 +64,11 @@ class InputHelper(object): final_commands = set() output = OutputHelper(arguments) - ports = arguments.port.split(",") + if "," in arguments.port: + ports = arguments.port.split(",") + elif "-" in arguments.port: + tmp_ports = arguments.port.split("-") + ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) # process targets first if arguments.target: From 6311e593ca2ae5475b4020b7a439998b47d5be27 Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Sun, 6 Jan 2019 04:25:24 -0800 Subject: [PATCH 2/4] Fixed issue with port string vs int --- Interlace/lib/core/input.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 5305c4a..f9dc63e 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -70,6 +70,7 @@ class InputHelper(object): tmp_ports = arguments.port.split("-") ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) + # process targets first if arguments.target: ranges.add(arguments.target) @@ -112,7 +113,7 @@ class InputHelper(object): if arguments.output: command = str(command).replace("_output_", arguments.output) if arguments.port: - command = str(command).replace("_port_", port) + command = str(command).replace("_port_", str(port)) if arguments.realport: command = str(command).replace("_realport_", arguments.realport) final_commands.add(command) From 1555129b85769db5befb442c02b1ea998be783e2 Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Sun, 6 Jan 2019 04:35:55 -0800 Subject: [PATCH 3/4] Fixed issues with TypeErrors --- Interlace/lib/core/input.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index f9dc63e..3360b50 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -69,6 +69,9 @@ class InputHelper(object): elif "-" in arguments.port: tmp_ports = arguments.port.split("-") ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) + else: + ports = [arguments.port] + print(ports) # process targets first From 8e020466acb6c37626fc20b604af677fd94441eb Mon Sep 17 00:00:00 2001 From: ProDigySML Date: Sun, 6 Jan 2019 04:37:39 -0800 Subject: [PATCH 4/4] Removed the debug statement --- Interlace/lib/core/input.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index 3360b50..527ea3c 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -71,7 +71,6 @@ class InputHelper(object): ports = list(range(int(tmp_ports[0]), int(tmp_ports[1]) + 1)) else: ports = [arguments.port] - print(ports) # process targets first