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


Python DivWdg.add方法代码示例

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


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

示例1: get_section_four

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_section_four(self):
        label_value_pairs_1 = (
            ('Image is a JPEG (.jpg extension)?', 'image_is_jpeg_chapter'),
            ('DPI is 72 or greater?', 'dpi_is_72_chapter'),
            ('Color profile is RGB?', 'color_profile_rgb_chapter'),
            ('Same aspect ratio as video?', 'same_aspect_ratio_as_video_chapter'),
            ('Only active pixels are included (no dirty edges)?', 'only_active_pixels_chapter'),
            ('Horizontal dimension is at least 640?', 'horizontal_dimension_640_chapter'),
            ('Each chapter has a thumbnail?', 'each_chapter_thumbnail_chapter')
        )

        label_value_pairs_2 = (
            ('Image is a JPEG (.jpg extension)?', 'image_is_jpeg_poster'),
            ('DPI is 72 or greater?', 'dpi_is_72_poster'),
            ('Color profile is RGB?', 'color_profile_rgb_poster'),
            ('Resolution is at least 1400x2100?', 'resolution_poster'),
            ('Aspect ratio is 2:3?', 'aspect_ratio_poster'),
            ('Contains key art and title only (no film rating on image)?', 'contains_key_art_poster'),
            ('No DVD cover, date stamp, URL or promo tagging included?', 'no_promo_poster')
        )

        section_div = DivWdg()

        section_div.add(self.get_section_four_table_one(label_value_pairs_1))
        section_div.add(self.get_section_four_table_two(label_value_pairs_2))

        return section_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:29,代码来源:metadata_report_wdg.py

示例2: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_display(self):

        top = self.top

        height = self.get_option('height')
        if not height:
            height = 300

        inner = DivWdg()
        top.add(inner)
        inner.add_style("overflow-y: auto")
        inner.add_style("overflow-x: hidden")
        inner.add_style("min-width: 300px")
        inner.add_style("max-width: 300px")
        inner.add_style("max-height: %s" % height)
        inner.add_style("margin-right: -3px")
        
        sobject = self.get_current_sobject()

        data = sobject.get_json_value( self.get_name() )
        if not data:
            data = {}

        keys = data.keys()
        keys.sort()

        for key in keys:
            value = data.get(key)
            inner.add("%s = %s<br/>"% (key, value))



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

示例3: get_sobject_info_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_sobject_info_wdg(my):
        div = DivWdg()
        return div

        attr_table = Table()
        div.add(attr_table)

        attr_table.add_color("color", "color")

        sobject = my.get_sobject()

        titles, exprs = my.get_sobject_info()
        for title, expr in zip(titles, exprs):
            try:
                value = Search.eval(expr, sobject)
            except Exception, e:
                print "WARNING: ", e.message
                continue


            if value == '':
                value = '<i>none</i>'
            if len(value) > 100:
                value = "%s..." % value[:100]

            attr_table.add_row()
            th = attr_table.add_header("%s: " % title)
            th.add_style("text-align: left")
            td = attr_table.add_cell(value)
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:31,代码来源:sobject_wdg.py

示例4: get_section_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_section_wdg(my, view, editable=True, default=False):

        title = ""
        if editable:
            edit_mode = "edit"
        else:
            edit_mode = "read"
        kwargs = {
            "title": title,
            "config_search_type": my.search_type,
            "view": view,
            "width": "300",
            "mode": edit_mode,
            "default": str(default),
        }
        if view in ["definition", "custom_definition"]:
            kwargs["recurse"] = "false"

        from view_section_wdg import ViewSectionWdg

        section_wdg = ViewSectionWdg(**kwargs)
        class_path = Common.get_full_class_name(section_wdg)

        section_div = DivWdg(css="spt_panel")
        section_div.add_style("display: block")
        section_div.set_attr("spt_class_name", class_path)
        for name, value in kwargs.items():
            if name == "config":
                continue
            section_div.set_attr("spt_%s" % name, value)

        section_div.add(section_wdg)
        return section_div
