Automatically reload solidpython file on change.
Project description
Solidpython Reloader
Automatically reload and recompile a solidpython project on file changes.
This tool is imitates Djangos runserver behaviour. Actually it depends on Django and uses the Reloader class that powers runserver.
Installation
- If you already haven't done so for solidpython, optionally create a virtualenv
- pip install solidpython-reloader
Usage
This package installs a script named sp-reloader into your PATH. You can use this to start a new project: sp-reloader startproject myproject
This creates a new project directory named myproject.
$ ls myproject/
myproject.py myproject.scad run.py
myproject.py is the file where your solidpython logic will reside in. myproject.scad will contain the translated openscad code. Right now, it is still empty. run.py is the reloader for your project. If you want to start working on your project, execute it:
$ python run.py
INFO:root:Solidpython reloader started.
This starts the reloader, opens openscad and should render the sample code in myproject.py.
Now you are ready to model! Every time you save myproject.py or any other .py file in the project directory, the scad file will be updated and rendered again.
Customization
Out of the box, the run.py script observes changes in all .py and .svg files in the current directory. You can add other files, file types or whole directories by adding additional reloader.watch_dir() directives in run.py. You should add them after the existing lines near the end of the file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for solidpython_reloader-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6561281d626ebd725a1f1935ddda5d29c7704e4c5705e4e73253c6b96724fd3c |
|
MD5 | bd43e5a88dcc0d5761ea9d135a23889b |
|
BLAKE2b-256 | ec7251a4ba50b2e26cc1fc3e530f2621eb9d8e0c135d169f37a9c3828f02cf9f |