本文整理汇总了Python中XSDataCommon.XSDataFile.parseString方法的典型用法代码示例。如果您正苦于以下问题:Python XSDataFile.parseString方法的具体用法?Python XSDataFile.parseString怎么用?Python XSDataFile.parseString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XSDataCommon.XSDataFile
的用法示例。
在下文中一共展示了XSDataFile.parseString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createDataCollectionFromImageHeaders
# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import parseString [as 别名]
def createDataCollectionFromImageHeaders(self, _edPlugin):
"""
This method creates a list of XSDataSubwedges by reading the header of the images
given as a list of paths as input.
"""
EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblev1_1.createDataCollectionFromImageHeaders")
xsDataInputSubWedgeAssemble = _edPlugin.getDataInput()
listXSDataFile = xsDataInputSubWedgeAssemble.getFile()
if (len(listXSDataFile) > 0):
listSubWedge = []
iIndex = 1
for xsDataFile in listXSDataFile:
xsDataFileCopy = XSDataFile.parseString(xsDataFile.marshal())
xsDataInputReadImageHeader = XSDataInputReadImageHeader()
xsDataInputReadImageHeader.setImage(xsDataFileCopy)
self.__edPluginReadImageHeader = self.loadPlugin(self.__strPluginReadImageHeaderName, "ReadImageHeader_%d" % (iIndex))
self.__edPluginReadImageHeader.setDataInput(xsDataInputReadImageHeader)
self.__edPluginReadImageHeader.executeSynchronous()
xsDataResultReadImageHeader = self.__edPluginReadImageHeader.getDataOutput()
bSuccess = False
if (xsDataResultReadImageHeader is not None):
xsDataSubWedge = xsDataResultReadImageHeader.getSubWedge()
if (xsDataSubWedge is not None):
xsDataSubWedge.setSubWedgeNumber(XSDataInteger(iIndex))
listSubWedge.append(xsDataSubWedge)
bSuccess = True
if (not bSuccess):
# Fix for bug #223: raise an error if an image could not be read
strErrorMessage = "EDPluginControlSubWedgeAssemblev1_1.createDataCollectionFromImageHeaders: %s %s" % (
self.__strPluginReadImageHeaderName, \
"Could not read header from image %s" % xsDataFileCopy.getPath().getValue())
EDVerbose.error(strErrorMessage)
self.addErrorMessage(strErrorMessage)
self.setFailure()
iIndex += 1
if (not self.isFailure()):
xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge()
for xsDataSubWedge in listSubWedge:
xsDataInputSubWedgeMerge.addSubWedge(xsDataSubWedge)
self.__edPluginSubWedgeMerge.setDataInput(xsDataInputSubWedgeMerge)
self.__edPluginSubWedgeMerge.executeSynchronous()
示例2: createDataCollectionFromImageHeaders
# 需要导入模块: from XSDataCommon import XSDataFile [as 别名]
# 或者: from XSDataCommon.XSDataFile import parseString [as 别名]
def createDataCollectionFromImageHeaders(self, _edPlugin):
"""
This method creates a list of XSDataSubwedges by reading the header of the images
given as a list of paths as input.
"""
EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblev10.createDataCollectionFromImageHeaders")
xsDataInputSubWedgeAssemble = _edPlugin.getDataInput()
listXSDataFile = xsDataInputSubWedgeAssemble.getFile()
if (len(listXSDataFile) > 0):
listSubWedge = []
iIndex = 1
for xsDataFile in listXSDataFile:
xsDataFileCopy = XSDataFile.parseString(xsDataFile.marshal())
xsDataInputReadImageHeader = XSDataInputReadImageHeader()
xsDataInputReadImageHeader.setImage(xsDataFileCopy)
self.__edPluginReadImageHeader = self.loadPlugin(self.__strPluginReadImageHeaderName, "ReadImageHeader_%d" % (iIndex))
self.__edPluginReadImageHeader.setDataInput(xsDataInputReadImageHeader)
self.__edPluginReadImageHeader.executeSynchronous()
xsDataResultReadImageHeader = self.__edPluginReadImageHeader.getDataOutput()
xsDataSubWedge = xsDataResultReadImageHeader.getSubWedge()
if (xsDataSubWedge is None):
# Fix for bug #223: raise an error if an image could not be read
errorMessage = EDMessage.ERROR_EXECUTION_03 % ("EDPluginControlSubWedgeAssemblev10.createDataCollectionFromImageHeaders", \
self.__strPluginReadImageHeaderName, \
"Could not read header from image %s" % xsDataFileCopy.getPath().getValue())
EDVerbose.error(errorMessage)
self.addErrorMessage(errorMessage)
raise RuntimeError, errorMessage
else:
listSubWedge.append(xsDataSubWedge)
iIndex += 1
xsDataInputSubWedgeMerge = XSDataInputSubWedgeMerge()
for xsDataSubWedge in listSubWedge:
xsDataInputSubWedgeMerge.addSubWedge(xsDataSubWedge)
self.__edPluginSubWedgeMerge.setDataInput(xsDataInputSubWedgeMerge)
self.__edPluginSubWedgeMerge.executeSynchronous()