开发者ID:hellios78,项目名称:TACTIC,代码行数:35,代码来源:view_manager_wdg.py

示例5: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_display(my):

        search_key = my.kwargs.get('parent_key')

        div = DivWdg()

        if not search_key:
            div.add("Search Key for SObjectHeaderHdg is empty")
            return div

        sobject = Search.get_by_search_key( search_key )
        if not sobject:
            div.add("SObject with Search Key [%s] does not exist" % search_key)
            return div


        search_type_obj = sobject.get_search_type_obj()
        title = search_type_obj.get_title()
        title_wdg = DivWdg()
        title_wdg.add_style("font-size: 1.8em")

        name = sobject.get_display_value()
        title_wdg.add("%s: %s" % (title, name ))

        div.add(title_wdg)
        div.add(HtmlElement.hr())

        return div
开发者ID:southpawtech,项目名称:TACTIC-DEV,代码行数:30,代码来源:custom_layout_wdg.py

示例6: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_display(my):
        sobject = None
        code = ''
        show_checks = False
        if 'source_code' in my.kwargs.keys():
            code = str(my.kwargs.get('source_code'))    
        else:
            sobject = my.get_current_sobject()
            code = sobject.get_code()
        if sobject.get_value('high_security') in [True,'T','t','1']:
            show_checks = True
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        if show_checks:
            table.add_style('background-color: #ff0000;')
            login = Environment.get_login()
            user_name = login.get_login()
            table.add_row()
            cell1 =  table.add_cell('<img border="0" style="vertical-align: middle" title="Security Checklist" name="Security Checklist" src="/context/icons/32x32/lock_32_01.png">')
            cell1.add_attr('user', user_name)
            launch_behavior = my.get_launch_behavior(code,user_name)
            cell1.add_style('cursor: pointer;')
            cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:29,代码来源:source_security_wdg.py

示例7: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_display(my):
        sobject = my.get_current_sobject()
        code = sobject.get_code()
        sk = my.server.build_search_key("twog/movement", code)
        shipping_class = sobject.get_value("shipping_class")
        title = sobject.get_value("name")
        waybill = sobject.get_value("waybill")
        sending_company_code = sobject.get_value("sending_company_code")
        receiving_company_code = sobject.get_value("receiving_company_code")
        shipper_code = sobject.get_value("shipper_code")
        description = sobject.get_value("description")
        timestamp = sobject.get_value("timestamp")

        widget = DivWdg()
        table = Table()
        table.add_attr("width", "50px")
        table.add_row()
        cell1 = table.add_cell(
            '<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">'
        )
        launch_behavior = my.get_launch_behavior()
        cell1.add_attr("sk", sk)
        cell1.add_attr("shipping_class", shipping_class)
        cell1.add_attr("to_comp", receiving_company_code)
        cell1.add_attr("from_comp", sending_company_code)
        cell1.add_attr("waybill", waybill)
        cell1.add_attr("title", title)
        cell1.add_attr("shipper", shipper_code)
        cell1.add_attr("description", description)
        cell1.add_attr("timestamp", timestamp)
        cell1.add_style("cursor: pointer;")
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:37,代码来源:movement_printer2.py

示例8: get_camera_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_camera_wdg(self):
        widget = Widget()

        div = DivWdg(css="filter_box")
        sequence_filter = SequenceFilterWdg()
        epi_code, sequence_code = sequence_filter.get_value()
        div.add(sequence_filter)

        search = Search("prod/camera")

        columns = ['shot_code', 'description']
        search_filter = SearchFilterWdg("camera_search", columns=columns,\
            has_persistence=False)
     
        search_filter.alter_search(search)
        div.add(search_filter)
        widget.add(div)

        if sequence_code:
            search.add_where("shot_code in (select code from shot where sequence_code = '%s')" % sequence_code)

        table = TableWdg("prod/camera")
        table.set_search(search)
        widget.add(table)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:27,代码来源:preprod_tab_wdg.py

