• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python command.Command类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyasm.command.Command的典型用法代码示例。如果您正苦于以下问题:Python Command类的具体用法?Python Command怎么用?Python Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: checkin_shot_set

    def checkin_shot_set(my, ticket, project_code, shot_code, process, context, \
             checkin_as, currency, unknown_ref, desc):
        snapshot_code = ''
        try:
            my.init(ticket)
            Project.set_project(project_code)

            shot = Shot.get_by_code(shot_code)
            checkin = ShotCheckin(shot)
            checkin.set_description(desc)
            checkin.set_process(process)
            checkin.set_context(context)

            is_current = True
            if currency == 'False':
                is_current = False
            is_revision = False
            if checkin_as == 'Revision':
                is_revision = True

            checkin.set_current(is_current)
            checkin.set_revision(is_revision)
            checkin.set_option("unknown_ref", unknown_ref)
            Command.execute_cmd(checkin)
            snapshot_code = checkin.snapshot.get_code()

        finally:
            DbContainer.close_all()
          
        
        return snapshot_code
开发者ID:0-T-0,项目名称:TACTIC,代码行数:31,代码来源:base_xmlrpc.py


示例2: checkin_textures

    def checkin_textures(my, ticket, project_code, asset_code, paths, file_ranges, node_names, attrs, use_handoff_dir=False, md5s=[]):
        '''creates a number of textures under a single asset'''
        new_paths = []
        try:
            my.init(ticket)
            Project.set_project(project_code)

            parent = Asset.get_by_code(asset_code)
            #parent = Search.get_by_search_key(search_key)
            context = 'publish'
            checkin = TextureCheckin(parent, context, paths, file_ranges, node_names, attrs, use_handoff_dir=use_handoff_dir, md5s=md5s)
            Command.execute_cmd(checkin)

            new_paths = checkin.get_texture_paths()
            #md5_list = checkin.get_texture_md5()
            file_code_list = checkin.get_file_codes()
            
            #loader_context = ProdLoaderContext()
            #updater = loader_context.get_updater(snapshot, asset_code, instance)
            #execute_xml = updater.get_execute_xml()
            #xml = execute_xml.to_string()
            
        finally:
            DbContainer.close_all()

        return new_paths, file_code_list
开发者ID:0-T-0,项目名称:TACTIC,代码行数:26,代码来源:base_xmlrpc.py


示例3: test_all

    def test_all(my):
        '''entry point function'''
        my.description = "Checkin unit test"
        my.errors = []

        Batch()

        # FIXME: this is needed for the triggers to be registerd. These
        # triggers have nothing to do with the web
        from pyasm.web import WebInit
        WebInit().execute()


        test_env = UnittestEnvironment()
        test_env.create()

        Project.set_project("unittest")

        try:
            Command.execute_cmd(my)

            # undo the command
            undo = UndoCmd()
            undo.execute()

        finally:
            test_env.delete()
开发者ID:blezek,项目名称:TACTIC,代码行数:27,代码来源:checkin_test.py


示例4: create_set

 def create_set(my, ticket, project_code, set_name, cat_name, selected):
     '''an xml to create a new set node'''
     xml = ''
     asset_code = ''
     try:
         my.init(ticket)
         Project.set_project(project_code)
         cmd = MayaSetCreateCmd()
         cmd.set_set_name(set_name)
         cmd.set_cat_name(cat_name)
         
         Command.execute_cmd(cmd)
         
         asset_code = cmd.get_asset_code() 
         if asset_code:
             cmd = CreateSetNodeCmd()
             cmd.set_asset_code(asset_code)
             cmd.set_instance(set_name)
             cmd.set_contents(selected)
             cmd.execute()
             execute_xml = cmd.get_execute_xml()
             xml = execute_xml.get_xml()
             
     finally:
         DbContainer.close_all()
     
     return [xml, asset_code]
开发者ID:0-T-0,项目名称:TACTIC,代码行数:27,代码来源:base_xmlrpc.py


