mirror of
https://github.com/craigerl/aprsd.git
synced 2025-06-25 05:25:21 -04:00
pep8 fixes
This commit is contained in:
parent
638128adf8
commit
6b397cbdf1
@ -54,23 +54,11 @@ def _init_msgNo(): # noqa: N802
|
|||||||
|
|
||||||
def factory_from_dict(packet_dict):
|
def factory_from_dict(packet_dict):
|
||||||
pkt_type = get_packet_type(packet_dict)
|
pkt_type = get_packet_type(packet_dict)
|
||||||
# print(f"pkt_type {pkt_type}")
|
|
||||||
if pkt_type:
|
if pkt_type:
|
||||||
# if pkt_type == 'unknown':
|
|
||||||
# # try to determine it by the raw
|
|
||||||
# raw = packet_dict.get('raw')
|
|
||||||
# if raw:
|
|
||||||
# import aprslib
|
|
||||||
# type = get_packet_type(aprslib.parse(raw))
|
|
||||||
# print(f"raw type {type}")
|
|
||||||
|
|
||||||
cls = TYPE_LOOKUP[pkt_type]
|
cls = TYPE_LOOKUP[pkt_type]
|
||||||
# print(f"CLS {cls}")
|
|
||||||
|
|
||||||
return cls.from_dict(packet_dict)
|
return cls.from_dict(packet_dict)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def factory_from_json(packet_dict):
|
def factory_from_json(packet_dict):
|
||||||
pkt_type = get_packet_type(packet_dict)
|
pkt_type = get_packet_type(packet_dict)
|
||||||
if pkt_type:
|
if pkt_type:
|
||||||
@ -123,7 +111,6 @@ class Packet(metaclass=abc.ABCMeta):
|
|||||||
"""
|
"""
|
||||||
get the json formated string
|
get the json formated string
|
||||||
"""
|
"""
|
||||||
#return json.dumps(self.__dict__, cls=aprsd_json.EnhancedJSONEncoder)
|
|
||||||
return self.to_json()
|
return self.to_json()
|
||||||
|
|
||||||
def get(self, key, default=None):
|
def get(self, key, default=None):
|
||||||
@ -330,6 +317,7 @@ class RejectPacket(Packet):
|
|||||||
def _build_payload(self):
|
def _build_payload(self):
|
||||||
self.payload = f":{self.to_call.ljust(9)} :rej{self.msgNo}"
|
self.payload = f":{self.to_call.ljust(9)} :rej{self.msgNo}"
|
||||||
|
|
||||||
|
|
||||||
@dataclass_json
|
@dataclass_json
|
||||||
@dataclass(unsafe_hash=True)
|
@dataclass(unsafe_hash=True)
|
||||||
class MessagePacket(Packet):
|
class MessagePacket(Packet):
|
||||||
@ -478,13 +466,6 @@ class GPSPacket(Packet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class StatusPacket(Packet):
|
|
||||||
status: str = None
|
|
||||||
messagecapable: bool = False
|
|
||||||
comment: str = None
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class MicEPacket(GPSPacket):
|
class MicEPacket(GPSPacket):
|
||||||
messagecapable: bool = False
|
messagecapable: bool = False
|
||||||
|
@ -62,7 +62,6 @@ class PacketList(MutableMapping):
|
|||||||
def copy(self):
|
def copy(self):
|
||||||
return self.d.copy()
|
return self.d.copy()
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def maxlen(self):
|
def maxlen(self):
|
||||||
return self._maxlen
|
return self._maxlen
|
||||||
|
@ -236,6 +236,7 @@ def plugins():
|
|||||||
|
|
||||||
return "reloaded"
|
return "reloaded"
|
||||||
|
|
||||||
|
|
||||||
def _get_namespaces():
|
def _get_namespaces():
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
@ -259,13 +260,13 @@ def generate_oslo():
|
|||||||
generator.generate(CONF, string_out)
|
generator.generate(CONF, string_out)
|
||||||
return string_out.getvalue()
|
return string_out.getvalue()
|
||||||
|
|
||||||
|
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
@app.route("/oslo")
|
@app.route("/oslo")
|
||||||
def oslo():
|
def oslo():
|
||||||
return generate_oslo()
|
return generate_oslo()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
@app.route("/save")
|
@app.route("/save")
|
||||||
def save():
|
def save():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user