Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate a number of existing RPi.GPIO API examples and much more
changes in this patch: .coveragerc: - report coverage information on RPi/core.py instead of RPi/_GPIO.py due to file name change Makefile: - %s/unit-cov/test-cov/g - removed an extraneous comment RPi/GPIO/__init__.py: RPi/GPIO_DEVEL/__init__.py: - Added header docstrings - formatted and sorted API imports RPi/_GPIO.py -> RPi/core.py: - File renamed to clarify purpose - convert header to docstring format - sort and organize functions and constants - fix documentation errors and gramatical mistakes - add automatic invokation of cleanup() at interpreter exit - add RPi.GPIO.{RPI_INFO, RPI_REVISION, VERSION} constants - fix various cases of mishandling of iterable channel and value lists - fix pwm thread never releasing lock if thread dies due to exception when the main thread revokes access, however I suspect that this actually be a surface fix for another bug, will look into further (#29) - small tweaks to improve modularity - add support for single value and iterable lists of values for RPi.GPIO.cleanup() - allow PwM to successfully start without explicitly setting up a channel as an output because this library has a more relaxed attitude about those things - add warn on invalid call to PWM.start() - fix board numbering mode being actually pretty broken due to inconsistent mishandling of channel inputs of various forms - fix line_get_value being actually very broken and not retuning anything and therefore always returning None - fix gpio_function() being actually entirely broken so it returns the current function representing what is going on on a GPIO channel as RPi.GPIO would, but this requires further testing (#30) - fix RPi.GPIO.PWM.start() not returning the truth of whether a PwM thread has been successfully started or not examples/callback2.py: - add shabang examples/flash18.py: - remove debuginfo output toggle examples/input_examples.py: examples/output_examples.py: examples/pwm2.py: examples/pwm_usage.py: examples/random_usage.py: examples/try_import.py: - copy example code from Ben Croston's RPi.GPIO wiki on sourceforge - see the files for the sources - ensure that the code works with this library. I found quite a few bugs integrating these files - fix a few mistakes in the code - fix style examples/morse.py: - update morse code to current API version - add basic input validation - fix style examples/pwm.py: - renamed to pwm1.py for consistency examples/pwm1.py: - add try except structure - this may be revelvant to (#29) examples/pwm3.py: examples/pwm4.py: - Copy example code from some forum - see the files for the sources non_root_permission.sh: - expand note on lack of persistence of effects post reboot requirements.txt: - update with latest output of pip freeze from my virtualenv, however this _may_ be bloat spec/spec.tex: - fix some typos - add entry for channel_valid_or_die - update some of the technical spec spec/spec.pdf: - regenerate document test-style.sh: - scan RPi/core.py instead of RPi/_GPIO.py due to name change - add scan of examples/morese.py since it is again working tests/test_gpio.py: - style tweaks - fix test_gpio_function by making it actually test for the feature that now is possibly implemented correctly - modify test_setdebug info to turn it off before the next call to Reset to avoid printing a lot of text to the terminal - extend test_cleanup to validate the new features of cleanup() tests/test_pwm.py: - more thoroughly test PWM.start() Signed-off-by: Joel Savitz <[email protected]>
- Loading branch information