本文整理汇总了Python中tactic_client_lib.TacticServerStub.get_by_search_key方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.get_by_search_key方法的具体用法?Python TacticServerStub.get_by_search_key怎么用?Python TacticServerStub.get_by_search_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tactic_client_lib.TacticServerStub
的用法示例。
在下文中一共展示了TacticServerStub.get_by_search_key方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import get_by_search_key [as 别名]
def execute(my):
#protocol = 'xmlrpc'
protocol = 'local'
if protocol == 'local':
server = TacticServerStub.get()
else:
server = TacticServerStub(protocol=protocol,setup=False)
TacticServerStub.set(server)
project = my.data.get("project")
ticket = my.data.get("ticket")
assert project
assert ticket
server.set_server("localhost")
server.set_project(project)
server.set_ticket(ticket)
my.class_name = my.data.get('class_name')
assert my.class_name
# get the script to run
script_code = my.data.get("script_code")
if script_code:
search_type = "config/custom_script"
search_key = server.build_search_key(search_type, script_code)
script_obj = server.get_by_search_key(search_key)
script = script_obj.get('script')
my.run_script(script)
else:
print "Nothing to run"
示例2: _test_create_submission
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import get_by_search_key [as 别名]
def _test_create_submission(self):
server = TacticServerStub()
server.set_project("sample3d")
# choose some arbitrary bin
bin_id = 4
filters = []
# asset
parent_type = "prod/asset"
parent_code = "chr001"
parent_key = server.build_search_key(parent_type, parent_code)
parent = server.get_by_search_key(parent_key)
parent_id = parent.get('id')
# create a submission
data = {
'description': 'A test submission',
'artist': 'joe',
'context': 'model'
}
submission = server.insert("prod/submission", data, parent_key=parent_key)
submission_key = submission.get('__search_key__')
submission_id = submission.get('id')
file_path = './miso_ramen.jpg'
context = "publish"
snapshot = server.simple_checkin(submission_key, context, file_path, mode="upload")
# no connect to the bin with a connector
data = {
"bin_id": bin_id,
'submission_id': submission_id
}
server.insert("prod/submission_in_bin", data)
示例3: Sample3dTest
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import get_by_search_key [as 别名]
#.........这里部分代码省略.........
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)
# get all of the snapshots from the submissions
for submission in submissions:
search_key = submission.get('__search_key__')
print "-"*20
snapshot = server.get_snapshot(search_key, include_paths=True)
paths = snapshot.get('__paths__')
for path in paths:
print path
def _test_create_submission(self):
server = TacticServerStub()
server.set_project("sample3d")
# choose some arbitrary bin
bin_id = 4
filters = []
# asset
parent_type = "prod/asset"
parent_code = "chr001"
parent_key = server.build_search_key(parent_type, parent_code)
parent = server.get_by_search_key(parent_key)
parent_id = parent.get('id')
# create a submission
data = {
'description': 'A test submission',
'artist': 'joe',
'context': 'model'
}
submission = server.insert("prod/submission", data, parent_key=parent_key)
submission_key = submission.get('__search_key__')
submission_id = submission.get('id')
file_path = './miso_ramen.jpg'
context = "publish"
snapshot = server.simple_checkin(submission_key, context, file_path, mode="upload")
# no connect to the bin with a connector
data = {
"bin_id": bin_id,
'submission_id': submission_id
}
server.insert("prod/submission_in_bin", data)
def _test_shot_sequence_hierarchy(self):
shot_key = "prod/shot?project=sample3d&code=RC_001_001"
shot = self.server.get_by_search_key(shot_key)
parent = self.server.get_parent(shot_key)
self.assertEquals("RC_001", parent.get("code") )