示例9: get_art_reference

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_art_reference(self):

        widget = Widget()
        help = HelpItemWdg('References', 'References tab lets the user organize art references. Each reference can be [related] to one or more assets defined in TACTIC. It can be set up when you [Edit] the reference.')
        self.add(help)
        div = DivWdg(css="filter_box")
        
        widget.add(div)
        columns = ['description','keywords']
        search_filter = SearchFilterWdg("art_ref_search", columns=columns,\
            has_persistence=False)
       
        div.add(search_filter)
           
        select = FilterSelectWdg("art_ref_category", label='Category: ', css='snall')
        select.set_option("setting", "art_reference_category")
        select.add_empty_option('-- Any --')
        
        div.add( select )

        table = TableWdg("prod/art_reference")
        search = Search("prod/art_reference")
       
        search_filter.alter_search(search)
       
        value = select.get_value()
        if value != "":
            search.add_filter("category", value)
        table.set_search(search)
        widget.add(table)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:33,代码来源:preprod_tab_wdg.py

示例10: get_folder_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_folder_wdg(my, element_name, config, options, base_path, current_path, info, personal, use_same_config):
        li = HtmlElement.li()
        li.add_class("spt_side_bar_link")
        li.add_class("main_li")


        title = my._get_title(config, element_name)
        title_wdg = DivWdg()
        title_wdg.add_class("menu_header")
        li.add(title_wdg)
        title_wdg.add(title)


        ul = HtmlElement.ul()
        li.add(ul)
        ul.add_class("spt_side_bar_section")
        ul.add_class("sub_ul")

        # then get view name from options in order to read a new
        # config and recurse ...
        options_view_name = options.get('view')
        if options_view_name:
            if use_same_config:
                xml = config.get_xml()
                sub_config = WidgetConfig.get(xml=xml)
                sub_config.set_view(options_view_name)
            else:
                sub_config = my.get_config( my.config_search_type, options_view_name, default=my.default, personal=personal)

            info['level'] += 1
            my.generate_section( sub_config, ul, info, base_path=current_path, personal=personal, use_same_config=use_same_config )
            info['level'] -= 1

        return li
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:36,代码来源:simple_side_bar_wdg.py

示例11: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
 def get_display(my):
     do_button = False
     if 'work_order_code' not in my.kwargs.keys(): 
         sobject = my.get_current_sobject()
         code = sobject.get_code()
     else:
         code = my.kwargs.get('work_order_code')    
         do_button = True
     
     widget = DivWdg()
     table = Table()
     table.add_attr('width', '50px')
     table.add_row()
     launch_behavior = my.get_launch_behavior(code)
     what_goes_in = '<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">'
     if do_button:
        what_goes_in = ButtonSmallNewWdg(title="Print Work Order", icon=IconWdg.PRINTER)
        what_goes_in.add_behavior(launch_behavior) 
     cell1 = table.add_cell(what_goes_in)
     cell1.add_attr('code',code)
     cell1.add_style('cursor: pointer;')
     if not do_button:
         cell1.add_behavior(launch_behavior)
     widget.add(table)
     if do_button:
         return what_goes_in
     else:
         return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:30,代码来源:work_order_printer.py

示例12: get_tables_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_tables_wdg(my):
        
        div = DivWdg()
        div.set_name("Tables")

        div.add("In order to fully register a database, you must bind it to a TACTIC project")
        div.add("<br/>")



        project_code = "mongodb"
        database = "test_database"

        db_resource = DbResource(
                server='localhost',
                vendor='MongoDb',
                database=database
        )


        try:
            connect = DbContainer.get(db_resource)
        except Exception, e:
            div.add("Could not connect")
            div.add_style("padding: 30px")
            div.add("<br/>"*2)
            div.add(str(e))
            return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:30,代码来源:db_resource_wdg.py

