本文整理汇总了Python中tactic_client_lib.TacticServerStub.build_search_type方法的典型用法代码示例。如果您正苦于以下问题:Python TacticServerStub.build_search_type方法的具体用法?Python TacticServerStub.build_search_type怎么用?Python TacticServerStub.build_search_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tactic_client_lib.TacticServerStub
的用法示例。
在下文中一共展示了TacticServerStub.build_search_type方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import build_search_type [as 别名]
def main(args):
# USAGE: query_shot.py <shot_code>
shot_code = args[0]
server = TacticServerStub()
search_key = server.build_search_type(SEARCH_TYPE)
# do the actual work
server.start("Queried shot [%s]" % shot_code)
try:
filters = [
('code', shot_code)
]
print server.query(search_key, filters)
except:
server.abort()
raise
else:
server.finish()
示例2: main
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import build_search_type [as 别名]
def main(args, login=None):
# USAGE: checkin_render.py
type = args[0]
if type == "shot":
parent_search_type = "prod/shot"
elif type == "asset":
parent_search_type = "prod/asset"
else:
parent_search_type = type
code = args[1]
file_range = args[2]
pattern = args[3]
layer_name = ''
context = 'publish'
if type == "layer":
parent_search_type = "prod/layer"
code, layer_name = args[1].split('|')
server = TacticServerStub(login)
# do the actual work
server.start("Checked in file group [%s] to %s [%s]" % (pattern,type,code))
try:
# checkin the uploaded file
filters = []
if type=='layer':
filters.append(('shot_code', code))
filters.append(('name', layer_name))
else:
filters.append(('code', code))
results = server.query(parent_search_type, filters)
# take the first one
if results:
id = results[0].get('id')
else:
if type =='layer':
print "%s Code [%s] name [%s] not found. Please insert an entry in TACTIC first." %(type, code, layer_name)
else:
print "%s Code [%s] not found. Please insert an entry in TACTIC first." %(type, code)
search_type = server.build_search_type(parent_search_type)
file_type = 'main'
render_type = '' # not used yet
# move the file
dir = server.get_handoff_dir()
paths = expand_paths(pattern, file_range)
copy_file(paths, dir)
file_name = os.path.basename(pattern)
new_pattern = '%s/%s' %(dir, file_name)
print "Copied files to handoff dir\n"
render = find_render(server, search_type, id, login, render_type)
if not render:
render_data = {
'search_type': search_type,
'search_id': id,
'login': login
#'type': render_type
}
render = server.insert("prod/render", render_data)
# run group checkin
server.group_checkin(render.get("__search_key__"), context=context, file_path=new_pattern, file_type=file_type, file_range=file_range)
except:
server.abort()
raise
else:
server.finish()
示例3: TacticServerStub
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import build_search_type [as 别名]
''' Toda parte de configuracao de servidor '''
projeto_name = 'xxxx'
ip_sever = 'xxx.xxx.x.xx'
if projeto_name:
server = TacticServerStub()
server.set_server(ip_sever)
server.set_project(projeto_name)
print 'OK server'
else:
print 'server down'
search_type = projeto_name + '/shot'
print 'USER LOGIN: %s' % (server.get_login())
print server.build_search_type(search_type)
''' Inicializando a busca por arquvos '''
# self.nameSnapshots()
def converter_jpg(self, path):
# Vai converter todas as imagens que forem necessarias.
converter(path)
def nameSnapshots(self):
for index, itens in enumerate(self.paths):
# Code recebe o nome que vai ser colocado no snapshot.
self.listNameSnapshots.append({ 'code': '', 'description' : itens })
if os.listdir(itens):
for i in os.listdir(itens):
示例4: main
# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import build_search_type [as 别名]
def main(args, login=None):
# USAGE: checkin_render_layer.py
shot_code = args[0]
layer_name = args[1]
version = args[2]
context = args[3]
file_range = args[4]
pattern = args[5]
server = TacticServerStub(login)
# do the actual work
server.start("Checked in file group [%s] to shot [%s] layer [%s]" % (pattern, shot_code, layer_name))
try:
# move the file
dir = server.get_handoff_dir()
paths = expand_paths(pattern, file_range)
move_file(paths, dir)
file_name = os.path.basename(pattern)
new_pattern = "%s/%s" % (dir, file_name)
print "Files moved to handoff dir.\n"
# checkin the moved files
filters = []
filters.append(("shot_code", shot_code))
filters.append(("name", layer_name))
results = server.query("prod/layer", filters)
# take the first one
if results:
id = results[0].get("id")
search_type = server.build_search_type("prod/layer")
# find the layer snapshot
filters = []
filters.append(("version", version))
filters.append(("search_type", search_type))
filters.append(("search_id", id))
# TODO : may need a context to search for the proper layer
results = server.query("sthpw/snapshot", filters)
snap_code = ""
if results:
snap_code = results[0].get("code")
# find the render
render = None
filters = []
filters.append(("search_type", search_type))
filters.append(("search_id", id))
filters.append(("snapshot_code", snap_code))
results = server.query(SEARCH_TYPE, filters)
if results:
render = results[0]
if not render:
render_data = {"search_type": search_type, "search_id": id, "snapshot_code": snap_code}
render = server.insert("prod/render", render_data)
"""
results = server.query(SEARCH_TYPE, filters)
render_id = 0
if results:
render_id = results[0].get('id')
# find the render id
search_key = server.build_search_key(SEARCH_TYPE, render_id, column='id')
"""
file_type = "main"
# run group checkin
server.group_checkin(
render.get("__search_key__"),
context=context,
file_path=new_pattern,
file_type=file_type,
file_range=file_range,
)
except:
server.abort()
raise
else:
server.finish()