本文整理汇总了Python中datastore.DataStore.updateRecordWithComments方法的典型用法代码示例。如果您正苦于以下问题:Python DataStore.updateRecordWithComments方法的具体用法?Python DataStore.updateRecordWithComments怎么用?Python DataStore.updateRecordWithComments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datastore.DataStore
的用法示例。
在下文中一共展示了DataStore.updateRecordWithComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: analyzeBWFFile
# 需要导入模块: from datastore import DataStore [as 别名]
# 或者: from datastore.DataStore import updateRecordWithComments [as 别名]
#.........这里部分代码省略.........
#move to errorBox
try:
print "Moving file %s into %s" % (filePath, errorBox)
logging.debug("Moving file %s into %s" % (filePath, errorBox))
newPath = pathAfterSafelyMovingFileToDestinationFolder(filePath, errorBox)
except Exception as e:
logging.debug('Analyze File: Error moving file')
info = '''This should not happen as pathAfterSafelyMovingFileToDestinationFolder should create a unique name that avoids any collisions, otherwise the file has been moved'''
logging.debug(info)
info = 'There was a problem moving the file into into the errorBox for: ' + os.path.basename(filePath)
info = info + '\n' + 'This will require manual intervention as the occurrence is unique.'
sendProcessFailureMessage({'subject':'Process Error Moving File', 'message':info})
logging.debug(info)
continue
info = 'PreExisting Data for the following file %s: %s %s %s' % (os.path.basename(filePath), comments, vendor, status)
logging.debug(info)
resultObject['vendor'] = vendor
#The result object is not None as we would have bailed otherwise
if resultObject['result'] == 'success':
if comments == None:
comments = ''
#update Comments
comments = stringMinusBWFAnalyzerInfo(comments)
if comments != '':
comments += " "
comments += BWFAnalyzerInfoForSuccess(os.path.basename(filePath))
success = setComments(getDaisyNumber(os.path.basename(filePath)), comments)
#update local datastore
datastore.updateRecordWithComments(comments, record.id)
#did we successfully update the comments?
if success == True:
#update comments field in db and set to success
logging.debug('updating comments successfully')
datastore.successfullyUpdatedDaisyComments(record.id)
else:
#put infor in db that you couldn't update Daisy
logging.debug('not updating comments successfully')
datastore.failedToUpdateDaisyComments(record.id)
#update the status to pending fix
#only if the status is Needs Attention, otherwise we don't have any further knowledge of what is going on
nextStatus = 'NO CHANGE'
success = True
if status == "Needs Attention":
#ok to update status
success = setStatusAsPendingFix(getDaisyNumber(os.path.basename(filePath)))
nextStatus = 'Pending Fix'
if status in ['Being Made', 'Ordered']:
#ok to update status
success = setStatusAsPendingArchive(getDaisyNumber(os.path.basename(filePath)))
nextStatus = 'Pending Archive'
datastore.updateRecordWithDaisyStatus(nextStatus, record.id)
if success == True:
#update staus field in db and set to success
logging.debug('updating status successfully')
datastore.successfullyUpdatedDaisyStatus(record.id)
else:
#put infor in db that you couldn't update status in Daisy