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

Python web.Widget类代码示例

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

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



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

示例1: get_display

    def get_display(my):

        web = WebContainer.get_web()
        context_url = web.get_context_url().to_string()
        js_url = "%s/javascript" % context_url
        spt_js_url = "%s/spt_js" % context_url    # adding new core "spt" javascript library folder

        version = Environment.get_release_version()

        # add some third party libraries
        third_party = js_includes.third_party
        security = Environment.get_security()


        for include in js_includes.third_party:
            Container.append_seq("Page:js", "%s/%s" % (spt_js_url,include))

        all_js_path = js_includes.get_compact_js_filepath()

        if os.path.exists( all_js_path ):
            Container.append_seq("Page:js", "%s/%s" % (context_url, js_includes.get_compact_js_context_path_suffix()))
        else:
            for include in js_includes.legacy_core:
                Container.append_seq("Page:js", "%s/%s" % (js_url,include))

            for include in js_includes.spt_js:
                Container.append_seq("Page:js", "%s/%s" % (spt_js_url,include))

            for include in js_includes.legacy_app:
                Container.append_seq("Page:js", "%s/%s" % (js_url,include))




        # custom js files to include
        includes = Config.get_value("install", "include_js")
        includes = includes.split(",")
        for include in includes:
            include = include.strip()
            if include:
                print "include: ", include
                Container.append_seq("Page:js", include)



        widget = Widget()

        js_files = Container.get("Page:js")
        for js_file in js_files:
            widget.add('<script src="%s?ver=%s" ></script>\n' % (js_file,version) )


        return widget
开发者ID:2gDigitalPost,项目名称:tactic_src,代码行数:53,代码来源:top_wdg.py


示例2: get_display

    def get_display(my):

        web = WebContainer.get_web()
        context_url = web.get_context_url().to_string()
        js_url = "%s/javascript" % context_url
        spt_js_url = "%s/spt_js" % context_url    # adding new core "spt" javascript library folder

        version = Environment.get_release_version()

        # add some third party libraries
        third_party = js_includes.third_party
        security = Environment.get_security()

        # FIXME: this logic should not be located here.
        # no reason to have the edit_area_full.js
        if not security.check_access("builtin", "view_script_editor", "allow") and security.check_access("builtin", "view_site_admin", "allow"):
            if "edit_area/edit_area_full.js" in third_party:
                third_party.remove("edit_area/edit_area_full.js")


        for include in js_includes.third_party:
            Container.append_seq("Page:js", "%s/%s" % (spt_js_url,include))

        all_js_path = js_includes.get_compact_js_filepath()

        if os.path.exists( all_js_path ):
            Container.append_seq("Page:js", "%s/%s" % (context_url, js_includes.get_compact_js_context_path_suffix()))
        else:
            for include in js_includes.legacy_core:
                Container.append_seq("Page:js", "%s/%s" % (js_url,include))

            for include in js_includes.spt_js:
                Container.append_seq("Page:js", "%s/%s" % (spt_js_url,include))

            for include in js_includes.legacy_app:
                Container.append_seq("Page:js", "%s/%s" % (js_url,include))


        #Container.append_seq("Page:js", "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js")
        #Container.append_seq("Page:js", "/context/spt_js/UnityObject.js")


        #widget = DivWdg()
        #widget.set_id("javascript")
        #my.set_as_panel(widget)
        widget = Widget()

        js_files = Container.get("Page:js")
        for js_file in js_files:
            widget.add('<script src="%s?ver=%s" ></script>\n' % (js_file,version) )


        return widget
开发者ID:blezek,项目名称:TACTIC,代码行数:53,代码来源:top_wdg.py


示例3: get_css_wdg

    def get_css_wdg(my):

        widget = Widget()

        web = WebContainer.get_web()
        context_url = web.get_context_url().to_string()

        skin = web.get_skin()

        # first load context css
        Container.append_seq("Page:css", "%s/style/layout.css" % context_url)


        # add the color wheel css
        Container.append_seq("Page:css", "%s/spt_js/mooRainbow/Assets/mooRainbow.css" % context_url)
        Container.append_seq("Page:css", "%s/spt_js/mooDialog/css/MooDialog.css" % context_url)



        # get all of the registered css file
        css_files = Container.get_seq("Page:css")
        for css_file in css_files:
            widget.add('<link rel="stylesheet" href="%s" type="text/css" />\n' % css_file )

       
        # TEST TEST TEST
        widget.add('<link rel="stylesheet" href="/assets/_video/video-js.min.css" type="text/css" />\n')
        return widget
