Commit 67051a3d authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Fix python upload error api

parent 28dc1e59
Pipeline #72279 passed with stages
in 31 minutes and 54 seconds
......@@ -278,7 +278,7 @@ PyVolumeDataAccessManager::initModule(py::module& m)
//AUTOGEN-END
// IMPLEMENTED : IVolumeDataAccessManager_.def("getCurrentUploadError" , static_cast<void(IVolumeDataAccessManager::*)(const char **, int32_t *, const char **)>(&IVolumeDataAccessManager::GetCurrentUploadError), py::arg("objectId").none(false), py::arg("errorCode").none(false), py::arg("errorString").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(IVolumeDataAccessManager_GetCurrentUploadError));
IVolumeDataAccessManager_.def("getCurrentUploadError" , [](IVolumeDataAccessManager* self)
IVolumeDataAccessManager_.def("getCurrentUploadError" , [](IVolumeDataAccessManager* self) -> py::object
{
const char
*pObjectID = nullptr,
......@@ -294,12 +294,12 @@ PyVolumeDataAccessManager::initModule(py::module& m)
}
else
{
return py::cast(Py_None);
return py::none();
}
}, OPENVDS_DOCSTRING(IVolumeDataAccessManager_GetCurrentUploadError));
// IMPLEMENTED : IVolumeDataAccessManager_.def("getCurrentDownloadError" , static_cast<void(IVolumeDataAccessManager::*)(int *, const char **)>(&IVolumeDataAccessManager::GetCurrentDownloadError), py::arg("code").none(false), py::arg("errorString").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(IVolumeDataAccessManager_GetCurrentDownloadError));
IVolumeDataAccessManager_.def("getCurrentDownloadError" , [](IVolumeDataAccessManager* self)
IVolumeDataAccessManager_.def("getCurrentDownloadError" , [](IVolumeDataAccessManager* self) -> py::object
{
const char
*pErrorString = nullptr;
......@@ -314,12 +314,12 @@ PyVolumeDataAccessManager::initModule(py::module& m)
}
else
{
return py::cast(Py_None);
return py::none();
}
}, OPENVDS_DOCSTRING(IVolumeDataAccessManager_GetCurrentDownloadError));
// IMPLEMENTED : VolumeDataAccessManager_.def("getCurrentUploadError" , static_cast<void(VolumeDataAccessManager::*)(const char **, int32_t *, const char **)>(&VolumeDataAccessManager::GetCurrentUploadError), py::arg("objectId").none(false), py::arg("errorCode").none(false), py::arg("errorString").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAccessManager_GetCurrentUploadError));
VolumeDataAccessManager_.def("getCurrentUploadError" , [](VolumeDataAccessManager* self)
VolumeDataAccessManager_.def("getCurrentUploadError" , [](VolumeDataAccessManager* self) -> py::object
{
const char
*pObjectID = nullptr,
......@@ -335,12 +335,12 @@ PyVolumeDataAccessManager::initModule(py::module& m)
}
else
{
return py::cast(Py_None);
return py::none();
}
}, OPENVDS_DOCSTRING(VolumeDataAccessManager_GetCurrentUploadError));
// IMPLEMENTED : VolumeDataAccessManager_.def("getCurrentDownloadError" , static_cast<void(VolumeDataAccessManager::*)(int *, const char **)>(&VolumeDataAccessManager::GetCurrentDownloadError), py::arg("code").none(false), py::arg("errorString").none(false), py::call_guard<py::gil_scoped_release>(), OPENVDS_DOCSTRING(VolumeDataAccessManager_GetCurrentDownloadError));
VolumeDataAccessManager_.def("getCurrentDownloadError" , [](VolumeDataAccessManager* self)
VolumeDataAccessManager_.def("getCurrentDownloadError" , [](VolumeDataAccessManager* self) -> py::object
{
const char
*pErrorString = nullptr;
......@@ -355,7 +355,7 @@ PyVolumeDataAccessManager::initModule(py::module& m)
}
else
{
return py::cast(Py_None);
return py::none();
}
}, OPENVDS_DOCSTRING(VolumeDataAccessManager_GetCurrentDownloadError));
......
......@@ -618,55 +618,55 @@ class VolumeDataAccessManager(object):
req._request = self._manager.prefetchVolumeChunk(req.dimensionsND, req.lod, req.channel, req.chunkIndex)
return req
def flushUploadQueue(self, writeUpdatedLayerStatus = True):
"""Flush any pending writes and write updated layer status.
Parameters
----------
writeUpdatedLayerStatus: bool, optional
Write the updated layer status (or only flush pending writes of chunks and chunk-metadata).
"""
self._manager.flushUploadQueue(writeUpdatedLayerStatus)
def clearUploadErrors(self):
"""Clear all upload errors that have been retrieved
"""
self._manager.clearUploadErrors(self)
def forceClearAllUploadErrors(self):
"""Clear all upload errors
"""
self._manager.forceClearAllUploadErrors()
def getUploadErrorCount(self):
"""Get the number of unretrieved upload errors
Returns
-------
count : int
The number of errors you can retrieve with getCurrentUploadError()
"""
return self._manager.getUploadErrorCount()
def getCurrentUploadError(self):
"""Get the next unretrieved upload error or an empty error if there are no more errors to retrieve
Returns
-------
error : Tuple(object: string, code: int, message: string)
An tuple indicating the error or None if there are no more errors
"""
return self._manager.getCurrentUploadError()
def getCurrentDownloadError(self):
"""Get the download error from the most recent operation that failed
Returns
-------
error : Tuple(code: int, message: string)
An tuple indicating the error or None if there is no error
"""
return self._manager.getCurrentDownloadError()
def flushUploadQueue(self, writeUpdatedLayerStatus = True):
"""Flush any pending writes and write updated layer status.
Parameters
----------
writeUpdatedLayerStatus: bool, optional
Write the updated layer status (or only flush pending writes of chunks and chunk-metadata).
"""
self._manager.flushUploadQueue(writeUpdatedLayerStatus)
def clearUploadErrors(self):
"""Clear all upload errors that have been retrieved
"""
self._manager.clearUploadErrors(self)
def forceClearAllUploadErrors(self):
"""Clear all upload errors
"""
self._manager.forceClearAllUploadErrors()
def getUploadErrorCount(self):
"""Get the number of unretrieved upload errors
Returns
-------
count : int
The number of errors you can retrieve with getCurrentUploadError()
"""
return self._manager.getUploadErrorCount()
def getCurrentUploadError(self):
"""Get the next unretrieved upload error or an empty error if there are no more errors to retrieve
Returns
-------
error : Tuple(object: string, code: int, message: string)
An tuple indicating the error or None if there are no more errors
"""
return self._manager.getCurrentUploadError()
def getCurrentDownloadError(self):
"""Get the download error from the most recent operation that failed
Returns
-------
error : Tuple(code: int, message: string)
An tuple indicating the error or None if there is no error
"""
return self._manager.getCurrentDownloadError()
##############################################################################
# 2D VolumeDataAccessors
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment