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


Python Table.add_row方法代码示例

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


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

示例1: make_login_table

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
 def make_login_table(my, sob):
     table = Table()
     table.add_style('background-color: #fffff1;')
     max_width = 4
     table.add_row()
     top_cell = table.add_cell('<b><u>Responsible</u></b>')
     top_cell.add_attr('colspan',max_width)
     top_cell.add_attr('align','center')
     count = 0
     users = my.server.eval("@SOBJECT(sthpw/login['location','internal']['license_type','user']['@ORDER_BY','login'])")
     for u in users:
         if count % max_width == 0:
             table.add_row()
         checker = CheckboxWdg('responsible_%s' % u.get('login'))
         checker.add_attr('login',u.get('login'))
         checker.add_attr('code',sob.get('code'))
         checker.add_attr('current_list', sob.get('responsible_users'))
         #checker.set_persistence()
         if sob.get('responsible_users') not in [None,'']:
             if u.get('login') in sob.get('responsible_users'):
                 checker.set_value(True)
             else:
                 checker.set_value(False)
         else:
             checker.set_value(False)
         checker.add_behavior(my.get_make_responsible_behavior())
         table.add_cell(checker)
         label = table.add_cell(u.get('login'))
         label.add_attr('nowrap','nowrap')
         label.add_attr('width','137px')
         count = count + 1
     return table
开发者ID:Smurgledwerf,项目名称:custom,代码行数:34,代码来源:error_viewer.py

示例2: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def get_display(my):
        sobject = my.get_current_sobject()
        code = sobject.get_code()
        sk = my.server.build_search_key('twog/movement', code)
        shipping_class = sobject.get_value('shipping_class')
        title = sobject.get_value('name')
        waybill = sobject.get_value('waybill')
        sending_company_code = sobject.get_value('sending_company_code')
        receiving_company_code = sobject.get_value('receiving_company_code')
        shipper_code = sobject.get_value('shipper_code')
        description = sobject.get_value('description')
        timestamp = sobject.get_value('timestamp')
        
        widget = DivWdg()
        table = Table()
        table.add_attr('width', '50px')
        table.add_row()
        cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/printer.png">')
        launch_behavior = my.get_launch_behavior()
        cell1.add_attr('sk',sk)
        cell1.add_attr('shipping_class',shipping_class)
        cell1.add_attr('to_comp',receiving_company_code)
        cell1.add_attr('from_comp',sending_company_code)
        cell1.add_attr('waybill',waybill)
        cell1.add_attr('title',title)
        cell1.add_attr('shipper',shipper_code)
        cell1.add_attr('description',description)
        cell1.add_attr('timestamp',timestamp)
        cell1.add_style('cursor: pointer;')
        cell1.add_behavior(launch_behavior)
        widget.add(table)

        return widget
开发者ID:Smurgledwerf,项目名称:custom,代码行数:35,代码来源:movement_printer2.py

示例3: make_check_table

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
 def make_check_table(my, dictoid, arr, sob, my_name, color, is_external_rejection=False):
     table = Table()
     table.add_style('background-color: %s;' % color)
     max_width = 3
     table.add_row()
     top_cell = table.add_cell('<b><u>%s</u></b>' % my_name)
     top_cell.add_attr('colspan',max_width)
     top_cell.add_attr('align','center')
     count = 0
     for entry in arr:
         if count % max_width == 0:
             table.add_row()
         checker = CheckboxWdg('check_%s' % dictoid[entry])
         checker.add_attr('code', sob.get('code'))
         checker.add_attr('field', dictoid[entry])
         #checker.set_persistence()
         if sob.get(dictoid[entry]):
             checker.set_value(True)
         else:
             checker.set_value(False)
         if not is_external_rejection:
             checker.add_behavior(my.get_reason_check_behavior(dictoid[entry]))
         check_hold = table.add_cell(checker)
         check_hold.add_attr('code', sob.get('code'))
         check_hold.add_attr('field', dictoid[entry])
         label = table.add_cell(entry)
         label.add_attr('nowrap','nowrap')
         label.add_attr('width','190px')
         count = count + 1 
     return table
