本文整理汇总了Python中snapshot.Snapshot.restore方法的典型用法代码示例。如果您正苦于以下问题:Python Snapshot.restore方法的具体用法?Python Snapshot.restore怎么用?Python Snapshot.restore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snapshot.Snapshot
的用法示例。
在下文中一共展示了Snapshot.restore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: restore_snapshot
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import restore [as 别名]
def restore_snapshot(self, file, version=None):
if not file:
self.logger.info("Please enter a valid filename.")
return None
s = Snapshot(file)
s.restore(version)
示例2: run
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import restore [as 别名]
def run():
log.info('start')
print 'Start serving idxd...'
idx = PfrIndex(config.IDX_FILENAME)
snapshot_manager = Snapshot()
if not idx.validate() and \
not snapshot_manager.restore(PfrIndex) and \
not idx.create():
print "Please, close all connections to DB and try again."
return -1
Events = namedtuple("Events", "stop endupdate")
events = Events(Event(), Event())
__serve_forever( \
__start_search_daemon(config.IDX_WEBSERVER_PORT, events), \
__start_update_daemon((config.KANSO_FILENAME, config.KANSO_FILENAME2), events), \
events)