Also tell a whole load of lies about what's a keyword-only arg. In the
vast majority of cases, pin_factory (and other args) *aren't*
keyword-only ... but we'd really like them to be, it's just difficult
while maintaining py2 compatibility.
This implements the proposal discussed in the re-opened #279 to add a
pin_factory argument at the device level and remove the ability to
specify a pin instance to device constructors (they now only accept a
pin specification).
Note: there's still a couple of bits to tidy up (tests on "real" Pis,
and pin_factory.release_all needs refinement) but the test suite is now
at least capable of passing on a PC.
This is a minimal change which re-orders some bits of CompositeDevice's
constructor to ensure that all exceptions get raised *before* we store a
reference to the contained devices. Hopefully this'll be enough to sort
out 2.x but I'm not sure it will be for pypy (might still require an
explicit close there).
Also updated StatusBoard and StatusZero to reject duplicate identifiers
(namedtuple doesn't pick 'em up because they're passed in a dict and
thus the dups are squashed prior to the call). Added tests for all the
relevant stuff.
Permit replacement of pin_factory without closing old factory. However,
continue closing devices associated with extant pin factory at script
termination.
Added notes on how the abstracts are represented, ensured all the class
hierarchies were up to date, and changed the orientation so the classes
are actually readable in the big chart.
This is almost a straight copy'n'paste of picamera's development chapter
with a few minor changes to make it read sensibly for GPIO Zero; it
needs plenty more work to fulfil the goals of #451 but hopefully this'll
act as a reasonable base for people to work on.
Doh! SPI tests fail when the spidev package is installed (which it
normally isn't in my virtualenv) because hardware SPI always takes
precedence and the mock SPI stuff only replaces software SPI.
Factor out hardware SPI pin numbers; this is a effectively a rebase (and
minor modification) of @lurch's original patch which conflicted after
the merge of the remote-spi branch.
Ensure SourceMixin descendents shut down the source prior to closing.
Furthermore, make sure devices are closed before pin factory shuts down,
and that pins have a strong reference to their owning factory (to
prevent losing the factory before the pins).
Wrong classname in the software implementation and for some reason I'd
reverted a change on spi_flags somewhere... Also removed the clause
skipping remote pigpiod tests
Tested this commit with hardware and software SPI remotely - working
nicely
Also renamed GPIOZERO_INPUT_PIN to GPIOZERO_TEST_INPUT_PIN, and fixed up
the pigpio factory so it actually raises an exception if the connection
fails and we don't try and control the daemon anymore.