code formatting

This commit is contained in:
Jakob Ketterl 2019-08-18 00:16:08 +02:00
parent 5fab3e3d36
commit 73102053dc
3 changed files with 11 additions and 13 deletions

View File

@ -559,7 +559,9 @@ class dsp(object):
def try_create_configs(self, command):
if "{direwolf_config}" in command:
self.direwolf_config = "{tmp_dir}/openwebrx_direwolf_{myid}.conf".format(tmp_dir=self.temporary_directory, myid=id(self))
self.direwolf_config = "{tmp_dir}/openwebrx_direwolf_{myid}.conf".format(
tmp_dir=self.temporary_directory, myid=id(self)
)
self.direwolf_port = KissClient.getFreePort()
file = open(self.direwolf_config, "w")
file.write(DirewolfConfig().getConfig(self.direwolf_port))

View File

@ -195,10 +195,7 @@ class AprsParser(object):
comment = information[19:]
def decodeHeightGainDirectivity(comment):
res = {
"height": 2 ** int(comment[4]) * 10 * feetToMeters,
"gain": int(comment[5]),
}
res = {"height": 2 ** int(comment[4]) * 10 * feetToMeters, "gain": int(comment[5])}
directivity = int(comment[6])
if directivity == 0:
res["directivity"] = "omni"
@ -353,7 +350,7 @@ class MicEParser(object):
altitude = next((a for a in [altitude, insideAltitude] if a is not None), None)
return {
"fix": information[0] == ord("`") or information[0] == 0x1c,
"fix": information[0] == ord("`") or information[0] == 0x1C,
"lat": lat,
"lon": lon,
"comment": comment,

View File

@ -22,8 +22,7 @@ MODEM 1200
KISSPORT {port}
AGWPORT off
""".format(
port=port,
callsign=pm["aprs_callsign"],
port=port, callsign=pm["aprs_callsign"]
)
if pm["aprs_igate_enabled"]:
@ -31,9 +30,7 @@ AGWPORT off
IGSERVER {server}
IGLOGIN {callsign} {password}
""".format(
server=pm["aprs_igate_server"],
callsign=pm["aprs_callsign"],
password=pm["aprs_igate_password"],
server=pm["aprs_igate_server"], callsign=pm["aprs_callsign"], password=pm["aprs_igate_password"]
)
if pm["aprs_igate_beacon"]:
@ -43,7 +40,9 @@ IGLOGIN {callsign} {password}
config += """
PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat={lat} long={lon} comment="OpenWebRX APRS gateway"
""".format(lat=lat, lon=lon)
""".format(
lat=lat, lon=lon
)
return config
@ -57,7 +56,7 @@ class KissClient(object):
port = random.randrange(1024, 49151)
# test if port is available for use
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('localhost', port))
s.bind(("localhost", port))
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.close()
return port