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


Python WebContainer.get_event_container方法代码示例

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


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

示例1: get_display

# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_event_container [as 别名]
    def get_display(self):
        # set up the self refresh event for other widgets or callbacks to call
        event_container = WebContainer.get_event_container()
        script = ClipboardWdg.get_self_refresh_script(show_progress=False)
        event_container.add_listener(self.EVENT_ID, script, replace=True )

        if self.is_from_ajax():
            div = Widget()
        else:
            div = DivWdg()
            div.set_id(self.ID)
            div.add_style("display: block")
            div.add_class("background_box")
            div.add_style("padding-left: 3px")
            div.add_style("padding-right: 3px")
            div.add_style("height: 1.5em")
            div.add_style("width: 150px")

        # handle the ajax
        self.set_ajax_top_id(self.ID)
        self.register_cmd(ClipboardClearCbk)
        refresh_script = self.get_refresh_script()

        search = Search("sthpw/clipboard")
        search.add_user_filter()
        search.add_filter("category", "select")
        count = search.get_count()

        div.add("Clipboard: %s items: " % count)


        web = WebContainer.get_web()
        url = WebContainer.get_web().get_widget_url()
        url.set_option("widget", "pyasm.widget.ClipboardListWdg")
        ref = url.to_string()

        iframe = WebContainer.get_iframe()
        iframe.set_width(64)
        action = iframe.get_on_script(ref)
       
        button = IconButtonWdg("View Clipboard", IconWdg.LOAD)
        button.add_event("onclick", action)
        div.add(button)



        # add the clear clipboard icon
        clear_icon = IconButtonWdg("Clear Clipboard", IconWdg.CLEAR)
        clear_icon.add_event("onclick", refresh_script)

        div.add(clear_icon)

        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:55,代码来源:clipboard_wdg.py

示例2: __init__

# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_event_container [as 别名]
 def __init__(my, event_name):
     my.event_name = event_name
     my.event_container = WebContainer.get_event_container()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:5,代码来源:event_container.py

示例3: __init__

# 需要导入模块: from pyasm.web import WebContainer [as 别名]
# 或者: from pyasm.web.WebContainer import get_event_container [as 别名]
 def __init__(self, event_name):
     self.event_name = event_name
     self.event_container = WebContainer.get_event_container()
开发者ID:mincau,项目名称:TACTIC,代码行数:5,代码来源:event_container.py

示例4: get_preview_wdg

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

        widget = Widget()

        web = WebContainer.get_web()

        csv_parser = CsvParser(my.file_path)
        csv_parser.parse()
        csv_titles = csv_parser.get_titles()
        csv_data = csv_parser.get_data()



        ajax = AjaxCmd()
        ajax.set_option("search_type", my.search_type)
        ajax.set_option("file_path", my.file_path)
        ajax.add_element_name("has_title")

        event = WebContainer.get_event_container()
        caller = event.get_event_caller(SiteMenuWdg.EVENT_ID)
        div = ajax.generate_div()
        div.set_post_ajax_script(caller)
        widget.add(div)

        columns = []
        num_columns = len(csv_titles)
        ajax.set_option("num_columns", num_columns)
        for i in range(0, num_columns):
            column = web.get_form_value("column_%s" % i)
            if column:
                column = csv_titles[i]
            else:
                column = web.get_form_value("column_new_%s" % i)

            columns.append(column)

            ajax.add_element_name("column_%s" % i)
            ajax.add_element_name("new_column_%s" % i)


        ajax.register_cmd("pyasm.command.csv_import_cmd.CsvImportCmd")
        import_button = IconButtonWdg("Import", IconWdg.REFRESH, True)
        import_button.add_event("onclick", ajax.get_on_script(show_progress=False))
        import_button.add_style("float: right")
        widget.add( import_button )


        preview_submit = IconSubmitWdg("Preview", IconWdg.REFRESH, True)
        preview_submit.add_style("float: right")
        widget.add(preview_submit)

        sobject_title = my.search_type_obj.get_title()
        widget.add("<p>4. Import</p>")
        widget.add(HtmlElement.br())
        widget.add("<p>The following table will be imported into %s (Showing Max: 100)</p>" % sobject_title)


        table = Table(css="table")
        table.add_style("width: 100%")

        table.add_row()
        for i, title in enumerate(columns):
            if not title:
                title = "<b style='color:red'>*</b>"
            table.add_header(title)

        for i, row in enumerate(csv_data):
            if i > 100:
                break
            table.add_row()
            for j, cell in enumerate(row):
                table.add_cell(cell)

        widget.add(table)

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


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