本文整理汇总了Python中tactic_client_lib.TacticServerStub.get_all_children方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.get_all_children方法的具体用法?Python TacticServerStub.get_all_children怎么用?Python TacticServerStub.get_all_children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tactic_client_lib.TacticServerStub
的用法示例。
在下文中一共展示了TacticServerStub.get_all_children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Sample3dTest
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import get_all_children [as 别名]
class Sample3dTest(unittest.TestCase):
def setUp(self):
pass
def test_all(self):
print "Running Sample3d Test"
from pyasm.security import Batch
from pyasm.biz import Project
Batch()
Project.set_project("sample3d")
#self.server = TacticServerStub(protocol="local")
self.server = TacticServerStub(protocol="xmlrpc")
project_code = "sample3d"
self.server.set_project(project_code)
self.server.start("Sample3d Test")
try:
self._test_create_search_type()
self._test_create_submission()
self._test_get_submission()
self._test_shot_sequence_hierarchy()
self._test_query_snapshots()
#self._test_performance()
except Exception:
self.server.abort()
raise
self.server.abort()
#try:
# self.server.query("prod/asset")
#except Exception:
# self.server.abort()
# raise
#self.server.abort()
def _test_query_snapshots(self):
filters = []
filters.append( ['context', 'model'] )
filters.append( ['search_type', 'prod/asset?project=sample3d'] )
snapshots = self.server.query_snapshots(filters=filters, include_paths=True)
import time
start = time.time()
for snapshot in snapshots:
print snapshot.get('__search_key__')
print snapshot.get('__paths__')
print "parent: ", snapshot.get('__parent__')
print time.time() - start
def _test_create_search_type(self):
search_type = 'test'
search_type_obj = self.server.create_search_type(search_type)
print search_type_obj
def _test_performance(self):
for i in range(0,1):
assets = self.server.query("prod/asset")
for asset in assets:
asset_key = asset.get("__search_key__")
snapshots = self.server.get_all_children(asset_key,'sthpw/snapshot')
#snapshot = self.server.get_snapshot(asset_key,context='model', include_paths=True)
#print snapshot.get('__paths__')
def _test_get_submission(self):
server = TacticServerStub()
server.set_project("sample3d")
# choose some arbitrary bin
bin_id = 4
filters = []
filters.append( ['bin_id', bin_id] )
connectors = server.query("prod/submission_in_bin", filters)
# get all of the submissions from the bin
submission_ids = [x.get('submission_id') for x in connectors]
filters = [ ['id', submission_ids] ]
submissions = server.query("prod/submission", filters)
#.........这里部分代码省略.........