-
Notifications
You must be signed in to change notification settings - Fork 1
Hacking Howto
So you're interested in hacking on Switchprint or other aspects of the Voxelpress project, and you've already introduced yourself on #voxelpress? Great! Here's a brief howto to help you get started!
Follow the installation instructions for both Switchprint and Printcontrol EXCEPT for the "sudo python setup.py install" in either project. Instead, run the develop variation of that command. The develop variation will still install the project, but it will symlink to the git checkout instead of copying it to another directory. So long as the entry point for either program doesn't change, you won't need to run these commands more than once.
First run switchprint to start the daemon. You can do this in userspace just fine.
switchprint And then run your host software: printcontrol You can plug a printer in whenever. The host software will be notified of new printers as well as disconnect events.
Switchprint uses nosetests. You can install nose from apt via the package python-nose. Printcontrol doesn't have unit tests yet, but when it does, it'll use nose, too.
You can run the unit tests by executing this command while in the project folder
nosetests
If a test throws a error, you can have nose automatically break right before the error using pdb like so:
nosetests --pdb --pdb-failures
Each driver should have a 'tests' submodule. Switchprint.workers and switchprint.daemon should also have a 'tests' submodule each, but currently don't. Each hardware monitor should probably also have its own 'tests' submodule.
For further information on writing unit tests with nose:
- https://nose.readthedocs.org/en/latest/testing.html
- https://nose.readthedocs.org/en/latest/writing_tests.html
For further information on the python debugger:
Also checkout the [Developer Resources)[https://github.com/Aeva/switchprint/wiki/Development-Resources] page for further reading on Switchprint's dependencies!