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


Python ThumbWdg.set_name方法代码示例

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


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

示例1: handle_missing_instance

# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_name [as 别名]
    def handle_missing_instance(my, table, instance, asset):

        asset_code = asset.get_code()

        table.add_row()

        table.add_blank_cell()

        # add the thumbnail
        thumb = ThumbWdg()
        thumb.set_name("images")
        thumb.set_sobject(asset)
        thumb.set_icon_size(45)
        table.add_cell(thumb)


        info_wdg = Widget()
        info_wdg.add("<b>%s</b>" % instance)
        info_wdg.add("<div style='font-size: 0.8em'>%s</div>" % asset_code )
        table.add_cell(info_wdg)

        table.add_blank_cell()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:24,代码来源:app_sobject_checkin_wdg.py

示例2: get_display

# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_name [as 别名]

#.........这里部分代码省略.........
            for i, project in enumerate(projects):

                category = project.get_value("category")
                if category is not None and category != last_category:

                    table.add_row()
                    tr, td = table.add_row_cell()
                    category_div = DivWdg()
                    td.add(category_div)
                    if has_category and not category:
                        category_div.add("&nbsp;")
                    else:
                        category_div.add(category)
                    category_div.add_style("padding: 8px")
                    category_div.add_style("font-size: 16px")
                    category_div.add_style("font-weight: bold")
                    category_div.add_color("color", "color")
                    category_div.add_gradient("background", "background3",0, -10)
                    category_div.add_color("color", "color3")
                    #category_div.set_round_corners()
                    if last_category == None:
                        category_div.add_style("margin: -6 -6 6 -6")
                    else:
                        category_div.add_style("margin: 15 -6 0 -6")
                    table.add_row()
                    has_category = True
                    index = 0

                index += 1
                last_category = category


                thumb = ThumbWdg()
                thumb.set_name("snapshot")
                thumb.set_sobject(project)
                thumb.set_show_clipboard(False)
                thumb.set_has_img_link(False)
                thumb.set_icon_size(icon_size)
             
                code = project.get_code()
                title = project.get_value("title")
                # Restrict the length of project name
                if len(title) >= 36:
                    title = title[:36] + "..."
                if app_name != 'Browser':
                    href = HtmlElement.href(HtmlElement.h2(title), ref='/tactic/%s/%s'\
                        %(code, app_name))
                    img_href = HtmlElement.href(thumb, ref='/tactic/%s/%s'\
                        %(code, app_name))

                    link = '/tactic/%s/%s' % (code, app_name)
                else:
                    href = HtmlElement.href(HtmlElement.h2(title), ref="/tactic/%s/" % code)
                    img_href = DivWdg(thumb)
                    img_href.add_behavior( {
                        'type': 'click_up',
                        'code': code,
                        'cbjs_action': '''
                        document.location = '/tactic/'+bvr.code+'/';
                        '''
                    } )
                
                    link = '/tactic/%s/' % code

                href = href.get_buffer_display()
                if (index-1) % columns == 0:
开发者ID:mincau,项目名称:TACTIC,代码行数:70,代码来源:index_wdg.py

示例3: handle_instance

# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_name [as 别名]
    def handle_instance(my, table, instance, asset, node_name='', publish=True, allow_ref_checkin=False):

        # handle the case where asset is not defined
        if not asset:
            table.add_row()
            table.add_blank_cell()
            table.add_blank_cell()

            # FIXME: Maya specific
            parts = instance.split(":")
            instance_name = parts[0]
            asset_code = parts[1]

            
            if instance_name == asset_code:
                table.add_cell(instance_name)
            else:
                table.add_cell(instance)
            td = table.add_cell()
            td.add("< %s node >" % my.session.get_node_type(instance_name))
            table.add_blank_cell()
            return 

        # get the pipeline for this asset and handlers for the pipeline
        process_name = my.process_select.get_value() 
        handler_hidden = my.get_handler_input(asset, process_name)
        pipeline = Pipeline.get_by_sobject(asset) 
        



        # TEST: switch this to using node name instead, if provided
        if node_name:
            instance_node = my.session.get_node(node_name)
        else:
            instance_node = my.session.get_node(instance)

        if instance_node is None:
            return
        if Xml.get_attribute(instance_node,"reference") == "true":
            is_ref = True
        else:
            is_ref = False

        namespace = Xml.get_attribute(instance_node, "namespace")
        if not namespace:
            namespace = instance

        asset_code = asset.get_code()
        is_set = False
        if asset.get_value('asset_type', no_exception=True) in ['set','section']:
            is_set = True
            
        tr = table.add_row()
        
        if is_set:
            tr.add_class("group")

        if publish and (allow_ref_checkin or not is_ref):
            checkbox = CheckboxWdg("asset_instances")
            if is_set:
                checkbox = CheckboxWdg("set_instances")
               
            checkbox.set_option("value", "%s|%s|%s" % \
                        (namespace, asset_code, instance) )
            checkbox.set_persist_on_submit()

            td = table.add_cell(checkbox)
            
        else:
            td = table.add_blank_cell()

        # only one will be added even if there are multiple
        if handler_hidden:
            td.add(handler_hidden)

        # add the thumbnail
        thumb = ThumbWdg()
        thumb.set_name("images")
        thumb.set_sobject(asset)
        thumb.set_icon_size(60)
        table.add_cell(thumb)


        info_wdg = Widget()
        info_wdg.add(HtmlElement.b(instance))

        if not node_name:
            node_name = '%s - %s' %(asset_code, asset.get_name()) 
        info_div = DivWdg(node_name)
        info_div.add_style('font-size: 0.8em')
        info_wdg.add(info_div)
        info_div.add(HtmlElement.br(2))
        if pipeline:
            info_div.add(pipeline.get_code())
        table.add_cell(info_wdg)

        #  by default can't checkin references
        if not allow_ref_checkin and is_ref:
            #icon = IconWdg("error", IconWdg.ERROR)
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:app_sobject_checkin_wdg.py

