本文整理汇总了Python中indico.modules.ModuleHolder.getOfflineEventIndex方法的典型用法代码示例。如果您正苦于以下问题:Python ModuleHolder.getOfflineEventIndex方法的具体用法?Python ModuleHolder.getOfflineEventIndex怎么用?Python ModuleHolder.getOfflineEventIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indico.modules.ModuleHolder
的用法示例。
在下文中一共展示了ModuleHolder.getOfflineEventIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete_offline_events
# 需要导入模块: from indico.modules import ModuleHolder [as 别名]
# 或者: from indico.modules.ModuleHolder import getOfflineEventIndex [as 别名]
def delete_offline_events(dbi, logger):
logger.info("Checking which offline events should be deleted")
offline_events_module = ModuleHolder().getById("offlineEvents")
events = offline_events_module.getOfflineEventIndex()
for conf_requests in events.itervalues():
for req in conf_requests:
if req.status == "Generated" and req.creationTime and \
nowutc() - req.creationTime > timedelta(seconds=MAX_OFFLINE_WEBPAGE_LIFE):
logger.info("Deleting offline req {0}".format(req.id))
offline_events_module.removeOfflineFile(req)
logger.info("Deleted offline req {0}".format(req.id))