예제 #1
0
    def lookup_all_objects(self, prefix, name, type, bundle):
        '''
        Return all objects that have the specified prefix, name,
        type, or bundle.
        '''

        bundle = bundle.id
        vp = CPLDirect.new_std_vector_cpl_id_timestamp_tp()
        ret = CPLDirect.cpl_lookup_object_ext(
            prefix, name, type, bundle, L_NO_FAIL,
            CPLDirect.cpl_cb_collect_id_timestamp_vector, vp)

        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
            raise CPLException(
                'Unable to lookup all objects: ' +
                CPLDirect.cpl_error_string(ret), ret)

        v = CPLDirect.cpl_dereference_p_std_vector_cpl_id_timestamp_t(vp)
        l = []
        if v != S_NO_DATA:
            for e in v:
                l.append(cpl_object(e.id))

        CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
        return l
	def lookup_all(self, originator, name, type):
		'''
		Return all objects that have the specified originator, name,
		and type (they might differ by container).
		'''
		vp = CPLDirect.new_std_vector_cpl_id_timestamp_tp()
		ret = CPLDirect.cpl_lookup_object_ext(originator, name, type,
			L_NO_FAIL, CPLDirect.cpl_cb_collect_id_timestamp_vector, vp)

		if not CPLDirect.cpl_is_ok(ret):
			CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
			raise Exception('Unable to lookup all objects: ' +
					CPLDirect.cpl_error_string(ret))

		v = CPLDirect.cpl_dereference_p_std_vector_cpl_id_timestamp_t(vp)
		l = []
		if v != S_NO_DATA :
			for e in v:
				l.append(cpl_object(e.id))

		CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
		return l
예제 #3
0
    def lookup_all_bundles(self, name):
        '''
        Return all bundles that have the specified name
        '''

        vp = CPLDirect.new_std_vector_cpl_id_timestamp_tp()
        ret = CPLDirect.cpl_lookup_bundle_ext(name,
            L_NO_FAIL, CPLDirect.cpl_cb_collect_id_timestamp_vector, vp)

        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
            raise CPLException('Unable to lookup all bundles: ' +
                    CPLDirect.cpl_error_string(ret), ret)

        v = CPLDirect.cpl_dereference_p_std_vector_cpl_id_timestamp_t(vp)
        l = []
        if v != S_NO_DATA :
            for e in v:
                l.append(cpl_object(e.id))

        CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
        return l
예제 #4
0
    def lookup_all(self, originator, name, type):
        '''
		Return all objects that have the specified originator, name,
		and type (they might differ by container).
		'''
        vp = CPLDirect.new_std_vector_cpl_id_timestamp_tp()
        ret = CPLDirect.cpl_lookup_object_ext(
            originator, name, type, L_NO_FAIL,
            CPLDirect.cpl_cb_collect_id_timestamp_vector, vp)

        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
            raise Exception('Unable to lookup all objects: ' +
                            CPLDirect.cpl_error_string(ret))

        v = CPLDirect.cpl_dereference_p_std_vector_cpl_id_timestamp_t(vp)
        l = []
        if v != S_NO_DATA:
            for e in v:
                l.append(cpl_object(e.id))

        CPLDirect.delete_std_vector_cpl_id_timestamp_tp(vp)
        return l