本文整理汇总了Python中amo.utils.Message.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Message.delete方法的具体用法?Python Message.delete怎么用?Python Message.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类amo.utils.Message
的用法示例。
在下文中一共展示了Message.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: extract_file
# 需要导入模块: from amo.utils import Message [as 别名]
# 或者: from amo.utils.Message import delete [as 别名]
def extract_file(viewer, **kw):
msg = Message('file-viewer:%s' % viewer)
msg.delete()
task_log.info('[[email protected]%s] Unzipping %s for file viewer.' % (
extract_file.rate_limit, viewer))
try:
viewer.extract()
except Exception, err:
if settings.DEBUG:
msg.save(_('There was an error accessing file %s. %s.') %
(viewer, err))
else:
msg.save(_('There was an error accessing file %s.') % viewer)
task_log.error('[[email protected]%s] Error unzipping: %s' %
(extract_file.rate_limit, err))
示例2: extract_file
# 需要导入模块: from amo.utils import Message [as 别名]
# 或者: from amo.utils.Message import delete [as 别名]
def extract_file(viewer, **kw):
# This message is for end users so they'll see a nice error.
msg = Message("file-viewer:%s" % viewer)
msg.delete()
# This flag is so that we can signal when the extraction is completed.
flag = Message(viewer._extraction_cache_key())
task_log.debug("[[email protected]%s] Unzipping %s for file viewer." % (extract_file.rate_limit, viewer))
try:
viewer.extract()
except Exception, err:
if settings.DEBUG:
msg.save(_("There was an error accessing file %s. %s.") % (viewer, err))
else:
msg.save(_("There was an error accessing file %s.") % viewer)
task_log.error("[[email protected]%s] Error unzipping: %s" % (extract_file.rate_limit, err))