minor code clean up in IS class
This commit is contained in:
parent
0026655100
commit
cffc7219bb
|
|
@ -63,17 +63,6 @@ class IS(object):
|
||||||
self._connected = False
|
self._connected = False
|
||||||
self.buf = ''
|
self.buf = ''
|
||||||
|
|
||||||
def callsign_filter(self, callsigns):
|
|
||||||
"""
|
|
||||||
Sets a filter for the specified callsigns.
|
|
||||||
Only those will be sent to us by the server
|
|
||||||
"""
|
|
||||||
|
|
||||||
if type(callsigns) is not list or len(callsigns) == 0:
|
|
||||||
return False
|
|
||||||
|
|
||||||
return self.set_filter("b/%s" % "/".join(callsigns))
|
|
||||||
|
|
||||||
def set_filter(self, filter_text):
|
def set_filter(self, filter_text):
|
||||||
"""
|
"""
|
||||||
Set a specified aprs-is filter for this connection
|
Set a specified aprs-is filter for this connection
|
||||||
|
|
@ -85,8 +74,6 @@ class IS(object):
|
||||||
if self._connected:
|
if self._connected:
|
||||||
self.sock.sendall("#filter %s\r\n" % self.filter)
|
self.sock.sendall("#filter %s\r\n" % self.filter)
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
def set_login(self, callsign, passwd):
|
def set_login(self, callsign, passwd):
|
||||||
"""
|
"""
|
||||||
Set callsign and password
|
Set callsign and password
|
||||||
|
|
@ -105,7 +92,9 @@ class IS(object):
|
||||||
Initiate connection to APRS server and attempt to login
|
Initiate connection to APRS server and attempt to login
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not self._connected:
|
if self._connected:
|
||||||
|
return
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.logger.info("Attempting connection to %s:%s", self.server[0], self.server[1])
|
self.logger.info("Attempting connection to %s:%s", self.server[0], self.server[1])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue