remove sdr.hu parts

This commit is contained in:
Jakob Ketterl
2020-06-01 15:58:15 +02:00
parent 1019ed5793
commit ebd1e04414
5 changed files with 0 additions and 109 deletions

View File

@ -9,7 +9,6 @@ from owrx.config import Config
from owrx.feature import FeatureDetector
from owrx.sdr import SdrService
from socketserver import ThreadingMixIn
from owrx.sdrhu import SdrHuUpdater
from owrx.service import Services
from owrx.websocket import WebSocketConnection
from owrx.pskreporter import PskReporter
@ -59,10 +58,6 @@ Support and info: https://groups.io/g/openwebrx
# Get error messages about unknown / unavailable features as soon as possible
SdrService.loadProps()
if "sdrhu_key" in pm and pm["sdrhu_public_listing"]:
updater = SdrHuUpdater()
updater.start()
Services.start()
try:

View File

@ -244,18 +244,6 @@ class GeneralSettingsController(AdminController):
infotext="This callsign will be used to send spots to pskreporter.info",
),
),
Section(
"sdr.hu",
TextInput(
"sdrhu_key",
"sdr.hu key",
infotext='Please obtain your personal key on <a href="https://sdr.hu" target="_blank">sdr.hu</a>',
),
CheckboxInput(
"sdrhu_public_listing", "List on sdr.hu", "List my receiver on sdr.hu"
),
TextInput("server_hostname", "Hostname"),
),
]
def render_sections(self):

View File

@ -1,43 +0,0 @@
import threading
import time
from owrx.config import Config
from urllib import request, parse
import logging
logger = logging.getLogger(__name__)
class SdrHuUpdater(threading.Thread):
def __init__(self):
self.doRun = True
super().__init__(daemon=True)
def update(self):
pm = Config.get().filter("server_hostname", "web_port", "sdrhu_key")
data = parse.urlencode({
"url": "http://{server_hostname}:{web_port}".format(**pm.__dict__()),
"apikey": pm["sdrhu_key"]
}).encode()
res = request.urlopen("https://sdr.hu/update", data=data)
if res.getcode() < 200 or res.getcode() >= 300:
logger.warning('sdr.hu update failed with error code %i', res.getcode())
return 2
returned = res.read().decode("utf-8")
if "UPDATE:" not in returned:
logger.warning("Update failed, your receiver cannot be listed on sdr.hu!")
return 2
value = returned.split("UPDATE:")[1].split("\n", 1)[0]
if value.startswith("SUCCESS"):
logger.info("Update succeeded!")
else:
logger.warning("Update failed, your receiver cannot be listed on sdr.hu! Reason: %s", value)
return 20
def run(self):
while self.doRun:
retrytime_mins = self.update()
time.sleep(60 * retrytime_mins)