diff --git a/__init__.py b/__init__.py index 1a2dd96..1ff53b3 100644 --- a/__init__.py +++ b/__init__.py @@ -9,7 +9,7 @@ from flask import Blueprint, render_template, request from modules.core.props import Property -from pyowfs import Connection +from .pyowfs import Connection blueprint = Blueprint('one_wire_owfs', __name__) diff --git a/pyowfs/__init__.py b/pyowfs/__init__.py index 2ec0cfb..e606505 100644 --- a/pyowfs/__init__.py +++ b/pyowfs/__init__.py @@ -30,7 +30,7 @@ # ««revision-date»»··· #-- -from owfs import Connection +from .owfs import Connection ### __END__ __init__ diff --git a/pyowfs/libcapi.py b/pyowfs/libcapi.py index 58e465c..44cd584 100644 --- a/pyowfs/libcapi.py +++ b/pyowfs/libcapi.py @@ -57,7 +57,7 @@ def emit (self, record) : CACHE_MAX_AGE = 30 # seconds -class AlreadyInitialisedError (StandardError) : +class AlreadyInitialisedError (Exception) : pass # end class AlreadyInitialisedError diff --git a/pyowfs/owfs.py b/pyowfs/owfs.py index dcb91e3..e0d390d 100644 --- a/pyowfs/owfs.py +++ b/pyowfs/owfs.py @@ -37,7 +37,7 @@ # when searching a sensor by it's 1wire id # ««revision-date»»··· #-- -import libcapi +from . import libcapi import re import logging @@ -124,7 +124,7 @@ def put (self, key, value) : This resembles a write access to self.path/key. """ - if self.has_key (key) and not isinstance (self.get (key), Dir) : + if key in self and not isinstance (self.get (key), Dir) : val = str (value) return self.capi.put ("%s%s" % (self.path, key), val) # end def put @@ -194,8 +194,8 @@ def find (self, **kw) : continue failed = False - for k, v in kw.iteritems () : - if not sensor.has_key (k) : + for k, v in kw.items () : + if k not in sensor : failed = True elif sensor.get (k, cached = cached) != v : failed = True