Skip to content

Commit 7679080

Browse files
authored
Merge pull request robotpy#97 from auscompgeek/cs-fix-types
cameraserver: Fix typing errors
2 parents 30af40b + 362c0bf commit 7679080

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cscore/cameraserver.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def __init__(self):
243243
self._sinks = {} # type: Dict[str, VideoSink]
244244
self._tables = {} # type: Dict[int, networktables.NetworkTable]
245245
# source handle indexed by sink handle
246-
self._fixedSources = {} # type: Dict[int, int]
246+
self._fixedSources = {} # type: Dict[int, cscore.CvSource]
247247
self._publishTable = NetworkTables.getTable(self.kPublishName)
248248
self._nextPort = self.kBasePort
249249
self._addresses = []
@@ -376,7 +376,7 @@ def _onTableChange(self, event) -> None:
376376
return
377377

378378
sourceName = relativeKey[:subKeyIndex]
379-
source = self._sources.get(sourceName) # type: VideoSource
379+
source = self._sources.get(sourceName) # type: Optional[VideoSource]
380380
if source is None:
381381
return
382382

@@ -588,7 +588,7 @@ def getVideo(self, *, name=None, camera=None) -> cscore.CvSink:
588588

589589
name = "opencv_" + camera.getName()
590590

591-
sink = self._sinks.get(name) # type: cscore.VideoSink
591+
sink = self._sinks.get(name) # type: Optional[VideoSink]
592592
if sink is not None:
593593
kind = sink.getKind()
594594
if kind != VideoSink.Kind.kCv:
@@ -679,7 +679,7 @@ def removeServer(self, name: str) -> None:
679679
with self._mutex:
680680
self._sinks.pop(name, None)
681681

682-
def getServer(self, name: Optional[str] = None) -> VideoSink:
682+
def getServer(self, name: Optional[str] = None) -> VideoSource:
683683
"""Get server by name, or for the primary camera feed if no name is specified.
684684
685685
This is only valid to call after a camera feed has been added

0 commit comments

Comments
 (0)