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


Python TacticServerStub.simple_checkin方法代码示例

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


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

示例1: main

# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import simple_checkin [as 别名]
def main(args):
    usage = "USAGE: checkin.py <search_type> <code> [context] <path>\n"
    usage += "example: python checkin.py beat Sc01.Bt01 .\\test\\image.png"

    context = "publish"

    # TODO: lots of assumptions here
    if len(args) == 2:
        # assume code and file path are equivalent
        code = args[1]
        file_path = args[1]
    elif len(args) == 3:
        code = args[1]
        file_path = args[2]
    elif len(args) == 4:
        code = args[1]
        context = args[2]
        file_path = args[3]
    else:
        print usage
        return

    search_type = args[0]

    server = TacticServerStub()

    # do the actual work
    server.start("Checked in file [%s] to [%s] - [%s]" % (file_path, search_type, code) )
    try:
        # query all of the search_types to simplify argument
        if search_type.find("/") == -1:
            columns = ["search_type"]
            results = server.query("sthpw/search_object", columns=columns)
            for result in results:
                test = result.get("search_type")
                if test.endswith("/%s" % search_type):
                    search_type = test
                    break
            else:
                raise Exception("Search type [%s] not found" % search_type)

        search_key = server.build_search_key(search_type, code)

        # upload the file
        server.upload_file(file_path)

        # checkin the uploaded file
        result = server.simple_checkin(search_key, context, file_path)
    except Exception, e:
        server.abort()
        print "ERROR: ", e.__str__()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:53,代码来源:checkin_pipeline.py

示例2: main

# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import simple_checkin [as 别名]
def main(args, login=None):
    # USAGE: checkin_shot.py <shot_code> <context> <path>
    shot_code = args[0]
    context = args[1]
    file_path = args[2]

    server = TacticServerStub(login)
    search_key = server.build_search_key(SEARCH_TYPE, shot_code)

    # do the actual work
    server.start("Checked in file [%s]" % file_path)
    try:
        # upload the file
        # server.upload_file(file_path)

        # checkin the uploaded file
        result = server.simple_checkin(search_key, context, file_path, mode="upload")
    except:
        server.abort()
        raise
    else:
        server.finish()
开发者ID:hellios78,项目名称:TACTIC,代码行数:24,代码来源:checkin_shot.py

示例3: _test_create_submission

# 需要导入模块: from tactic_client_lib import TacticServerStub [as 别名]
# 或者: from tactic_client_lib.TacticServerStub import simple_checkin [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)
开发者ID:Southpaw-TACTIC,项目名称:TACTIC,代码行数:39,代码来源:sample3d_test.py


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