示例13: get_section_wdg

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_section_wdg(self, view, editable=True, default=False):

        title = ""
        target_id = "sobject_relation"
        if editable:
            edit_mode = 'edit'
        else:
            edit_mode = 'read'
        kwargs = {
            'title': title,
            'config_search_type': self.search_type,
            'view': view,
            'target_id': target_id,
            'width': '300',
            'prefix': 'manage_side_bar',
            'mode': edit_mode,
            'default': str(default)
        }
        if view in ["definition", "custom_definition"]:
            kwargs['recurse'] = "false"

        section_wdg = ViewSectionWdg(**kwargs)
        class_path = Common.get_full_class_name(section_wdg)

        section_div = DivWdg()
        section_div.add_style("display: block")
        section_div.set_attr('spt_class_name', class_path)
        for name, value in kwargs.items():
            if name == "config":
                continue
            section_div.set_attr("spt_%s" % name, value)

        section_div.add(section_wdg)
        return section_div
开发者ID:mincau,项目名称:TACTIC,代码行数:36,代码来源:view_section_wdg.py

示例14: get_example_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_example_display(my):

        div = DivWdg()

        # --- Example of new spt.fx animation slider --------------------------------------------------------------

        slide_div = DivWdg()
        slide_div.set_id( "ui_play_sliding_thing" )
        slide_div.set_style( "background: #9f9f9f; color: #0f0f0f; border: 1px solid black;" )
        slide_div.add( "For a moment after Mr. and Mrs. Darling left the house the night-lights by the beds of the three children continued to burn clearly. They were awfully nice little night-lights, and one cannot help wishing that they could have kept awake to see Peter; but Wendy&#39;s light blinked and gave such a yawn that the other two yawned also, and before they could close their mouths all the three went out. There was another light in the room now, a thousand times brighter than the night-lights, and in the time we have taken to say this, it had been in all the drawers in the nursery, looking for Peter&#39;s shadow, rummaged the wardrobe and turned every pocket inside out. It was not really a light; it made this light by flashing about so quickly, but when it came to rest for a second you saw it was a fairy, no longer than your hand, but still growing. It was a girl called Tinker Bell exquisitely gowned in a skeleton leaf, cut low and square, through which her figure could be seen to the best advantage. She was slightly inclined to embonpoint." )

        div.add( slide_div )

        div.add( '<br/>' )
        click_slide = DivWdg()
        click_slide.add( "Click Me to Slide!" )
        click_slide.set_style( "background: #0f0f0f; color: #9f9f9f; border: 1px solid black; width: 100px; " \
                               "cursor: pointer;" )

        click_slide.add_behavior( { 'type': 'click_up',
                                    'dst_el': 'ui_play_sliding_thing',
                                    'cbfn_action': 'spt.fx.slide_anim_cbk',
                                    'options': { 'direction': 'vertical',
                                                 'duration': 500,  # time in milliseconds
                                                 'frame_rate': 15   # frames per second
                                                }
                                    } )

        div.add( click_slide )
        return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:32,代码来源:fx_anim_examples_wdg.py

示例15: get_display

# 需要导入模块: from pyasm.web import DivWdg [as 别名]
# 或者: from pyasm.web.DivWdg import add [as 别名]
    def get_display(my):
        name = ''
        if 'code' in my.kwargs.keys():
            code = my.kwargs.get('code') 
        else: 
            sobject = my.get_current_sobject()
            code = sobject.get_code()
            name = sobject.get_value('name')
        if 'name' in my.kwargs.keys():
            name = my.kwargs.get('name')
        search_on_load = 'false'
        if 'search_on_load' in my.kwargs.keys():
            search_on_load = my.kwargs.get('search_on_load')

        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        table.add_row()
        cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/custom/imdb.png">')
        cell1.add_attr('code', code)
        cell1.add_attr('name', name)
        cell1.add_attr('search_on_load', search_on_load)
        launch_behavior = my.get_launch_behavior()
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:30,代码来源:order_associator.py


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