示例5: _test_add_drop_column

    def _test_add_drop_column(my):
        #Project.set_project('unittest')
        from pyasm.command import ColumnAddCmd, ColumnDropCmd, Command
        cmd = ColumnAddCmd('unittest/country','special_place','varchar(256)')
        Command.execute_cmd(cmd)
        search_type = 'unittest/country'

        # clear cache
       
        SearchType.clear_column_cache(search_type)

        DatabaseImpl.clear_table_cache()
        exists = SearchType.column_exists(search_type, 'special_place')
        my.assertEquals(exists, True)

        # now drop the column
        cmd = ColumnDropCmd(search_type,'special_place')
        Command.execute_cmd(cmd)

        # clear cache
        SearchType.clear_column_cache(search_type)
        cache_dict = Container.get("DatabaseImpl:column_info")

       
        # assume database is the same as sthpw
        database_type = Project.get_by_code("unittest").get_database_type()
        db_resource = DbResource.get_default('unittest')
        table_info = cache_dict.get("%s:%s" % (db_resource, "country"))
        my.assertEquals(table_info == None, True)


        key = "%s:%s" % (db_resource, "country")
        cache_dict[key] = None
        exists = SearchType.column_exists(search_type, 'special_place')
        my.assertEquals(exists, False)
开发者ID:0-T-0,项目名称:TACTIC,代码行数:35,代码来源:sql_test.py


示例6: init

    def init(my):
        """initialize the widget_config, and from there retrieve the schema_config"""
        web = WebContainer.get_web()
        my.search_type = my.kwargs.get("search_type")

        element_name = my.kwargs.get("element_name")
        my.view = my.kwargs.get("view")

        # FIXME: comment out the assert for now to avoid error screen
        if not my.view:
            my.view = "table"
        # assert my.view

        my.config_xml = my.kwargs.get("config_xml")
        if not my.config_xml:
            my.config_xml = web.get_form_value("config_xml")

        my.default = my.kwargs.get("default") == "True"

        cbk = ManageSearchTypeDetailCbk(search_type=my.search_type, view=my.view, element_name=element_name)
        Command.execute_cmd(cbk)

        my.config_string = ""
        my.data_type_string = ""
        my.name_string = ""
        my.title_string = ""
        my.nullable_string = ""
        my.has_column = True

        if element_name:
            if my.config_xml:
                my.config_string = my.config_xml
                whole_config_string = "<config><%s>%s</%s></config>" % (my.view, my.config_xml, my.view)
                config = WidgetConfig.get(xml=whole_config_string, view=my.view)
                my.config = WidgetConfigView(my.search_type, my.view, [config])
            else:
                # don't pass in default here
                my.config = my.get_config(my.search_type, my.view)
                node = my.config.get_element_node(element_name)
                if node is not None:
                    config_xml = my.config.get_xml()

                    my.config_string = config_xml.to_string(node)
                    my.title_string = config_xml.get_attribute(node, "title")
            schema_config = SearchType.get_schema_config(my.search_type)

            attributes = schema_config.get_element_attributes(element_name)
            my.data_type_string = attributes.get("data_type")

            # double_precision is float
            if my.data_type_string == "double precision":
                my.data_type_string = "float"

            my.name_string = attributes.get("name")
            my.nullable_string = attributes.get("nullable")
            my.is_new_column = attributes.get("new") == "True"

            # a database columnless widget
            if not my.name_string:
                my.has_column = False
开发者ID:pombredanne,项目名称:TACTIC,代码行数:60,代码来源:search_type_manager_wdg.py


示例7: execute

    def execute(my):
        
        # get all of the commands
        web = WebContainer.get_web()

        # try the marshalled class
        marshall_list = []
        marshalled = web.get_form_values("marshalled")
        
        for marshall in marshalled:
            # skip duplicated commands
            if marshall in marshall_list:
                continue
            else:
                marshall_list.append(marshall)

            marshaller = Marshaller.get_from_marshalled(marshall)
            cmd = marshaller.get_object()
            # we want to allow the page to draw, CmdReport will display the error
            try:
                Command.execute_cmd(cmd)
            except TacticException, e:
                pass
            except OSError, (errno, strerror):
                pass
开发者ID:0-T-0,项目名称:TACTIC,代码行数:25,代码来源:command_delegator.py


示例8: init

 def init(self):
     self.search_key = self.kwargs.get("search_key")
     self.update = self.kwargs.get("update")
     self.description = ''
     if self.update == "true":
         cmd = SecurityManagerCbk()
         cmd.set_search_key(self.search_key)
         Command.execute_cmd(cmd)
         self.description = cmd.get_description()
