X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=loctrkd%2Fcollector.py;h=75cd33b861c374021c12d478631eff22c3cfcc4a;hb=cbb7603aebedf517d7b7c61ff6de02d3e7193409;hp=6fc606a14ecabcbe41c6aba94c69ca7ce5bc55f4;hpb=638b90f8096247b5cdb4317968d858e84c9a39d7;p=loctrkd.git diff --git a/loctrkd/collector.py b/loctrkd/collector.py index 6fc606a..75cd33b 100644 --- a/loctrkd/collector.py +++ b/loctrkd/collector.py @@ -18,6 +18,7 @@ from typing import Any, cast, Dict, List, Optional, Set, Tuple, Union import zmq from . import common +from .protomodule import ProtoModule from .zmsg import Bcast, Resp log = getLogger("loctrkd/collector") @@ -25,43 +26,6 @@ log = getLogger("loctrkd/collector") MAXBUFFER: int = 4096 -class ProtoModule: - class Stream: - def recv(self, segment: bytes) -> List[Union[bytes, str]]: - ... - - def close(self) -> bytes: - ... - - @staticmethod - def enframe(buffer: bytes, imei: Optional[str] = None) -> bytes: - ... - - @staticmethod - def probe_buffer(buffer: bytes) -> bool: - ... - - @staticmethod - def parse_message(packet: bytes, is_incoming: bool = True) -> Any: - ... - - @staticmethod - def inline_response(packet: bytes) -> Optional[bytes]: - ... - - @staticmethod - def is_goodbye_packet(packet: bytes) -> bool: - ... - - @staticmethod - def imei_from_packet(packet: bytes) -> Optional[str]: - ... - - @staticmethod - def proto_of_message(packet: bytes) -> str: - ... - - pmods: List[ProtoModule] = []