DiamondLightSource / tickit

Event-based hardware simulation framework
Apache License 2.0
7 stars 0 forks source link

Allow Command to parse AnyStr #92

Closed MattPrit closed 1 year ago

MattPrit commented 2 years ago

Currently the parse method of Command objects expects a message of type bytes; if needed, the Command then has to deal with decoding the message, which feels slightly awkward. This also results in a type error (that happens to sneak past MyPy) in CommandInterpreter where parse is passed a message as an AnyStr.

With the introduction of DecodingInterpreter in #91 , decoding logic can be removed from RegexCommand, which should allow for commands to parse a generic AnyStr. (We actually don't need to move the decoding logic to achieve this)

This change will break some of the examples, these will need updating. (Not necessary)