示例4: init

# 需要导入模块: from pyasm.widget import ThumbWdg [as 别名]
# 或者: from pyasm.widget.ThumbWdg import set_name [as 别名]
    def init(my):

        # get the args in the URL
        args = WebContainer.get_web().get_form_args()
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_id(search_type, search_id)

        main_div = DivWdg()
        main_div.add_style("width: 95%")
        main_div.add_style("float: right")
        my.add(main_div)

        
        if isinstance(sobject, Shot):

            content_id ='summary_story_%s' %sobject.get_id()
            title_id = 'story_head_%s' %sobject.get_id()
            story_div = DivWdg(id=content_id)
            story_div.add_style('display','block')
            
            story_head = HtmlElement.h3("Storyboard")
            my.add_title_style(story_head, title_id, content_id)
            
            main_div.add(story_head)
            main_div.add(story_div)

            storyboard_table = TableWdg("prod/storyboard", "summary", css='minimal')
            search = Search("prod/storyboard")
            search.add_filter( sobject.get_foreign_key(), sobject.get_code() )
            sobjects = search.get_sobjects()
            storyboard_table.set_sobjects(sobjects)
            story_div.add(storyboard_table)


        # add reference material
        search = Search("sthpw/connection")
        search.add_filter("src_search_type", search_type)
        search.add_filter("src_search_id", search_id)
        connections = search.get_sobjects()

        if connections:
            content_id ='summary_ref_%s' %sobject.get_id()
            title_id = 'ref_head_%s' %sobject.get_id()

            ref_head = HtmlElement.h3("Reference")
            my.add_title_style(ref_head, title_id, content_id)
            
            ref_div = DivWdg(id = content_id)
            ref_div.add_style('display','block')
            
            for connection in connections:
                thumb = ThumbWdg()
                thumb.set_name("snapshot")
                dst_search_type = connection.get_value("dst_search_type")
                dst_search_id = connection.get_value("dst_search_id")
                dst = Search.get_by_id(dst_search_type, dst_search_id)
                thumb.set_sobject(dst)
                ref_div.add(thumb)

            
            main_div.add(ref_head)
            main_div.add(ref_div)


       
        task_head = HtmlElement.h3("Tasks")
        content_id ='summary_task_%s' %sobject.get_id()
        title_id = 'task_head_%s' %sobject.get_id()
        my.add_title_style(task_head, title_id, content_id)
        
        main_div.add(task_head)

        task_div = DivWdg(id=content_id)
        task_div.add_style('display','block')
        
        main_div.add(task_div)
        
        search = Search("sthpw/task")
        #if process != "":
        #    search.add_filter("process", process)

        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)

        #search.set_limit(4)
        task_table = TableWdg("sthpw/task", "summary", css='minimal')
        task_table.set_id('sthpw/task%s' % search_id)
        task_table.set_search(search)
        task_div.add(task_table)

        content_id ='summary_hist_%s' %sobject.get_id()
        title_id = 'hist_head_%s' %sobject.get_id()
        hist_head = HtmlElement.h3("Checkin History")
        my.add_title_style(hist_head, title_id, content_id)
        
        hist_div = DivWdg(id=content_id)
        hist_div.add_style('display','block')
        
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:flash_summary_wdg.py


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