Mercurial > hg > orthanc-python
changeset 207:968dbd6982bb
renamed variables to highlight that they are Python dictionaries
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Jul 2024 12:38:31 +0200 |
parents | 4e6079e27965 |
children | 315e1720a35f |
files | Sources/DicomScpCallbacks.cpp |
diffstat | 1 files changed, 24 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/Sources/DicomScpCallbacks.cpp Wed Jul 03 12:36:01 2024 +0200 +++ b/Sources/DicomScpCallbacks.cpp Wed Jul 03 12:38:31 2024 +0200 @@ -232,7 +232,7 @@ { PythonLock lock; - PythonObject kw(lock, PyDict_New()); + PythonObject dict(lock, PyDict_New()); std::string level; switch (resourceType_) @@ -259,58 +259,58 @@ { PythonString tmp(lock, level); - PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "Level", tmp.GetPyObject()); } { PythonString tmp(lock, patientId_); - PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "PatientID", tmp.GetPyObject()); } { PythonString tmp(lock, accessionNumber_); - PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); } { PythonString tmp(lock, studyInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, seriesInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, sopInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, originatorAet_); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); } { PythonString tmp(lock, sourceAet_); - PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SourceAET", tmp.GetPyObject()); } { PythonString tmp(lock, targetAet_); - PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "TargetAET", tmp.GetPyObject()); } { PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId_)); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "OriginatorID", tmp.GetPyObject()); } PythonObject args(lock, PyTuple_New(0)); assert(moveScpCallback_ != NULL); - PythonObject result(lock, PyObject_Call(moveScpCallback_, args.GetPyObject(), kw.GetPyObject())); + PythonObject result(lock, PyObject_Call(moveScpCallback_, args.GetPyObject(), dict.GetPyObject())); OrthancPluginErrorCode code = lock.CheckCallbackSuccess("Python C-MOVE SCP callback"); if (code != OrthancPluginErrorCode_Success) @@ -421,7 +421,7 @@ PythonLock lock; - PythonObject kw(lock, PyDict_New()); + PythonObject dict(lock, PyDict_New()); std::string level; switch (resourceType) @@ -448,52 +448,52 @@ { PythonString tmp(lock, level); - PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "Level", tmp.GetPyObject()); } { PythonString tmp(lock, _patientId); - PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "PatientID", tmp.GetPyObject()); } { PythonString tmp(lock, _accessionNumber); - PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); } { PythonString tmp(lock, _studyInstanceUid); - PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, _seriesInstanceUid); - PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, _sopInstanceUid); - PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, _originatorAet); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); } { PythonString tmp(lock, _sourceAet); - PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "SourceAET", tmp.GetPyObject()); } { PythonString tmp(lock, _targetAet); - PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "TargetAET", tmp.GetPyObject()); } { PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId)); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject()); + PyDict_SetItemString(dict.GetPyObject(), "OriginatorID", tmp.GetPyObject()); } PythonObject args(lock, PyTuple_New(0)); @@ -502,7 +502,7 @@ // the result is the python move driver that will be passed as first argument to GetMoveSize, Apply and Free. // After the PyObject_Call, result's ref count is 1 -> no need to add a reference but we need to decref explicitely // to delete the object at the end of the move. - PyObject* result = PyObject_Call(createMoveScpDriverCallback_, args.GetPyObject(), kw.GetPyObject()); + PyObject* result = PyObject_Call(createMoveScpDriverCallback_, args.GetPyObject(), dict.GetPyObject()); OrthancPluginErrorCode code = lock.CheckCallbackSuccess("Python C-MOVE SCP callback (Create)"); if (code != OrthancPluginErrorCode_Success)