Closed mtwichan closed 4 years ago
Thanks for the suggestion. We believe this should be a fairly simple change that we can update on a development branch.
To ensure we look into the right implementation, can you clarify what the use case scenario is for this? I.e. what way would you be using this functionality in the script?
@MatinF great question. I have a use case where I need to upload the files into a full-stack app, and I don't want to save the files temporarily on the server. Instead, the upload functionality converts the files into an ingestable in-memory binary stream
stored in the browser and is then used by the above functions to aggregate/munge the data above further :+1:
Hi, the latest update of the can_decoder tool should enable this - let me know if you get it working
You can install the dev version via:
pip install -i https://test.pypi.org/simple/ can-decoder
@MatinF works for me :+1:
Currently only decoding a
.dbc
from its pathname is supported and I have a use case where I'd like to decode the contents of a.dbc
file as anin-memory binary stream
(see: link) function below:As of now, the function takes in a pathname containing the
.dbc
file and then reads the file in as anin-memory binary stream
.https://github.com/CSS-Electronics/can_decoder/blob/5bb4d7a9c4d96d794830e135bb90a5b2ceab8b83/can_decoder/DBCLoader.py#L26-L27
An easy fix to support using both the pathname and
in-memory
binary stream would be simply to remove the line below : https://github.com/CSS-Electronics/can_decoder/blob/5bb4d7a9c4d96d794830e135bb90a5b2ceab8b83/can_decoder/DBCLoader.py#L26and have the user read data from a path as part of the client code like so:
then users who want to pass in the
in-memory binary stream
can then do:CC: @dflyon