ntoll / uflash

A module and command to easily flash Python onto the BBC's micro:bit device.
http://micropython.org/
MIT License
101 stars 27 forks source link

Is there a reason that uflash doesn't preserve filenames? #48

Open ScottDWebster opened 6 years ago

ScottDWebster commented 6 years ago

Is there a reason that 'uflash my_file.py' creates micropython.hex instead of my_file.hex? Would there be an objection to changing it or would it be preferable to add an option like '-k' and/or '--keepname'?
I would like the functionality to be able to pre-hexlify files (uflash my_file,py ./). I'll start looking at the code to see how this could be done.

ntoll commented 6 years ago

Knock yourself out..! :-) The -k --keepname sounds like a good way to go. Please remember the checklist at the end of here: https://github.com/ntoll/uflash/blob/master/CONTRIBUTING.rst

(BTW.... micropython.hex is used simply because uflash usually saves directly onto the device rather than the local FS [nobody has ever considered anyone would want to pre-create/save hex files with uflash]).

ScottDWebster commented 6 years ago

When I first learned about the hex format I was quite surprised that standalone compiler/hexifier program didn't exist. I wanted to demonstrate the microbit at my local makerspace and wanted to be able to just drag and drop pre-hexified files onto the microbit. Uflash almost fit the bill except for not preserving the filename.
I've completed my edits. I'll submit a pull request.

ntoll commented 6 years ago

Great stuff... thank you! Looking forward to getting your PR. :-)

ScottDWebster commented 6 years ago

I'll have a second pull request soon. I wanted to have multi-input support (*.py, etc.) and finally decided that the simplest way to implement that was to create a separate script (hexify.py) that loads uflash.py as a module. I've got it working but I'll need to add tests and documentation.