Skip to content

Commit

Permalink
fix: parse indi reponses with "[tcp://127.0.0.1:93]" in them (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Jun 16, 2023
1 parent a877d7b commit f6746da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions pathfinder/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def __init__(self):
indi_operator = string_from("indi")
gp_operator = string_from("GPO", "GPI")
space = string(" ")
obj = regex(r"[a-zA-Z0-9.#]*")
obj = regex(r"[a-zA-Z0-9.#\[\]:/]*")
name = regex(r"[a-zA-Z]*")
simple_string = regex(r"[a-zA-Z ]*")
equals = string("=")
Expand All @@ -34,5 +34,4 @@ def __init__(self):
self.p = indi_parser | gp_parser | error_parser

def parse(self, string):
print(string[0:30])
return self.p.parse(string)
4 changes: 4 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

_PARSER_TESTDATA = [
("indi Devices#0", {"path": "Devices#0", "info": {}}),
(
"indi Devices#0.PcpGpio#[tcp://127.0.0.1:93]",
{"path": "Devices#0.PcpGpio#[tcp://127.0.0.1:93]", "info": {}},
),
("indi MemorySlots#0", {"path": "MemorySlots#0", "info": {}}),
(
" ".join(
Expand Down

0 comments on commit f6746da

Please sign in to comment.