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


Python Common.get_import_from_class_path方法代码示例

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


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

示例1: get_checkin

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import get_import_from_class_path [as 别名]
    def get_checkin(my):
        '''the button which initiates the checkin'''
        # create the button with the javascript function
        widget = Widget()
        #button = TextBtnWdg(label=my.PUBLISH_BUTTON, size='large', width='100', side_padding='20', vert_offset='-5')
        #button.get_top_el().add_class('smaller')
        button = ActionButtonWdg(title=my.PUBLISH_BUTTON, tip='Publish the selected assets')
        button.add_style('margin-bottom: 10px')
        #button.add_color("background", "background")

        hidden = HiddenWdg(my.PUBLISH_BUTTON, '')
        button.add( hidden )
       
        '''
        status_sel = SelectWdg('checkin_status', label='Status: ')
        status_sel.set_option('setting', 'checkin_status')
        status_sel.set_persist_on_submit()
        status_sel.add_empty_option('-- Checkin Status --')
        widget.add(status_sel)
        '''
        widget.add(button)

        # custom defined 
        server_cbk = "pyasm.prod.web.AssetCheckinCbk"
        #TODO: make other Publish Buttons call their own handle_input function
        exec( Common.get_import_from_class_path(server_cbk) )
        exec( "%s.handle_input(button, my.search_type, my.texture_search_type)" % server_cbk)

        return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:31,代码来源:app_sobject_checkin_wdg.py

示例2: get_display

# 需要导入模块: from pyasm.common import Common [as 别名]
# 或者: from pyasm.common.Common import get_import_from_class_path [as 别名]
    def get_display(my):
        top = DivWdg()

        element_name = my.kwargs.get('element_name')

        config_view = my.kwargs.get("config_view")
        display_class = config_view.get_display_handler(element_name)
        display_options = config_view.get_display_options(element_name)
        element_attr = config_view.get_element_attributes(element_name)

        name = element_attr.get('name')
        edit = element_attr.get('edit')
        title = element_attr.get('title')
        width = element_attr.get('width')


        # add the name
        from pyasm.web import Table
        table = Table()
        top.add(table)

        table.add_row()
        td = table.add_cell("Name: ")
        td.add_style("padding: 5px")
        name_text = SpanWdg(name)
        name_text.add_style('font-weight: bold')
        name_text.add_attr("size", "50")
        table.add_cell(name_text)


        table.add_row_cell("<br/>Element Attributes:<br/>")

        # add the title
        table.add_row()
        td = table.add_cell("Title: ")
        td.add_style("padding: 5px")
        title_text = TextWdg("title")
        title_text.add_attr("size", "50")
        if title:
            title_text.set_value(title)
        table.add_cell(title_text)



        # add the width
        table.add_row()
        td = table.add_cell("Width: ")
        td.add_style("padding: 5px")
        width_text = TextWdg("width")
        if width:
            width_text.set_value(width)
        width_text.add_attr("size", "50")
        table.add_cell(width_text)

        # add the editable
        table.add_row()
        td = table.add_cell("Editable: ")
        td.add_style("padding: 5px")
        editable_text = CheckboxWdg("editable")
        editable_text.add_attr("size", "50")
        table.add_cell(editable_text)




        table.add_row_cell("<br/>Display:<br/>")

        # add the widget
        table.add_row()
        td = table.add_cell("Widget: ")
        td.add_style("padding: 5px")
        widget_select = SelectWdg("widget")
        options = ['Expression']
        widget_select.set_option("values", options)
        widget_select.add_empty_option("-- Select --")
        #widget_select.set_value(display_class)
        table.add_cell(widget_select)

        table.add_row_cell("&nbsp;&nbsp;&nbsp;&nbsp;- or -")

        # add the class
        table.add_row()
        td = table.add_cell("Class Name: ")
        td.add_style("padding: 5px")
        class_text = TextWdg("class_name")
        class_text.set_value(display_class)
        class_text.add_attr("size", "50")
        table.add_cell(class_text)


        # introspect the widget
        if not display_class:
            display_class = "pyasm.widget.SimpleTableElementWdg"
        #display_class = "tactic.ui.panel.ViewPanelWdg"

        from pyasm.common import Common
        import_stmt = Common.get_import_from_class_path(display_class)
        if import_stmt:
            exec(import_stmt)
        else:
#.........这里部分代码省略.........
开发者ID:0-T-0,项目名称:TACTIC,代码行数:103,代码来源:element_definition_wdg.py


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