开发者ID:Smurgledwerf,项目名称:custom,代码行数:32,代码来源:error_viewer.py

示例4: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [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_values('split_view') == 'true'
        else:
            top = self.get_viewer()
            
       
	self.process_names = [x  for x in self.process_names if x ]
        if self.is_refresh:
            if self.process_names:
                table = Table()
                table.add_row()
                td = table.add_cell()
                expression = "@SOBJECT(sthpw/note['context','in','%s'])" %'|'.join(self.process_names)
                table_id = 'main_table_left'
        
                left_table = TableLayoutWdg(table_id=table_id, search_type='sthpw/note', view=self.view,\
                    show_row_select=True, show_insert=False, state={'parent_key': self.parent_key}, inline_search=False, show_refresh=True, expression=expression )
                if self.resize:
  	 	    from tactic.ui.container import ResizeScrollWdg
                    inner_wdg = ResizeScrollWdg( width='500px', height='500px', scroll_bar_size_str='thick', scroll_expansion='inside' )
                    inner_wdg.add(left_table)
                    td.add(inner_wdg)
		else:
                    td.add(left_table)
		top.add(table)
		
        return top
开发者ID:mincau,项目名称:TACTIC,代码行数:36,代码来源:note_wdg.py

示例5: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def get_display(my):
        from tactic_client_lib import TacticServerStub

        sobject = None
        code = ""
        if "source_code" in my.kwargs.keys():
            code = str(my.kwargs.get("source_code"))
        else:
            sobject = my.get_current_sobject()
            code = sobject.get_code()
        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(
            '<img border="0" style="vertical-align: middle" title="Clone Source" name="Clone Source" src="/context/icons/silk/star.png">'
        )
        cell1.add_attr("user", user_name)
        launch_behavior = my.get_launch_behavior(code, user_name)
        cell1.add_style("cursor: pointer;")
        cell1.add_behavior(launch_behavior)
        widget.add(table)

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

示例6: make_check_table

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
 def make_check_table(my, dictoid, arr, sob, sk, my_name, color):
     #Makes a table of checklisted items
     table = Table()
     table.add_style('background-color: %s;' % color)
     #The maximum width across (max number of columns of checkboxes)
     max_width = 3
     table.add_row()
     top_cell = table.add_cell('<b><u>%s</u></b>' % my_name)
     top_cell.add_attr('colspan',max_width)
     top_cell.add_attr('align','center')
     count = 0
     for entry in arr:
         #If it has hit the max width for the row, create a new row
         if count % max_width == 0:
             table.add_row()
         #Create textbox
         check_bool = 'false'
         if sob:
             if sob.get(dictoid[entry]):
                 check_bool = 'true'
             else:
                 check_bool = 'false'
         else:
             check_bool = 'false'
         checker = CustomCheckboxWdg(name='errcheck_%s_%s' % (dictoid[entry], sk),value_field=dictoid[entry],checked=check_bool,dom_class='check_table_selector',field=dictoid[entry])
         check_hold = table.add_cell(checker)
         check_hold.add_attr('field', dictoid[entry])
         label = table.add_cell(entry)
         label.add_attr('nowrap','nowrap')
         label.add_attr('width','190px')
         count = count + 1
     return table
开发者ID:2gDigitalPost,项目名称:custom,代码行数:34,代码来源:error_entry_wdg.py

示例7: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
 def get_display(my):
     sob_sk = ''
     name = ''
     height = 20
     if 'sk' in my.kwargs.keys():
         sob_sk = str(my.kwargs.get('sk'))
     else: 
         sobject = my.get_current_sobject()
         sob_sk = sobject.get_search_key() 
     if 'name' in my.kwargs.keys():
         name = my.kwargs.get('name')
         if 'height' in my.kwargs.keys():
             height = my.kwargs.get('height') 
     processes = ''
     if 'processes' in my.kwargs.keys():
         processes = my.kwargs.get('processes')
         
     widget = DivWdg()
     table = Table()
     table.add_attr('width', '50px')
     table.add_row()
     cell1 = None
     if name == '':
         cell1 = table.add_cell('<img border="0" style="vertical-align: middle" title="" src="/context/icons/silk/_spt_upload.png">')
     else:
         cell1 = table.add_cell('<input type="button" value="%s" style="height: %spx"/>' % (name, height))
     cell1.add_attr('sk', sob_sk)
     cell1.add_attr('processes', processes)
     launch_behavior = my.get_launch_behavior()
     cell1.add_style('cursor: pointer;')
     cell1.add_behavior(launch_behavior)
     widget.add(table)
     return widget
开发者ID:2gDigitalPost,项目名称:custom,代码行数:35,代码来源:uploader.py

示例8: handle_python_script_test

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def handle_python_script_test(self, top):
        top.add(DivWdg('Python Script Test', css='spt_info_title'))
        table = Table(css='script')
        table.add_color("color", "color")
        table.add_style("margin: 10px")
        table.add_style("width: 100%")
        top.add(table)
        table.add_row()
        td = table.add_cell("Script Path: ")
        td.add_style("width: 150px")
        text = TextWdg('script_path')
        td = table.add_cell(text)
        button = ActionButtonWdg(title='Run')
        table.add_cell(button)
        button.add_style("float: right")
        button.add_behavior( {
        'type': 'click_up',
        'cbjs_action': '''
             var s = TacticServerStub.get();
             try {
                var path =  bvr.src_el.getParent('.script').getElement('.spt_input').value;
                if (! path)
                    throw('Please enter a valid script path');
                s.execute_cmd('tactic.command.PythonCmd', {script_path: path});
             } catch(e) {
                spt.alert(spt.exception.handler(e));
             }

        '''
        })
开发者ID:mincau,项目名称:TACTIC,代码行数:32,代码来源:system_info_wdg.py

示例9: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def get_display(self):
        self.order_sk = str(self.kwargs.get("order_sk"))
        self.title_code = str(self.kwargs.get("title_code"))
        full_title = str(self.kwargs.get("full_title"))
        delivs_search = Search("twog/work_order_deliverables")
        delivs_search.add_filter("title_code", self.title_code)
        delivs = delivs_search.get_sobjects()
        linked = []
        for d in delivs:
            linked.append(d.get_value("satisfied"))
        satisfied = 0
        unsatisfied = 0
        for link in linked:
            if link == True:
                satisfied += 1
            else:
                unsatisfied += 1

        table = Table()
        table.add_row()
        deliverable_launcher = table.add_cell("<u>Delivs: (%s/%s)</u>" % (satisfied, satisfied + unsatisfied))
        deliverable_launcher.add_attr("nowrap", "nowrap")
        deliverable_launcher.add_attr("valign", "bottom")
        deliverable_launcher.add_style("font-size: 80%;")
        deliverable_launcher.add_style("font-color: #2e2e2e;")
        deliverable_launcher.add_style("cursor: pointer;")
        deliverable_launcher.add_behavior(get_launch_deliverables_behavior(self.order_sk, self.title_code, full_title))

        return table
开发者ID:2gDigitalPost,项目名称:custom,代码行数:31,代码来源:deliverable_count_wdg.py

示例10: get_sobject_info_wdg

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def get_sobject_info_wdg(my):
        attr_table = Table()
        attr_table.add_color("color", "color")
        attr_table.add_color("background", "background", -5)
        attr_table.add_border()
        attr_table.set_box_shadow("0px 0px 5px")

        sobject = my.get_sobject()

        tr, td = attr_table.add_row_cell()
        td.add("<b>Task Info<hr/></b>")
        td.add_style("padding-top: 5px")
        td.add_style("padding-left: 5px")


        titles, exprs = my.get_task_info()
        for title, expr in zip(titles, exprs):
            try:
                value = Search.eval(expr, sobject, single=True)
            except Exception, e:
                print "WARNING: ", e.message
                continue

            if value == '':
                value = '<i>none</i>'
            attr_table.add_row()
            th = attr_table.add_cell("%s: " % title)
            th.add_style("text-align: left")
            th.add_style("padding-right: 15px")
            th.add_style("padding-left: 5px")
            th.add_style("padding-bottom: 2px")
            td = attr_table.add_cell(value)
开发者ID:davidsouthpaw,项目名称:TACTIC,代码行数:34,代码来源:sobject_wdg.py

示例11: get_files_checkbox_from_file_list

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
def get_files_checkbox_from_file_list(file_sobjects, selected_file_sobjects):
    """
    Given a list of file sobjects, return a table of Checkbox widgets (CheckboxWdg) using the file paths and codes.
    If a file is also in the selected_file_sobjects list, check it automatically.

    :param file_sobjects: List of file sobjects
    :param selected_file_sobjects: List of file sobjects (that are already selected)
    :return: Table
    """

    files_checkbox_table = Table()

    header_row = files_checkbox_table.add_row()
    header = files_checkbox_table.add_header(data='Files', row=header_row)
    header.add_style('text-align', 'center')
    header.add_style('text-decoration', 'underline')

    for file_sobject in file_sobjects:
        checkbox = CheckboxWdg(name=file_sobject.get_code())

        if file_sobject.get_code() in [selected_file.get_code() for selected_file in selected_file_sobjects]:
            checkbox.set_checked()

        checkbox_row = files_checkbox_table.add_row()

        files_checkbox_table.add_cell(data=checkbox, row=checkbox_row)
        files_checkbox_table.add_cell(data=file_sobject.get_value('file_path'), row=checkbox_row)

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

示例12: get_display

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
 def get_display(my): 
     #my.init()
     item_table = Table(css='minimal')
     item_table.add_style('margin-left','30px')
    
     for item in my.items:
         item_table.add_row()
         space_td = item_table.add_blank_cell()
         
         item_td = item_table.add_cell(item.get_description())
         item_td.set_attr("nowrap", "1")
         
         delete = IconSubmitWdg("Remove from group", \
             "stock_stop-16.png",add_hidden=False)
         delete.add_event("onclick","document.form.remove_cmd.value=\
             '%s|%s';document.form.submit();" \
             % (my.group.get_primary_key_value(), item.get_primary_key_value()) )
         del_span = SpanWdg(css='med')
         del_span.add(delete)
         item_table.add_cell(del_span)
     if not my.items:
         item_table.add_blank_cell()
    
     my.add(item_table)
     return super(ItemInContainerWdg, my).get_display()
开发者ID:0-T-0,项目名称:TACTIC,代码行数:27,代码来源:sobject_group_wdg.py

示例13: get_header_wdg

# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_row [as 别名]
    def get_header_wdg(my):
        outer = DivWdg()

        div = DivWdg()
        outer.add(div)
        div.add_color("background", "background3")
        div.add_style("padding: 5px")
        div.add_border()

        table = Table()
        table.add_style("margin-left: auto")
        table.add_style("margin-right: auto")
        table.add_color("color", "color")
        table.add_style("font-size: 1.5em")
        table.add_style("font-weight: bold")

        table.add_row()

        # add the month navigators
        date_str = "%s, %s" % (my.MONTHS[my.month - 1], my.year)
        month_wdg = DivWdg()
        month_wdg.add_style("width: 150px")
        month_wdg.add(date_str)

        prev_month_wdg = my.get_prev_month_wdg()
        next_month_wdg = my.get_next_month_wdg()

        table.add_cell(prev_month_wdg)
        td = table.add_cell(month_wdg)
        td.add_style("text-align: center")
        table.add_cell(next_month_wdg)

        div.add(table)

        return outer
开发者ID:pombredanne,项目名称:TACTIC,代码行数:37,代码来源:sobject_calendar_wdg.py

示例14: get_display

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

示例15: get_section_three_subsection_one

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


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