def info(self):
		'''
		Return cpl_object_info_t corresponding to the current object.
		'''
		objectpp = CPLDirect.new_cpl_object_info_tpp()

		ret = CPLDirect.cpl_get_object_info(self.id,
		    CPLDirect.cpl_convert_pp_cpl_object_info_t(objectpp))
		if not CPLDirect.cpl_is_ok(ret):
			CPLDirect.delete_cpl_object_info_tpp(objectpp)
			raise Exception('Unable to get object info: ' +
					CPLDirect.cpl_error_string(ret))

		op = CPLDirect.cpl_dereference_pp_cpl_object_info_t(objectpp)
		object = CPLDirect.cpl_object_info_tp_value(op)

		if object.container_id == NONE or object.container_version < 0:
			container = None
		else:
			container = cpl_object_version(cpl_object(object.container_id),
					object.container_version)

		_info = cpl_object_info(self, object.version,
				cpl_session(object.creation_session), object.creation_time,
				object.originator, object.name, object.type, container)

		CPLDirect.cpl_free_object_info(op)
		CPLDirect.delete_cpl_object_info_tpp(objectpp)

		return _info
Exemplo n.º 2
0
    def info(self):
        '''
		Return cpl_object_info_t corresponding to the current object.
		'''
        objectpp = CPLDirect.new_cpl_object_info_tpp()

        ret = CPLDirect.cpl_get_object_info(
            self.id, CPLDirect.cpl_convert_pp_cpl_object_info_t(objectpp))
        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_cpl_object_info_tpp(objectpp)
            raise Exception('Unable to get object info: ' +
                            CPLDirect.cpl_error_string(ret))

        op = CPLDirect.cpl_dereference_pp_cpl_object_info_t(objectpp)
        object = CPLDirect.cpl_object_info_tp_value(op)

        if object.container_id == NONE or object.container_version < 0:
            container = None
        else:
            container = cpl_object_version(cpl_object(object.container_id),
                                           object.container_version)

        _info = cpl_object_info(self, object.version,
                                cpl_session(object.creation_session),
                                object.creation_time, object.originator,
                                object.name, object.type, container)

        CPLDirect.cpl_free_object_info(op)
        CPLDirect.delete_cpl_object_info_tpp(objectpp)

        return _info
Exemplo n.º 3
0
    def info(self):
        '''
        Return cpl_object_info_t corresponding to the current object.
        '''
        objectpp = CPLDirect.new_cpl_object_info_tpp()

        ret = CPLDirect.cpl_get_object_info(
            self.id, CPLDirect.cpl_convert_pp_cpl_object_info_t(objectpp))
        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_cpl_object_info_tpp(objectpp)
            raise CPLException(
                'Unable to get object info: ' +
                CPLDirect.cpl_error_string(ret), ret)

        op = CPLDirect.cpl_dereference_pp_cpl_object_info_t(objectpp)
        object = CPLDirect.cpl_object_info_tp_value(op)

        if object.bundle_id == NONE:
            bundle = None
        else:
            bundle = cpl_bundle(object.bundle_id)

        _info = cpl_object_info(self, object.creation_time, object.prefix,
                                object.name, object.type, bundle)

        CPLDirect.cpl_free_object_info(op)
        CPLDirect.delete_cpl_object_info_tpp(objectpp)

        return _info
Exemplo n.º 4
0
    def info(self):
        '''
        Return cpl_object_info_t corresponding to the current object.
        '''
        objectpp = CPLDirect.new_cpl_object_info_tpp()

        ret = CPLDirect.cpl_get_object_info(self.id,
            CPLDirect.cpl_convert_pp_cpl_object_info_t(objectpp))
        if not CPLDirect.cpl_is_ok(ret):
            CPLDirect.delete_cpl_object_info_tpp(objectpp)
            raise CPLException('Unable to get object info: ' +
                    CPLDirect.cpl_error_string(ret), ret)

        op = CPLDirect.cpl_dereference_pp_cpl_object_info_t(objectpp)
        object = CPLDirect.cpl_object_info_tp_value(op)

        if object.bundle_id == NONE:
            bundle = None
        else:
            bundle = cpl_bundle(object.bundle_id)

        _info = cpl_object_info(self,
                object.creation_time,
                object.prefix, object.name, object.type, bundle)

        CPLDirect.cpl_free_object_info(op)
        CPLDirect.delete_cpl_object_info_tpp(objectpp)

        return _info