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

Add command line flag to watch the script for changes and re-flash #26

Closed Nagasaki45 closed 7 years ago

Nagasaki45 commented 7 years ago

I'm currently doing it with inotifywait, but I think that it might be usefull as part of uflash itself, with additional command line flag.

while inotifywait -e modify my_script.py; do
    uflash my_script.py
done

(BTW, :+1: for the guidelines for contribution!)

ntoll commented 7 years ago

Heh... that's really cool. That shouldn't be a difficult change. Do you know enough Python to make this happen..? Happy to review / help etc...

Nagasaki45 commented 7 years ago

Why not. Let me try...

Nagasaki45 commented 7 years ago

Hi @ntoll, some questions:

  1. I was searching for ways to do this, and it seems that watching the source file without polling is complicated when the solution must be cross platform (See this question for more info). Do you see a reason not to poll the file for changes?
  2. Do you want to allow watching for changes when extracting from .hex? Will it be usefull in some workflow?