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

Python web.DivWdg类代码示例

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

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



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

示例1: get_display

    def get_display(self):

        top = self.top
        top.add_color("background", "background")
        top.add_border()
        top.add_style("padding: 10px")
        top.add_style("font-size: 12px")

        from tactic.ui.container import WizardWdg

        title = DivWdg()
        title.add("Share Project")


        wizard = WizardWdg(title=title, submit_title="Save", command="tactic.ui.sync.SyncServerAddCbk")

        top.add(wizard)


        #wizard.add(self.get_local_wdg(), "Local")
        wizard.add(self.get_info_wdg(), "Info")
        wizard.add(self.get_sync_mode_wdg(), "Mode")
        #wizard.add(self.get_export_wdg(), "Export")
        #wizard.add(self.get_security_wdg(), "Security")

        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:sync_settings_wdg.py


示例2: generate_div

 def generate_div(self):
     ''' this is meant to be called to get the container div for the 
         ajax widget '''
     div = DivWdg()
     div.set_id(self.display_id)
     div.add_style("display: block")
     return div
开发者ID:mincau,项目名称:TACTIC,代码行数:7,代码来源:web_tools.py


示例3: get_display

 def get_display(my):
     widget = DivWdg()
     table = Table()
     table.add_attr('class','my_preferences_wdg')
    
     prefs = my.login_obj.get('twog_preferences').split(',')
     for pref in prefs:
         if pref not in [None,'']:
             kv = pref.split('=')
             key = kv[0]
             val = kv[1]
             table.add_row()
             desc = table.add_cell(my.key_dict[key])
             desc.add_attr('nowrap','nowrap')
             this_sel = SelectWdg(key)
             this_sel.add_attr('id',key)
             this_sel.add_style('width: 100px;')
             this_sel.append_option('True','true')
             this_sel.append_option('False','false')
             this_sel.set_value(val)
             table.add_cell(this_sel)
     table.add_row()
     t2 = Table()
     t2.add_row()
     t2.add_cell()
     tc = t2.add_cell('<input type="button" name="Save My Preferences" value="Save My Preferences"/>')
     tc.add_attr('width', '50px')
     tc.add_behavior(my.get_save_preferences())
     t2.add_cell()
     table.add_cell(t2)
     widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:32,代码来源:preferences.py


示例4: get_display

    def get_display(self):

        sobject = self.get_current_sobject()
        sobject_id = sobject.get_id()
        result = self.data.get(sobject_id)

        top = DivWdg()
        if not result:
            return top


        expression = self.get_option("expression")
        if expression:
            value = Search.eval(expression, result)
        else:
            column = self.get_option("column")
            if not column:
                column = self.get_name()
            try:
                value = result.get_value(column)
            except:
                value = ""

        top.add(value)

        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:related_element_wdg.py


示例5: get_info_wdg

    def get_info_wdg(self):

        div = DivWdg()
        div.add_class("spt_info")


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


示例6: get_example_display

    def get_example_display(self):

        div = DivWdg()

        # --- Example of using _handoff_ property in behavior -----------------------------------------------------

        table = Table()
        table.add_row()
        td = table.add_cell()
        td.set_style( "background: #0f0f0f; color: #9f9f9f; border: 1px solid black; padding: 4px;" )
        td_id = 'HandOffSource'
        td.set_id(td_id)
        td.add( "Element '%s' with '_handoff_' property in bvr spec" % td_id )
        td.add_behavior( {
                '_handoff_': '$(@.parentNode).getElement("#HandOffTarget")',

                'type': 'click',
                'cbfn_action': 'spt.ui_play.test_handoff',
                'dst_el': '$(@.parentNode).getElement("#DestElForBvr");'
            } )

        td = table.add_cell()
        td.set_style( "background: #2f2f2f; color: #9f9f9f; border: 1px solid black; padding: 4px; cursor: pointer;" )
        td_id = 'HandOffTarget'
        td.set_id(td_id)
        td.add( "Element '%s' that receives the handed off behavior" % td_id );

        td = table.add_cell()
        td.set_style( "background: #4f4f4f; color: #9f9f9f; border: 1px solid black; padding: 4px;" )
        td_id = 'DestElForBvr'
        td.set_id(td_id)
        td.add( "Element '%s' specified as dst_el for handed off behavior" % td_id );
        div.add( table )

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


