+class Connector:
+ name = None # connector name, e.g. "HDMI1"
+ edid = None # EDID string for the connector, or None if disconnected
+ resolutions = [] # list of Resolution objects, empty if disconnected
+
+ def __init__(self, name=None):
+ self.name = name
+ def __str__(self):
+ return str(self.name)
+ def isConnected(self):
+ assert (self.edid is None) == (len(self.resolutions)==0)
+ return self.edid is not None
+ def addResolution(self, resolution):
+ assert isinstance(resolution, Resolution)
+ self.resolutions.append(resolution)
+ def appendToEdid(self, s):
+ if self.edid is None:
+ self.edid = s
+ else:
+ self.edid += s