def __getattr__(self, item):
        """Overload of RepsFromTo attribute retrieval.

        Allows external code to ignore substructures within the blob
        """
        if item in [ 'schedule', 'replica_flags', 'transport_guid',
                     'source_dsa_obj_guid', 'source_dsa_invocation_id',
                     'consecutive_sync_failures', 'last_success',
                     'last_attempt' ]:
            return getattr(self.__dict__['ndr_blob'].ctr, item)

        elif item in ['version']:
            return self.__dict__['ndr_blob'].version

        elif item in ['dns_name1']:
            if self.__dict__['ndr_blob'].version == 0x1:
                return self.__dict__['ndr_blob'].ctr.other_info.dns_name
            else:
                return self.__dict__['ndr_blob'].ctr.other_info.dns_name1

        elif item in ['dns_name2']:
            if self.__dict__['ndr_blob'].version == 0x1:
                raise AttributeError(item)
            else:
                return self.__dict__['ndr_blob'].ctr.other_info.dns_name2

        elif item in ['to_be_deleted']:
            return self.__dict__['to_be_deleted']

        elif item in ['nc_dnstr']:
            return self.__dict__['nc_dnstr']

        elif item in ['update_flags']:
            return self.__dict__['update_flags']

        raise AttributeError, "Unknwown attribute %s" % item
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/kcc_utils.py/RepsFromTo.__getattr__/original