Fix broken dependency linearization.
authorW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 02:20:20 +0000 (22:20 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Oct 2012 02:20:20 +0000 (22:20 -0400)
commit165a45dca9dd31ee9b31f1b1c7fce15217feb451
tree150b19bbc10309774a67b4533fcc63ec97006fc2
parent3645a503ce202da6601339efd227645cfb1e0b0d
Fix broken dependency linearization.

I had tried to break circular dependencies with:

  commit c19dd6ff6ce26beaf1b0ffc57d505b71898f8d0f
  Author: W. Trevor King <wking@tremily.us>
  Date:   Fri Oct 19 08:58:34 2012 -0400

    Break circular dependencies for Python 3 compatibility.

Which was causing errors like:

  Exception AttributeError:
    "'pycomedi.device.Device' object has no attribute 'device'"
    in 'pycomedi.subdevice.Subdevice._device'

because when you treat Device instances as Python objects, you cannot
access their private (C-only) attributes.  This commit avoids that
problem by adding low level classes (DeviceHolder and SubdeviceHolder)
that can be imported by both the high level classes (Device and
Subdevice) and their users (Subdevice and Channel), avoiding circular
dependencies while preserving critical C-only attributes.
doc/module_dependencies.txt
pycomedi/channel.pyx
pycomedi/device.pxd
pycomedi/device.pyx
pycomedi/device_holder.pxd [new file with mode: 0644]
pycomedi/device_holder.pyx [new file with mode: 0644]
pycomedi/subdevice.pxd
pycomedi/subdevice.pyx
pycomedi/subdevice_holder.pxd [new file with mode: 0644]
pycomedi/subdevice_holder.pyx [new file with mode: 0644]