Formatting
This commit is contained in:
parent
db1f845d0c
commit
21a7d38002
|
@ -316,8 +316,7 @@ class Client:
|
||||||
self.error_messages.add(msg)
|
self.error_messages.add(msg)
|
||||||
app.error(msg)
|
app.error(msg)
|
||||||
|
|
||||||
else:
|
else: print('ERROR: %s' % msg)
|
||||||
print ('ERROR: %s' % msg)
|
|
||||||
|
|
||||||
app.set_status(msg)
|
app.set_status(msg)
|
||||||
|
|
||||||
|
@ -327,8 +326,7 @@ class Client:
|
||||||
|
|
||||||
|
|
||||||
def process_message(self, app, type, data):
|
def process_message(self, app, type, data):
|
||||||
if debug:
|
if debug: print('message: %s %s' % (type, data))
|
||||||
print ('message: %s %s' % (type, data))
|
|
||||||
|
|
||||||
if type == 'heartbeat': return
|
if type == 'heartbeat': return
|
||||||
if type == 'ppd': self.process_ppd(app, data)
|
if type == 'ppd': self.process_ppd(app, data)
|
||||||
|
@ -361,7 +359,7 @@ class Client:
|
||||||
self.conn.messages = []
|
self.conn.messages = []
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print (e)
|
print(e)
|
||||||
|
|
||||||
# If client status has changed update UI
|
# If client status has changed update UI
|
||||||
newStatus = self.get_status()
|
newStatus = self.get_status()
|
||||||
|
@ -401,6 +399,6 @@ class Client:
|
||||||
self.conn.write_some()
|
self.conn.write_some()
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print (e)
|
print(e)
|
||||||
|
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
|
|
|
@ -37,6 +37,7 @@ if sys.platform == 'win32':
|
||||||
debug = False
|
debug = False
|
||||||
WSAEWOULDBLOCK = 10035
|
WSAEWOULDBLOCK = 10035
|
||||||
|
|
||||||
|
|
||||||
class Connection:
|
class Connection:
|
||||||
def __init__(self, address = 'localhost', port = 36330, password = None,
|
def __init__(self, address = 'localhost', port = 36330, password = None,
|
||||||
retry_rate = 5):
|
retry_rate = 5):
|
||||||
|
@ -218,7 +219,8 @@ class Connection:
|
||||||
|
|
||||||
if len(tokens) < 3:
|
if len(tokens) < 3:
|
||||||
self.readBuf = self.readBuf[eol:]
|
self.readBuf = self.readBuf[eol:]
|
||||||
raise Exception('Invalid PyON line: ' + line.encode('string_escape'))
|
raise Exception('Invalid PyON line: ' +
|
||||||
|
line.encode('string_escape'))
|
||||||
|
|
||||||
version = int(tokens[1])
|
version = int(tokens[1])
|
||||||
type = tokens[2]
|
type = tokens[2]
|
||||||
|
|
Loading…
Reference in New Issue