示例7: get_display

    def get_display(self):
        sobject = self.get_current_sobject()

        snapshots = []
        if isinstance(sobject, Layer):
            # for layer renders, we try to get all render sobjects
            renders = Render.get_all_by_sobject(sobject)
            if renders:
                snapshots = Snapshot.get_by_sobjects(renders, is_current=True)
        else: # for object that has direct snapshots like plates
            snapshot = Snapshot.get_current_by_sobject(sobject)
            if snapshot:
                snapshots.append(snapshot)

        if not snapshots:
            return "<i>- no files -</i>"

        div = DivWdg()

        for snapshot in snapshots:
            file_types = snapshot.get_all_file_types()
            table = Table(css='embed')

            for file_type in file_types:
                table.add_row()
                
                table.add_cell( self.get_open_wdg(snapshot, file_type) )
                dir = snapshot.get_client_lib_dir(file_type=file_type)
                
                
                table.add_cell( "%s: <i>%s</i>" % (file_type, dir) )
         

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


示例8: get_display

    def get_display(my):
        sobject = None
        if 'order_code' in my.kwargs.keys():
            my.order_code = my.kwargs.get('order_code')
        else:
            sobject = my.get_current_sobject()
            my.order_code = sobject.get_code()
        sobject = my.server.eval("@SOBJECT(twog/order['code','%s'])" % my.order_code)[0]
        my.order_name = sobject.get('name')
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        login = Environment.get_login()
        user_name = login.get_login()
        table.add_row()
        cell1 = table.add_cell('<b><u>Calculate Costs</u></b>')
        cell1.add_attr('order_code', my.order_code)
        cell1.add_attr('user', user_name)
        cell1.add_attr('order_name', my.order_name)
        cell1.add_attr('nowrap','nowrap')
        launch_behavior = my.get_launch_behavior()
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:26,代码来源:cost_calculator.py


示例9: get_group_bottom_wdg

    def get_group_bottom_wdg(my, sobjects):

        expression = my.get_option("group_bottom")
        if not expression:
            return None

        # parse the expression
        my.vars = my.get_vars()

        parser = ExpressionParser()
        result = parser.eval(expression, sobjects=sobjects, vars=my.vars)

        format_str = my.kwargs.get("display_format")
        if format_str:
            from tactic.ui.widget import FormatValueWdg

            format_wdg = FormatValueWdg(format=format_str, value=result)
            result = format_wdg
        else:
            result = str(result)

        div = DivWdg()
        div.add(result)
        div.add_style("text-align: right")
        # div.add_class( "spt_%s_expr_bottom" % (my.get_name()) )

        # add a listener
        # for sobject in sobjects:
        #    if sobject.is_insert():
        #        continue
        #
        #    if my.enable_eval_listener:
        #        my.add_js_expression(div, sobject, expression)

        return div
开发者ID:raidios,项目名称:TACTIC,代码行数:35,代码来源:expression_element_wdg.py


示例10: get_display

    def get_display(self):

        widget = DivWdg()

        # get the current project
        project_code = Project.get_project_name()
        user = Environment.get_user_name()

        pipeline = Pipeline.get_by_code("task")
        process_names = pipeline.get_process_names()

        widget.add("Tasks Assigned: ")
        for status in process_names:
            search = Search("sthpw/task")
            #search.add_filter("project_code", project_code)
            search.add_filter("assigned", user)
            search.add_filter("status", status)

            #search.add_where("now() - timestamp < '1 day'")

            count = search.get_count()
            if not count:
                continue

            widget.add("%s (%s) " % (status,count))
        return widget
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:my_tactic_summary_wdg.py


示例11: get_display

 def get_display(my):
     sobject = my.get_current_sobject()
     sk = sobject.get_search_key()
     widget = DivWdg()
     sts_to_perm = {'twog/qc_report_vars': 'compression|qc supervisor|edeliveries'}
     if '-1' not in sk:
         table = Table()
         table.add_attr('width', '50px')
         login = Environment.get_login()
         user_name = login.get_login()
         groups = Environment.get_group_names()
         st = sk.split('?')[0]; 
         perms = sts_to_perm[st] 
         allow = False
         for g in groups:
             if g in perms:
                 allow = True
         if user_name == 'admin':
             allow = True
         if allow:
             table.add_row()
             cell1 =  table.add_cell(my.x_butt)
             cell1.add_attr('id','sp_del_%s' % sk)
             launch_behavior = my.get_delete_behavior(sk)
             cell1.add_style('cursor: pointer;')
             cell1.add_behavior(launch_behavior)
             widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:28,代码来源:special_delete.py


