Ejemplo n.º 1
0
    def superClasses(softpkg):
        # Start with the superclasses from the pull mapping, overriding only
        # what's different for FRONTEND devices
        classes = PullComponentMapper.superClasses(softpkg)

        # Only plain devices are supported for FRONTEND
        if softpkg.type() == ComponentTypes.DEVICE:
            deviceinfo = PullComponentMapper.getImplementedInterfaces(softpkg)
            # If this device is any type of tuner, replace the Device_impl base
            # class with the FRONTEND-specific tuner device class
            if 'FrontendTuner' in deviceinfo:
                for parent in classes:
                    if parent['name'] == 'Device':
                        parent['name'] = 'FrontendTunerDevice'
                        parent['package'] = 'frontend'

                    # Set the parent to scanner if needed
                    if 'DigitalScanningTuner' in deviceinfo or 'AnalogScanningTuner' in deviceinfo:
                        if parent['name'] == 'FrontendTunerDevice':
                            parent['name'] = 'FrontendScannerDevice'

        return classes