当前位置: 首页>>代码示例>>Python>>正文


Python TacticServerStub.query_snapshots方法代码示例

本文整理汇总了Python中tactic_client_lib.TacticServerStub.query_snapshots方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.query_snapshots方法的具体用法?Python TacticServerStub.query_snapshots怎么用?Python TacticServerStub.query_snapshots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tactic_client_lib.TacticServerStub的用法示例。


在下文中一共展示了TacticServerStub.query_snapshots方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Sample3dTest

# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import query_snapshots [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)

#.........这里部分代码省略.........
开发者ID:Southpaw-TACTIC,项目名称:TACTIC,代码行数:103,代码来源:sample3d_test.py


注:本文中的tactic_client_lib.TacticServerStub.query_snapshots方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。