From d08e939f40b344c69edf4d7b3c694d9ac81adae4 Mon Sep 17 00:00:00 2001 From: shrkey Date: Thu, 29 Sep 2016 22:19:25 +0100 Subject: [PATCH] updating for python 3 --- darkwater_640/I2C.py | 8 ++++---- darkwater_640/PCA9685.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/darkwater_640/I2C.py b/darkwater_640/I2C.py index a45a21d..87fcee8 100644 --- a/darkwater_640/I2C.py +++ b/darkwater_640/I2C.py @@ -19,10 +19,10 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -import logging -import subprocess +import .logging +import .subprocess -import Platform as Platform +import .Platform as Platform def reverseByteOrder(data): @@ -93,7 +93,7 @@ class Device(object): self._address = address if i2c_interface is None: # Use pure python I2C interface if none is specified. - import smbus + import .smbus self._bus = smbus.SMBus(busnum) else: # Otherwise use the provided class to create an smbus interface. diff --git a/darkwater_640/PCA9685.py b/darkwater_640/PCA9685.py index f982701..f08a679 100644 --- a/darkwater_640/PCA9685.py +++ b/darkwater_640/PCA9685.py @@ -71,7 +71,7 @@ class PCA9685(object): """Initialize the PCA9685.""" # Setup I2C interface for the device. if i2c is None: - import I2C as I2C + from .I2C import I2C as I2C i2c = I2C self._device = i2c.get_i2c_device(address, **kwargs) self.set_all_pwm(0, 0)