示例12: get_display

    def get_display(my):

        top = my.top


        unity_wdg = DivWdg()
        top.add(unity_wdg)
        unique_id = unity_wdg.set_unique_id("unity")

        unity_wdg.add("Unity content can't be played. Make sure you are using compatible browser with JavaScript enabled.")
        #<input id="versionButton" type="button" value="Version" disabled="disabled" onclick="versionButtonClick();" />


        # TEST TEST TEST: dynamic loading of js
        env = Environment.get()
        install_dir = env.get_install_dir()
        js_path = "%s/src/context/spt_js/UnityObject.js" % install_dir
        f = open(js_path)
        init_js = f.read()
        f.close()
        top.add_behavior( {
            'type': 'load',
            'cbjs_action': '''
            %s;
            %s;
            ''' % (init_js, my.get_load_js(unique_id) )
        } )



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


示例13: get_div_for_department_instructions

    def get_div_for_department_instructions(self, department_instructions_sobject):
        department_instructions_div = DivWdg()

        department_instructions_div.add(HtmlElement.h4(department_instructions_sobject.get('name')))
        department_instructions_div.add(HtmlElement.p(department_instructions_sobject.get('instructions_text')))

        return department_instructions_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:7,代码来源:instructions_template_builder_wdg.py


示例14: get_instantiation_wdg

    def get_instantiation_wdg(self):
        setting = self.get_default_setting()
        default_instantiation = setting.get('instantiation')

        div = DivWdg()
        is_unchecked = True
        default_cb = None
        for value in self.get_instantiation_options():
            name = self.get_element_name("instantiation")
            checkbox = CheckboxWdg( name )
            if value == default_instantiation:
                default_cb = checkbox
            
            checkbox.set_option("value", value)
            checkbox.set_persistence()
            if checkbox.is_checked():
                is_unchecked = False
            checkbox.add_behavior({'type': 'click_up', 
                    'propagate_evt': True,
                     "cbjs_action": "spt.toggle_checkbox(bvr, '.spt_ui_options', '%s')" %name}) 
            span = SpanWdg(checkbox, css='small')
            span.add(value)
            div.add(span)
        if is_unchecked:
            default_cb.set_checked()
        return div
开发者ID:mincau,项目名称:TACTIC,代码行数:26,代码来源:load_options_wdg.py


示例15: 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


示例16: get_file_type_wdg

    def get_file_type_wdg(my):
        '''drop down which selects which file type to export to'''
        # add a filter
        div = DivWdg()

        filter_div = FloatDivWdg(HtmlElement.b("File Type:"), width="15em")
        div.add(filter_div)

        select = SelectWdg()
        select.set_name("file_type")
        select.set_id("file_type")

        app = WebContainer.get_web().get_selected_app()

        if app == 'Maya':
            select.set_option("values", "mayaAscii|mayaBinary|obj|collada")
            select.set_option("labels", "Maya Ascii (.ma)|Maya Binary (.mb)|Wavefront .obj|Collada (.dae)")
        elif app == 'Houdini':
            select.set_option("values", "otl")
            select.set_option("labels", "Houdini Digital Asset(.otl)")
        elif app == 'XSI':
            select.set_option("values", "emdl|dotXSI|obj")
            select.set_option("labels", "3D Model (.emdl)|SoftImage dotXSI (.xsi)|Wavefront .obj")
        else:
            select.set_option("values", "mayaAscii|mayaBinary|obj|collada")
            select.set_option("labels", "Maya Ascii (.ma)|Maya Binary (.mb)|Wavefront .obj|Collada (.dae)")

        select.add_style("font-size: 0.8em")
        select.add_style("margin-top: 5px")
        select.add_style("margin-right: 10px")
        select.set_persistence()
        
        div.add(select)
        return div
开发者ID:0-T-0,项目名称:TACTIC,代码行数:34,代码来源:app_sobject_checkin_wdg.py


