當前位置: 首頁>>代碼示例>>Python>>正文


Python TableWdg.set_sobject方法代碼示例

本文整理匯總了Python中pyasm.widget.TableWdg.set_sobject方法的典型用法代碼示例。如果您正苦於以下問題:Python TableWdg.set_sobject方法的具體用法?Python TableWdg.set_sobject怎麽用?Python TableWdg.set_sobject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyasm.widget.TableWdg的用法示例。


在下文中一共展示了TableWdg.set_sobject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_display

# 需要導入模塊: from pyasm.widget import TableWdg [as 別名]
# 或者: from pyasm.widget.TableWdg import set_sobject [as 別名]
    def get_display(self):
        web = WebContainer.get_web()

        widget = Widget()

        search_type = web.get_form_value("parent_search_type")
        search_id = web.get_form_value("parent_search_id")

        if not search_type:
            widget.add("RenderSubmitInfo: parent type not found")
            return widget

        hidden = HiddenWdg("parent_search_type", search_type)
        widget.add(hidden)
        hidden = HiddenWdg("parent_search_id", search_id)
        widget.add(hidden)

        sobject = Search.get_by_id(search_type, search_id)
        table = TableWdg(search_type, css="embed")
        table.set_show_property(False)
        table.set_sobject(sobject)
        table.remove_widget("render")
        table.remove_widget("description")
        widget.add(table)

        return widget
開發者ID:mincau,項目名稱:TACTIC,代碼行數:28,代碼來源:render_wdg.py

示例2: get_display

# 需要導入模塊: from pyasm.widget import TableWdg [as 別名]
# 或者: from pyasm.widget.TableWdg import set_sobject [as 別名]
    def get_display(my):

        web = WebContainer.get_web()
        search_key = web.get_form_value("search_key")

        widget = Widget()

        sobject = Search.get_by_search_key(search_key)

        table = TableWdg( sobject.get_search_type(), "render" )
        table.set_sobject(sobject)
        widget.add(table)



        # get all of the snapshots with a context render
        sobject_snapshot = Snapshot.get_latest_by_sobject(sobject,"render")
        if sobject_snapshot:
            search_type = sobject.get_search_type()
            search_id = sobject.get_value('search_id')
            
            render_snapshots = Snapshot.get_by_search_type(search_type,search_id,"render")

            table = TableWdg("sthpw/snapshot")
            table.set_sobjects(render_snapshots)
            widget.add(table)



        widget.add(HtmlElement.h3("Rendered Frames"))
        if sobject_snapshot:
            widget.add("Render version: v%0.3d" % sobject_snapshot.get_value("version") )

        # get latest snapshot of the render
        renders = Render.get_all_by_sobject(sobject)
        if not renders:
            widget.add("<h4>No renders found</h4>")
            return widget

        render = renders[0]
        snapshot = Snapshot.get_latest_by_sobject(render,"render")
        if snapshot == None:
            widget.add("<h4>No snapshots found</h4>")
            return widget


        # get the images
        web_dir = snapshot.get_web_dir()
        lib_dir = snapshot.get_lib_dir()

        xml = snapshot.get_xml_value("snapshot")
        file_nodes = xml.get_nodes("snapshot/file")
        file_name = icon_file_name = ''
        frame_range = icon_frame_range = None
        
        for file_node in file_nodes: 
            if Xml.get_attribute(file_node, 'type') == 'main':
                file_name, frame_range = my._get_frame_info(file_node, sobject)
            if Xml.get_attribute(file_node, 'type') == 'icon':
                icon_file_name, icon_frame_range = my._get_frame_info(file_node, sobject)
            
        file_names = [file_name]
        icon_file_names = [icon_file_name]        

        if "##" in file_name:
            file_names = FileGroup.expand_paths(file_name, frame_range)
        if "##" in icon_file_name:
            icon_file_names = FileGroup.expand_paths(icon_file_name, \
                icon_frame_range)    
        
        div = DivWdg()
        for k in range(len(file_names)):
            file_name = file_names[k]

            # ignore frames that don't exist
            lib_path = "%s/%s" % (lib_dir, file_name)
            if not os.path.exists(lib_path):
                continue
           
            try:
                icon_file_name = icon_file_names[k]
            except IndexError:
                icon_file_name = file_names[k]
                
            file_path = "%s/%s" % (web_dir, file_name)
            icon_file_path = "%s/%s" % (web_dir, icon_file_name)
            
            img = HtmlElement.img(icon_file_path)
            img.set_attr("width", "60")
            img.add_event("onmouseover","hint_bubble.show(event,'Ctrl + Click to open in new window')")

            href = HtmlElement.href(img, file_path)
            div.add(href)

        widget.add(div)

        widget.add( "<h3>Render History</h3>" )
        widget.add( my.get_render_history(renders) )

        return widget
開發者ID:0-T-0,項目名稱:TACTIC,代碼行數:102,代碼來源:frame_info_wdg.py


注:本文中的pyasm.widget.TableWdg.set_sobject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。