Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/pybuddy-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import os
import pwd
import logging
from ConfigParser import RawConfigParser
from configparser import RawConfigParser


################
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(self, battery, buddy_product):
self.pumpMessage()
self.battery=battery
self.product=buddy_product
except NoBuddyException, e:
except NoBuddyException:
raise NoBuddyException()

# Commands are sent as disabled bits
Expand Down Expand Up @@ -331,7 +331,7 @@ def decode_buddy (buddy,msg):
'user': 'nobody',
'loglevel': 'info',
'logfile': 'console',
'usbproduct': 0002,
'usbproduct': 0x0002,
}
)

Expand Down Expand Up @@ -373,7 +373,7 @@ def decode_buddy (buddy,msg):
log.info("Starting search...")
try:
buddy=BuddyDevice(0, int(config.get("system", "usbproduct")))
except NoBuddyException, e:
except NoBuddyException:
log.error("Not found!")
sys.exit(1)

Expand Down Expand Up @@ -403,8 +403,9 @@ def decode_buddy (buddy,msg):
while 1:
try:
message, address = s.recvfrom(8192)
message2 = message.decode()
log.debug("Got data from %s", address)
decode_buddy(buddy, message)
decode_buddy(buddy, message2)

except (KeyboardInterrupt, SystemExit):
raise
Expand Down