示例17: add_header

    def add_header(my, table, sobj_title):
        title_str = my.kwargs.get("title")

        if not title_str:
            if my.mode == 'insert':
                action = 'Add New Item'
            elif my.mode == 'edit':
                action = 'Save Changes'
            else:
                action = my.mode
            
            title_str =  action.capitalize() + " to " + sobj_title
            if my.mode == 'edit':
                title_str = '%s (%s)' %(title_str, my.sobjects[0].get_code())
            

        th = table.add_header()
        
        title_div = DivWdg()
        title_div.set_attr('title', my.view)
        th.add(title_div)
        title_div.add(title_str)
        th.add_color("background", "background3")
        if my.color_mode == "default":
            th.add_color("border-color", "table_border", default="border")
            th.add_style("border-width: 1px")
            th.add_style("border-style: solid")
        th.set_attr("colspan", "2")
        th.add_style("height: 30px")
开发者ID:funic,项目名称:TACTIC,代码行数:29,代码来源:edit_wdg.py


示例18: get_delivery_snapshot_section

    def get_delivery_snapshot_section(self):
        label_value_pairs = (
            ('Feature', 'feature_delivery_snapshot'),
            ('Trailer', 'trailer_delivery_snapshot'),
            ('Alt Audio', 'alt_audio_delivery_snapshot'),
            ('Subtitle', 'subtitle_delivery_snapshot'),
            ('CC', 'cc_delivery_snapshot'),
            ('Vendor Notes', 'vendor_notes_delivery_snapshot'),
            ('Poster Art', 'poster_art_delivery_snapshot'),
            ('Dub Card', 'dub_card_delivery_snapshot')
        )

        table = Table()
        table.add_style('float', 'left')

        table.add_row()
        table.add_header('Delivery Snapshot')

        for label_value_pair in label_value_pairs:
            label, value = label_value_pair

            table.add_row()
            table.add_cell(label)
            table.add_cell(self.get_true_false_select_wdg(value))

        section_div = DivWdg()
        section_div.add(table)

        return section_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:29,代码来源:metadata_report_wdg.py


示例19: get_search_wdg

    def get_search_wdg(self):
        filter_div = DivWdg()
        filter_div.add_style("width: 100px")

        buttons_list = [
            {'label': 'Run Search', 'tip': 'Run search with this criteria' },
        ]

        txt_btn_set = TextBtnSetWdg( position='', buttons=buttons_list, spacing=6, size='large', side_padding=4 )
        run_search_bvr = {
            'type':         'click_up',
            'cbjs_action':  '''
                spt.app_busy.show('Search ...', 'Searching Active Directory for matching users.');
                setTimeout( function() {
                var top = bvr.src_el.getParent('.ad_search_wdg_top');
                var values = spt.api.Utility.get_input_values(top);
                spt.panel.refresh(top, values);
                spt.app_busy.hide();
                }, 100);
            '''
        }
        txt_btn_set.get_btn_by_label('Run Search').add_behavior( run_search_bvr )
        #filter_div.add( txt_btn_set )

        div = DivWdg()
        div.add_behavior(run_search_bvr)
        button = ProdIconButtonWdg("Run Search")
        button.add_behavior(run_search_bvr)

        div.add(button)
        filter_div.add(div)
        return filter_div
开发者ID:mincau,项目名称:TACTIC,代码行数:32,代码来源:ad_search_wdg.py


示例20: get_section_three_subsection_one

    def get_section_three_subsection_one(self):
        label_value_pairs = (
            ('Forced narrative on feature?', 'forced_narrative_feature',
             'Does not overlap any credits or other text?', 'overlap_credits_text_1'),
            ('Forced narrative on trailer?', 'forced_narrative_trailer',
             'Does not overlap any credits or other text?', 'overlap_credits_text_2'),
            ('Subtitles on feature?', 'subtitles_on_feature',
             'Does not overlap any credits or other text?', 'overlap_credits_text_3'),
            ('Subtitles on trailer?', 'subtitles_on_trailer',
             'Does not overlap any credits or other text?', 'overlap_credits_text_4'),
        )

        table = Table()

        for label_value_pair in label_value_pairs:
            label_1, value_1, label_2, value_2 = label_value_pair

            table.add_row()
            table.add_cell(label_1)
            table.add_cell(self.get_true_false_select_wdg(value_1))
            table.add_cell(label_2)
            table.add_cell(self.get_true_false_select_wdg(value_2))

        section_div = DivWdg()
        section_div.add(table)

        return section_div
开发者ID:2gDigitalPost,项目名称:custom-rewrite,代码行数:27,代码来源:metadata_report_wdg.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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