开发者ID:mincau,项目名称:TACTIC,代码行数:9,代码来源:security_manager_wdg.py


示例9: init

 def init(my):
     my.search_key = my.kwargs.get("search_key")
     my.update = my.kwargs.get("update")
     my.description = ''
     if my.update == "true":
         cmd = SecurityManagerCbk()
         cmd.set_search_key(my.search_key)
         Command.execute_cmd(cmd)
         my.description = cmd.get_description()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:9,代码来源:security_manager_wdg.py


示例10: run_batch

def run_batch(kwargs):
    command = k.get("command")
    kwargs = k.get("kwargs")
    login = k.get("login")
    project_code = k.get("project_code")

    from pyasm.security import Batch
    Batch(project_code=project_code, login_code=login)

    cmd = Common.create_from_class_path(command, kwargs=kwargs)
    Command.execute_cmd(cmd)
开发者ID:blezek,项目名称:TACTIC,代码行数:11,代码来源:queue.py


示例11: main

def main():
    update = {
        "X123": {
            "search_key": "vfx/asset?project=vfx&code=chr001",
            "column": "name"
        },
        "X124": {
            "search_key": "sthpw/login?code=admin",
            "expression": "@GET(.first_name) + ' ' + @GET(.last_name)"
        }
    }
    cmd = DynamicUpdateCmd(update=update)
    Command.execute_cmd(cmd)
开发者ID:pombredanne,项目名称:TACTIC,代码行数:13,代码来源:dynamic_update_wdg.py


示例12: checkin_frames

    def checkin_frames(my, ticket, project_code, queue_id):
        try:
            my.init(ticket)
            Project.set_project(project_code)

            cmd = CheckinFramesXMLRPC()
            cmd.set_args(ticket, queue_id)
            Command.execute_cmd(cmd)

        finally:
            DbContainer.close_all()

        return True
开发者ID:0-T-0,项目名称:TACTIC,代码行数:13,代码来源:base_xmlrpc.py


示例13: create_assets

    def create_assets(my, ticket, project_code, set_code, names):

        try:
            my.init(ticket)
            Project.set_project(project_code)

            cmd = CreateSetAssetsCmd()
            cmd.set_set_code(set_code)
            cmd.set_names(names)
            Command.execute_cmd(cmd)
            asset_codes = cmd.get_asset_codes()
        finally:
            DbContainer.close_all()

        return asset_codes
开发者ID:0-T-0,项目名称:TACTIC,代码行数:15,代码来源:base_xmlrpc.py


示例14: checkin_flash_shot

 def checkin_flash_shot(my, ticket, project_code,shot_code, context, comment):
         
     snapshot_code = ''
     try:
         my.init(ticket)
         Project.set_project(project_code)
         from pyasm.flash import FlashShotSObjectPublishCmd
         shot = Shot.get_by_code(shot_code)
         
         checkin = FlashShotSObjectPublishCmd(shot, context, comment)
         Command.execute_cmd(checkin)
         snapshot_code = checkin.snapshot.get_code()
     finally:
         DbContainer.close_all()
     
     return snapshot_code 
开发者ID:0-T-0,项目名称:TACTIC,代码行数:16,代码来源:base_xmlrpc.py


示例15: run_method

    def run_method(my, name, method):
            try:
                #upgrade = eval( '%s()' %my.__class__.__name__)
                upgrade = BaseUpgrade()
            except NameError:
                print "Failed to import upgrade script for %s" %my.__class__.__name__ 
                return
            # substitute the function of 'execute' method with the
            # upgrade script
            Common.add_func_to_class(method, upgrade, upgrade.__class__, 'execute')
            upgrade.set_project(my.project_code)
            upgrade.set_upgrade_method(name)
            upgrade.set_quiet(my.quiet)
            upgrade.set_confirmed(my.is_confirmed)

            Command.execute_cmd(upgrade, call_trigger=False)
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:16,代码来源:base_upgrade.py


示例16: checkin_set

    def checkin_set(my, ticket, project_code, asset_code, context):
        snapshot_code = ''
        try:
            my.init(ticket)
            Project.set_project(project_code)

            new_set = Asset.get_by_code(asset_code)
            checkin = MayaGroupCheckin(new_set)
            checkin.set_context(context)
            checkin.set_description("Initial Publish")
            Command.execute_cmd(checkin)
            snapshot_code = checkin.snapshot.get_code()
        finally:
            DbContainer.close_all()
          
        return snapshot_code