开发者ID:blezek,项目名称:TACTIC,代码行数:28,代码来源:top_wdg.py


示例4: get_display

    def get_display(self):

        sobject = self.get_current_sobject()
        sobject = sobject.get_parent()
        if not sobject:
            return Widget()

        # get all of the sobject_logs
        search = Search("sthpw/sobject_log")
        search.add_sobject_filter(sobject)
        logs = search.get_sobjects()

        search = Search("sthpw/transaction_log")
        search.add_filters("id", [x.get_value("transaction_log_id") for x in logs] )
        search.set_limit(200)
        logs = search.get_sobjects()
        
        from layout_wdg import TableWdg
        widget = Widget()
        table = TableWdg("sthpw/transaction_log")
        table.add_class("minimal")
        table.set_header_flag(False)
        table.set_show_property(False)
        table.set_no_results_wdg( "&nbsp;" )
        table.set_sobjects(logs)
        widget.add(table)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:27,代码来源:clipboard_wdg.py


示例5: get_tool_bar

    def get_tool_bar(self):
        widget = Widget()
        trash_div = SpanWdg()
        trash_div.set_id('trash_me')

        trash_div.add(IconWdg('Trash', IconWdg.TRASH))
        trash_div.add("TRASH!")
        trash_div.add_class("hand")
        trash_div.add_class("spt_side_bar_trash")
      
        
        trash_div.set_attr("SPT_ACCEPT_DROP", "manageSideBar")
        bvr = { "type": "click_up",\
                'cbjs_action': "alert('Drag and drop element name here to remove it.')"}
        trash_div.add_behavior(bvr)

        widget.add(trash_div)
        
        save_div = SpanWdg(css='med hand spt_side_bar_trash')
        save_div.add(IconWdg('Save', IconWdg.SAVE))
        
        bvr = { "type": "click_up",\
                'cbjs_action': "spt.custom_project.manage_action_cbk({'value':'save'},'%s');" % self.view} 
        save_div.add_behavior(bvr)
        widget.add(save_div)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:search_type_manager_wdg.py


示例6: get_checkin

    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,代码行数:29,代码来源:app_sobject_checkin_wdg.py


示例7: get_pipeline_wdg

 def get_pipeline_wdg(self):
     search = Search("sthpw/pipeline")
     widget = Widget()
     widget.set_search(search)
     table = TableWdg("sthpw/pipeline", "manage")
     widget.add(table)
     return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:7,代码来源:admin_tab_wdg.py


示例8: get_camera_wdg

    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,代码行数:25,代码来源:preprod_tab_wdg.py


示例9: get_art_reference

    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,代码行数:31,代码来源:preprod_tab_wdg.py


示例10: get_tool_bar

    def get_tool_bar(my):
        widget = Widget()
        trash_div = SpanWdg()
        # reset some global variables on load
        trash_div.add_behavior({'type':'load', 'cbjs_action':'spt.side_bar.trashed_items=[]; spt.side_bar.changed_views={}'})

        trash_div.set_id('trash_me')

        trash_div.add(IconWdg('Trash', IconWdg.TRASH))
        trash_div.add("TRASH!")
        trash_div.add_class("hand")
        trash_div.add_class("spt_side_bar_trash")
      
        trash_div.set_attr("SPT_ACCEPT_DROP", "manageSideBar")
        bvr = { "type": "click_up",\
                'cbjs_action': "alert('Drag and drop link or folder here to remove it.')"}
        trash_div.add_behavior(bvr)

        widget.add(trash_div)
        
        save_div = SpanWdg(css='med hand spt_side_bar_trash')
        save_div.add(IconWdg('Save Ordering', IconWdg.SAVE))
      
        # FIXME: is_personal???
        is_personal = 'false'
        bvr = { "type": "click_up",\
                'cbjs_action': "spt.side_bar.manage_section_action_cbk({'value':'save'},'%s',%s);" % (my.view, is_personal)} 
        save_div.add_behavior(bvr)
        widget.add(save_div)
        return widget
开发者ID:blezek,项目名称:TACTIC,代码行数:30,代码来源:view_manager_wdg.py


示例11: get_display

    def get_display(self):
        if self.is_refresh:
            top = Widget()
            self.add(top)
            web = WebContainer.get_web()
            self.checked_processes = web.get_form_values('process_names')
            left_checked_processes = web.get_form_values('left_process_names')
            right_checked_processes = web.get_form_values('right_process_names')
            is_split_view = web.get_form_value('split_view') == 'true'
        else:
            top = self.get_viewer()
            
            
            

       

        if self.is_refresh:
            if is_split_view:
               viewer = self.get_split_viewer()
               top.add(viewer)
            else:
               inner_wdg = SingleNoteViewerWdg(processes_names=self.process_names, parent_key=self.kwargs.get('parent_key'), resize='false', append_context=self.append_context, view=self.view)
               top.add(inner_wdg)
                
        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:note_wdg.py


示例12: get_display

    def get_display(my):
        my.view = my.kwargs.get('view')
        if not my.view:
            my.view = 'publish'
        widget = Widget()
        sobject = my.get_current_sobject()
        search_type = sobject.get_search_type()
        search_id = sobject.get_id()

        if my.get_option('preview') != 'false': 
            my.thumb.set_current_index(my.get_current_index())
            widget.add(my.thumb)

        publish_link = PublishLinkWdg(search_type,search_id, config_base=my.view) 
        div = DivWdg(publish_link)
        div.set_style('clear: left; padding-top: 6px')
        widget.add(div)

        # build a popup link to show publish browsing
        browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
        browse_link.add_behavior({'type': 'click_up',
            'cbjs_action': 'spt.popup.get_widget(evt, bvr)',
            'options': {'popup_id' : 'publish_browser',
                        'class_name' : 'pyasm.prod.web.PublishBrowserWdg' ,
                        'title': 'Publish Browser'},
            'args' : { 'search_type': search_type,
                        'search_id' : search_id }
            })
        div.add(browse_link)
        div.set_style('padding-top: 6px')


        return widget
开发者ID:funic,项目名称:TACTIC,代码行数:33,代码来源:table_element_wdg.py


示例13: get_display

    def get_display(my):
        widget = Widget()
        
        thumb = super(ThumbPublishWdg, my).get_display()

        widget.add(thumb)
        sobject = my.get_current_sobject()
        search_type = sobject.get_search_type()
        search_id = sobject.get_id()

        publish_link = PublishLinkWdg(search_type,search_id) 
        div = DivWdg(publish_link)
        div.set_style('clear: left; padding-top: 6px')
        widget.add(div)

        # build an iframe to show publish browsing
        browse_link = IconButtonWdg("Publish Browser", IconWdg.CONTENTS)
        iframe = WebContainer.get_iframe()
        iframe.set_width(100)

        url = WebContainer.get_web().get_widget_url()
        url.set_option("widget", "pyasm.prod.web.PublishBrowserWdg")
        url.set_option("search_type", search_type)
        url.set_option("search_id", search_id)
        script = iframe.get_on_script(url.to_string())
        browse_link.add_event("onclick", script)

        div.add(browse_link)
        div.set_style('padding-top: 6px')


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


示例14: get_display

    def get_display(my):
        widget = Widget()

        app = "Maya"

        widget.add("<h3>Application Setup Wizard</h3>")
        block = HtmlElement.blockquote()


        block.add("<p>Step 1: Launch %s (or start with a new session)</p>" % app)

        # sphere test
        block.add("<p>Step 2: Sphere test</p>")

        sphere_button = ProdIconButtonWdg("Sphere")
        sphere_button.add_event("onclick", "app.mel('sphere')")
        block.add( sphere_button)
        block.add( "If a sphere appears when clicking on this button, then the Maya connector is functiioning")

        block.add("<p>Step 3: Introspection</p>")

        introspect_button = ProdIconButtonWdg("Introspect")
        introspect_button.add_event("onclick", "introspect()")
        block.add( introspect_button)
 
        block.add("<p>Step 4: Create C:/temp/sthpw</p>")

        block.add("<p>Step 5: Check in Sphere</p>")

        block.add("<p>Step 6: Load Sphere</p>")

        widget.add(block)

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


示例15: get_title

    def get_title(self):
        widget = Widget()

        if not Container.get('GeneralAppletWdg'):
            widget.add( GeneralAppletWdg() )
            Container.put('GeneralAppletWdg', True)
        widget.add(super(LayerTableElementWdg, self).get_title())
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:8,代码来源:composite_wdg.py


示例16: get_display

    def get_display(self):

        web = WebContainer.get_web()
        response = web.get_response()

        # get info from url
        site_obj = Site.get()
        path = web.get_request_path()
        path_info = site_obj.break_up_request_path(path)
        site = path_info.get("site")
        project_code = path_info.get("project_code")


        # find the relative path
        hash = self.kwargs.get("hash")
        parts = hash[1:]
        rel_path = "/".join(parts)

        #rel_path = "asset/Fantasy/Castle/54d45150c61251f65687d716cc3951f1_v001.jpg"


        # construct all of the paths
        asset_dir = web.get_asset_dir()
        base_dir = "%s/%s" % (asset_dir, project_code)
        path = "%s/%s" % (base_dir, rel_path)
        filename = os.path.basename(rel_path)

        print "path: ", path



        # determine the mimetype automatically
        import mimetypes
        base, ext = os.path.splitext(path)
        ext = ext.lower()
        mimetype = mimetypes.types_map[ext]

        headers = response.headers
        response.headers['Content-Type'] = mimetype

        response.headers['Content-Disposition'] = 'inline; filename={0}'.format(filename)

        use_xsendfile = True
        if use_xsendfile:
            response.headers['X-Sendfile'] = path
            return Widget(path)

        else:

            response.headers['Content-Transfer-Encoding'] = 'BINARY'

            widget = Widget()
            f = open(path, 'rb')
            data = f.read()
            f.close()

            widget.add(data)
            return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:58,代码来源:top_wdg.py


示例17: get_display

    def get_display(my):

        top = Widget()
        from tactic.ui.panel import CustomLayoutWdg
        #widget = CustomLayoutWdg(view="bootstrap.basic.test_mootools", is_top=True)
        widget = CustomLayoutWdg(view="bootstrap.themes.jumbotron.main2", is_top=True)
        #widget = CustomLayoutWdg(view="bootstrap.basic.test2", is_top=True)
        top.add(widget)
        return top
开发者ID:asmboom,项目名称:TACTIC,代码行数:9,代码来源:top_wdg.py


示例18: get_display

    def get_display(my):
        web = WebContainer.get_web()
        if not my.view:
            view = web.get_form_value("filter|view")

        # create popup
        create_popup = PopupWdg("create_action")
        create_popup.set_auto_hide(False)
        create_popup.add("Enter name of view: ")
        create_popup.add(TextWdg("create_view_name"))
        # create_popup.add( HtmlElement.br(2) )
        # create_popup.add( "Copy from template: " )
        # template_select = SelectWdg("copy_from_template")
        # template_select.add_empty_option("-- None --")
        # template_select.set_option("values", "list|summary|task")
        # create_popup.add( template_select )

        create_popup.add(HtmlElement.br(2, clear="all"))

        from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg

        create_icon = ProdIconButtonWdg("Create")

        ajax = AjaxCmd()
        ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
        ajax.add_element_name("create_view_name")
        ajax.add_element_name("auto_create_edit")
        ajax.set_option("search_type", my.search_type)
        ajax.set_option("project", Project.get_project_code())
        if my.view:
            ajax.set_option("template_view", my.view)
        create_icon.add_event(
            "onclick",
            "%s;%s"
            % (ajax.get_on_script(), "toggle_display('create_action');setTimeout('document.form.submit()',1000)"),
        )

        cancel_icon = ProdIconButtonWdg("Cancel")
        cancel_icon.add_event("onclick", "toggle_display('create_action')")

        span = SpanWdg()
        span.add(create_icon)
        span.add(cancel_icon)
        create_popup.add(span)
        create_popup.add(HtmlElement.br())

        # add the create button
        create = IconButtonWdg("Create View", IconWdg.SAVE, True)
        create.add_event("onclick", "%s" % create_popup.get_on_script())

        # lay it all out
        widget = Widget()
        widget.add(create_popup)
        # Browser does not have create
        # widget.add(create)
        return widget
开发者ID:hellios78,项目名称:TACTIC,代码行数:56,代码来源:custom_view_app_wdg.py


示例19: get_milestone_wdg

    def get_milestone_wdg(self):
        widget = Widget()

        search = Search("sthpw/milestone")
        
        table = TableWdg("sthpw/milestone")
        table.set_search(search)

        widget.add(table)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:10,代码来源:admin_tab_wdg.py


示例20: get_project_settings_wdg

    def get_project_settings_wdg(self):
        widget = Widget()

        search = Search("prod/prod_setting")
        
        table = TableWdg("prod/prod_setting")
        table.set_search(search)

        widget.add(table)
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:10,代码来源:admin_tab_wdg.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python web.WidgetSettings类代码示例发布时间:2022-05-25
下一篇:
Python web.WebContainer类代码示例发布时间: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