Mercurial > code > home > repos > light9
diff light9/collector/collector.py @ 1866:3c523c71da29
pyflakes cleanups and some refactors
Ignore-this: f7372e678699175feb4e628eee3d768c
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 25 May 2019 12:10:51 +0000 |
parents | 5bcb950024af |
children | 5cde72dfdc22 |
line wrap: on
line diff
--- a/light9/collector/collector.py Sat May 25 12:06:01 2019 +0000 +++ b/light9/collector/collector.py Sat May 25 12:10:51 2019 +0000 @@ -7,8 +7,9 @@ # types only from rdflib import Graph, URIRef -from typing import List, Dict, Tuple, Any, TypeVar, Generic +from typing import List, Dict, Tuple, TypeVar, Generic, Optional from light9.collector.output import Output +from light9.collector.weblisteners import WebListeners ClientType = TypeVar('ClientType') ClientSessionType = TypeVar('ClientSessionType') @@ -24,7 +25,7 @@ """ ret = {} - outputByUri = {} # universeUri : output + outputByUri: Dict[URIRef, Output] = {} # universeUri : output for out in outputs: outputByUri[out.uri] = out @@ -50,8 +51,11 @@ class Collector(Generic[ClientType, ClientSessionType]): - def __init__(self, graph, outputs, listeners=None, clientTimeoutSec=10): - # type: (Graph, List[Output], List[Listener], float) -> None + def __init__(self, + graph: Graph, + outputs: List[Output], + listeners: Optional[WebListeners] = None, + clientTimeoutSec: float = 10): self.graph = graph self.outputs = outputs self.listeners = listeners