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


Python Widget.add方法代码示例

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


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

示例1: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:55,代码来源:top_wdg.py

示例2: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:55,代码来源:top_wdg.py

示例3: get_css_wdg

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:30,代码来源:top_wdg.py

示例4: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:29,代码来源:clipboard_wdg.py

示例5: get_tool_bar

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:28,代码来源:search_type_manager_wdg.py

示例6: get_pipeline_wdg

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
 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,代码行数:9,代码来源:admin_tab_wdg.py

示例7: get_checkin

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [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

示例8: get_camera_wdg

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget 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 Widget [as 别名]
# 或者: from pyasm.web.Widget 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_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
 def get_display(my):
     search_type = my.search_type
     related_search_type = my.related_search_type_wdg.get_value()
     if related_search_type:
         search_type = related_search_type
     hier_sel = my.get_hier_sel(search_type)
     selected_related_search_type = hier_sel.get_value()
     
     process_wdg = my.get_process_wdg(search_type)
     context_wdg = my.get_context_wdg(search_type)
     widget = my.main_div
     if my.is_from_ajax(True):
         widget = Widget()
     else:
         my.set_ajax_top(widget)
     
     hidden = HiddenWdg("search_type" ,search_type)
     widget.add(hidden)
     
     hier_sel.add_event('onchange', my.get_refresh_script(show_progress=False))
     widget.add(hier_sel)
     #Tooltip doesn't work too well
     #hint = HintWdg('Related search type you can optionally select to drive the process')
    
     widget.add(HtmlElement.br(2))
     widget.add(process_wdg)
     
     widget.add(context_wdg)
     return widget
开发者ID:0-T-0,项目名称:TACTIC,代码行数:31,代码来源:filter_wdg.py

示例11: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:28,代码来源:note_wdg.py

示例12: get_tool_bar

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:32,代码来源:view_manager_wdg.py

示例13: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:35,代码来源:table_element_wdg.py

示例14: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:34,代码来源:prod_table_element_wdg.py

示例15: get_display

# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add [as 别名]
    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,代码行数:36,代码来源:maya_tab_wdg.py


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