I've just created what I hope will be a useful plugin. It's called OctoPrint-GitFiles. For those who want to maintain the latest sliced copy of their files, this will basically do a
git pull behind-the-scenes.
Note that it probably won't work with Windows since it uses a symlink (at the moment). This feels like a cleaner approach than to run a
git init directly in
GitFiles (currently v1.0.4)
- Repository: Follow the instructions on the README.md found there. This version doesn't yet work for OctoPrint installed on a Windows server so hold off on that platform. I've tested on OSX/Raspbian and it's behaving nicely so far.
- You'll need to create a repository on Github and to place at least one gcode file in it. I wouldn't suggest putting anything other than a
.gitignoreand possibly a
LICENSEfile in your repository other than gcode files themselves.
You can always tail the octoprint.log if you want to see anything happening when you press the new button.
tail -f .octoprint/logs/octoprint.log
For foosel, earlier conversation:
- I wanted to have you review the approach which is adding an
~/.octoprint/gitfilesfolder and then creating a symlink as
~/.octoprint/uploads/github. It then looks like this in the Files side panel:
I don't think that OctoPrint upgrades later should do any harm to the
uploadsfolder so it should be safe enough.
- Secondly, I need some help with the code. Here on line 12 I had to remove
self.before the function name so that I could find it in the same file on line 49 where I'm binding it to the button. I'm not sure what's going on with the ViewModel, obviously. It works in this version; it just feels like a hack to throw the function into a higher scope.
Be kind—it's my first published plugin on OctoPrint.