-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moves JSON and pickle iterators into libsbp. #37
Conversation
def __iter__(self): | ||
return self | ||
|
||
def next(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should next
just be a NotImplementedError
in the BaseDriver? The readline implementation here seems FileDriver specific - not sure what iteration looks like for the serial drivers - but not newline-based, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... so I think the serial driver actually does support readline, but it's not clear to me if that's going to a common use case for this API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err, yes. reading that more carefully, that does make sense. newline iteration for serial ports is a bit weird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - pylibftdi does support it, and pyserial does through serial.FileLike
. So yeah go for it! Not really sure what this driver abstraction is buying us, tbh - I think I wanted to wrap things in context management and have some file handle opening convenience - but that was about it. Any thoughts on how to go forward? The usage in sbp_log_analysis was a little weird :( Pass it to a FileDriver object, then to the LogIterator.
Looks great - excited to have this moved into |
TODO (Buro): Reintroduce relative paths. |
k, this is ready to go. |
Moves JSON and pickle iterators into libsbp.
/cc @mfine @fnoble