Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions annet/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@ def __call__(self, dev: Connector, cmd: Command, match_content: bytes):


def rb_question_to_question(q: MakeMessageMatcher, a: Answer) -> Question: # TODO: drop MakeMessageMatcher
if not a.send_nl:
raise Exception("not supported false send_nl")
text: str = q._text # pylint: disable=protected-access
answer: str = a.text
is_regexp = False
if text.startswith("/") and text.endswith("/"):
is_regexp = True
text = text[1:-1]
res = Question(question=text, answer=a.text, is_regexp=is_regexp)
if not a.send_nl:
answer += "\x00"
res = Question(question=text, answer=answer, is_regexp=is_regexp)
return res


Expand Down