开发者ID:0-T-0,项目名称:TACTIC,代码行数:16,代码来源:base_xmlrpc.py


示例17: main

def main(mode):
    manifest = '''
    <manifest code='test_plugin' version='1'>
    <!--
    <search_type code="prod/asset" path="search_type.spt"/>
    -->
    <sobject expr="@SOBJECT(config/custom_script['code','5CG'])" path="file.spt"/>
    <sobject expr="@SOBJECT(config/widget_config['code','35CG'])" path="file2.spt"/>
    </manifest>
    '''


    if mode == 'create':
        plugin = PluginCreator(manifest=manifest)
    elif mode == 'install':
        plugin = PluginInstaller(manifest=manifest)
    elif mode == 'uninstall':
        plugin = PluginUninstaller(manifest=manifest)

    Command.execute_cmd(plugin)
开发者ID:talha81,项目名称:TACTIC-DEV,代码行数:20,代码来源:plugin.py


示例18: get_display

    def get_display(self):
        top = self.top

        top.add_style("padding: 10px")

        from tactic.command import IngestionCmd
        cmd = IngestionCmd(**self.kwargs)
        Command.execute_cmd(cmd)
        info = cmd.get_info()

        paths_matched = info.get("paths_matched")
        paths_not_matched = info.get("paths_not_matched")
        paths_irregular = info.get("paths_irregular")
        paths_invalid = info.get("paths_invalid")

        tags = info.get("tags")

        top.add("<br/>")
        #category_div = self.get_category_wdg(paths_matched, "Matched Paths", tags)
        #category_div = self.get_category_preview_wdg(paths_matched, "Matched Paths", tags)
        #top.add(category_div)

        category_div = self.get_category_wdg2(paths_matched, "Matched Paths", tags)
        top.add(category_div)


        top.add("<br/>")
        category_div = self.get_category_wdg2(paths_invalid, "Invalid Paths")
        top.add(category_div)

        top.add("<br/>")
        category_div = self.get_category_wdg2(paths_irregular, "Irregular Paths")
        top.add(category_div)
 

        top.add("<br/>")
        category_div = self.get_category_wdg2(paths_not_matched, "Unmatched Paths")
        top.add(category_div)


        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:41,代码来源:ingestion_wdg.py


示例19: test_all

    def test_all(self):

        # create a scene that will be checked in
        asset_code = "prp101"
        sid = "12345"

         # create an asset
        mel('sphere -n sphere1')
        mel('circle -n circle1')
        mel('group -n |%s |circle1 |sphere1' % asset_code )

        # convert node into a maya asset
        node = MayaNode("|%s" % asset_code )
        asset_node = MayaAssetNode.add_sid( node, sid )

        # checkin the asset
        checkin = MayaAssetNodeCheckin(asset_node)
        Command.execute_cmd(checkin)

        # create a file from this node
        asset_node.export()
开发者ID:mincau,项目名称:TACTIC,代码行数:21,代码来源:maya_checkin_test.py


示例20: Batch

                    context == current_context):
                count += 1
                if snapshot.get_value('is_latest') != True:
                    change_count += 1
                    try:
                        snapshot.set_latest()
                        print "\t... set to is latest! ", search_type, search_id, context, version
                    except Exception, e:
                        print "\t ... WARNING: could not set latest:: ", search_type, search_id, context, version
                        print "\t ... ", e

            current_search_type = search_type
            current_search_id = search_id
            current_context = context
            current_version = version   

        print "Total is_latest: ", count
        print "Total is_latest set: ", change_count
if __name__ == '__main__':
    Batch()
    Project.set_project("admin")

    start = time.time()
    cmd = FixIsLatestSnapshotCmd()
    Command.execute_cmd(cmd, call_trigger=False)

    print float(int( (time.time() - start) * 1000)) / 1000, "seconds"
    


开发者ID:0-T-0,项目名称:TACTIC,代码行数:27,代码来源:fix_is_latest_snapshot.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python command.Trigger类代码示例发布时间:2022-05-25
下一篇:
Python checkin.FileCheckin类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap