Open ArchibaldBienetre opened 4 years ago
Implementation can happen in small steps
Parts of what you are trying to achieve here could be tackled by (re-)implementing the DDR-ASCII codec on top of the Python codecs framework: https://docs.python.org/3/library/codecs.html When we include support for (custom) ANSI escape sequences, we could "translate" all supported characters and control codes the Erika has. Other thoughts:
codecs
package already allow for extension. For example, you can use/implement the error handlers strict
or ignore
or you can register new ones.
With the current AbstractErikaMock + subclasses, we had issues in the past that the mock interface and the real interface would drift apart.
As a mitigation, we added ugly meta code to the constructors... This does not feel right / not feel python-y.
Instead, there's one level of abstraction where we cannot drift apart, that's the actual bytes as understood by the Erika device.
The BinErika implementation should
_write_byte
in the Erika class in https://github.com/Chaostreff-Potsdam/erika3004/blob/master/erika/erika.py