def _parse_unit_plugs(self): unit_plugs = {} info = AvcConnection.get_unit_plug_info(self.fcp) for type, params in info.items(): if type not in unit_plugs: unit_plugs[type] = {} unit_plugs[type]['output'] = {} unit_plugs[type]['input'] = {} for dir, num in params.items(): for i in range(num + 1): try: plug = self._parse_unit_plug(dir, type, i) unit_plugs[type][dir][i] = plug except: continue return unit_plugs
def parse_unit_plugs(cls, fcp): unit_plugs = {} info = AvcConnection.get_unit_plug_info(fcp) for type, params in info.items(): if type not in unit_plugs: unit_plugs[type] = {} unit_plugs[type]['output'] = {} unit_plugs[type]['input'] = {} for dir, num in params.items(): for i in range(num + 1): try: plug = cls.parse_unit_plug(fcp, dir, type, i) unit_plugs[type][dir][i] = plug except Exception: continue return unit_plugs
def get_unit_plug_list(cls, fcp): plugs = {} seqid = 0 units = AvcConnection.get_unit_plug_info(fcp) for type, data in units.items(): for direction, count in data.items(): for plug_id in range(count): # Use the same format as Plug Input/Output Specific Data # to keep enough informaton. plug_info = { 'dir': direction, 'mode': 'unit', 'data': { 'unit-type': type, 'plug': plug_id, }, } plugs['unit_{0}'.format(seqid)] = plug_info seqid += 1 return plugs