本文整理汇总了Python中snapshot.Snapshot.get_latest方法的典型用法代码示例。如果您正苦于以下问题:Python Snapshot.get_latest方法的具体用法?Python Snapshot.get_latest怎么用?Python Snapshot.get_latest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snapshot.Snapshot
的用法示例。
在下文中一共展示了Snapshot.get_latest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_parent_dir
# 需要导入模块: from snapshot import Snapshot [as 别名]
# 或者: from snapshot.Snapshot import get_latest [as 别名]
def get_parent_dir(my, search_type=None, context=None, sobject=None):
from project import Project
if not sobject:
sobject = my.sobject
if search_type:
parent = sobject.get_parent(search_type)
else:
search_type = sobject.get_value("search_type")
search_id = sobject.get_value("search_id")
parent = Search.get_by_id(search_type, search_id)
if not parent:
raise TacticException("No parent exists for '%s', possibly a result of Shot rename or removal." % sobject.get_code())
# just use the latest of the context desired
if context:
search_id = parent.get_id()
search_type = parent.get_search_type()
snapshot = Snapshot.get_latest(search_type, search_id, context)
else:
# basically this means that without a parent context, there is
# no way to know the directory this is in.
snapshot = None
dirs = Project._get_dir( my.protocol,parent,snapshot,None )
dirs = dirs.split("/")
return dirs