X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=blobdiff_plain;f=gps303%2Ftermconfig.py;h=eb3150b49a17065aed2fc1d8898bc80ffa4e28b7;hp=b9517f0af80284be60df5a4c4a6ef87bbaa9f9e9;hb=380ccd781fef5b1ee98e9660c748c8955d3bf40e;hpb=97da2d4a24e4023ae5fa83012a1e70d32373f275 diff --git a/gps303/termconfig.py b/gps303/termconfig.py index b9517f0..eb3150b 100644 --- a/gps303/termconfig.py +++ b/gps303/termconfig.py @@ -1,5 +1,6 @@ """ For when responding to the terminal is not trivial """ +from configparser import ConfigParser from datetime import datetime, timezone from logging import getLogger from struct import pack @@ -12,10 +13,11 @@ from .zmsg import Bcast, Resp, topic log = getLogger("gps303/termconfig") -def runserver(conf): +def runserver(conf: ConfigParser) -> None: termconfig = common.normconf(conf["termconfig"]) - zctx = zmq.Context() - zsub = zctx.socket(zmq.SUB) + # Is this https://github.com/zeromq/pyzmq/issues/1627 still not fixed?! + zctx = zmq.Context() # type: ignore + zsub = zctx.socket(zmq.SUB) # type: ignore zsub.connect(conf.get("collector", "publishurl")) for proto in ( STATUS.PROTO, @@ -23,7 +25,7 @@ def runserver(conf): POSITION_UPLOAD_INTERVAL.PROTO, ): zsub.setsockopt(zmq.SUBSCRIBE, topic(proto)) - zpush = zctx.socket(zmq.PUSH) + zpush = zctx.socket(zmq.PUSH) # type: ignore zpush.connect(conf.get("collector", "listenurl")) try: