mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Start of web interface
This commit is contained in:
@@ -49,8 +49,8 @@ class DXCluster(Provider):
|
||||
self.status = "Connecting"
|
||||
logging.info("DX Cluster " + self.hostname + " connecting...")
|
||||
self.telnet = telnetlib3.Telnet(self.hostname, self.port)
|
||||
self.telnet.read_until("login: ".encode("utf-8"))
|
||||
self.telnet.write((config["server-owner-callsign"] + "\n").encode("utf-8"))
|
||||
self.telnet.read_until("login: ".encode("latin-1"))
|
||||
self.telnet.write((config["server-owner-callsign"] + "\n").encode("latin-1"))
|
||||
connected = True
|
||||
logging.info("DX Cluster " + self.hostname + " connected.")
|
||||
except Exception as e:
|
||||
@@ -62,8 +62,8 @@ class DXCluster(Provider):
|
||||
while connected and self.run:
|
||||
try:
|
||||
# Check new telnet info against regular expression
|
||||
telnet_output = self.telnet.read_until("\n".encode("utf-8"))
|
||||
match = self.LINE_PATTERN.match(telnet_output.decode("utf-8"))
|
||||
telnet_output = self.telnet.read_until("\n".encode("latin-1"))
|
||||
match = self.LINE_PATTERN.match(telnet_output.decode("latin-1"))
|
||||
if match:
|
||||
spot_time = datetime.strptime(match.group(5), "%H%MZ")
|
||||
spot_datetime = datetime.combine(datetime.today(), spot_time.time()).replace(tzinfo=pytz.UTC)
|
||||
|
||||
Reference in New Issue
Block a user