Skip to content

Commit

Permalink
python3
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgimenez committed Aug 5, 2020
1 parent b949af3 commit 614a0b8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
2 changes: 1 addition & 1 deletion pyowfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# ««revision-date»»···
#--

from owfs import Connection
from .owfs import Connection

### __END__ __init__

Expand Down
2 changes: 1 addition & 1 deletion pyowfs/libcapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def emit (self, record) :

CACHE_MAX_AGE = 30 # seconds

class AlreadyInitialisedError (StandardError) :
class AlreadyInitialisedError (Exception) :
pass
# end class AlreadyInitialisedError

Expand Down
8 changes: 4 additions & 4 deletions pyowfs/owfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# when searching a sensor by it's 1wire id
# ««revision-date»»···
#--
import libcapi
from . import libcapi
import re
import logging

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 614a0b8

Please sign in to comment.