本文整理汇总了Python中pyasm.web.Table.add_cell方法的典型用法代码示例。如果您正苦于以下问题:Python Table.add_cell方法的具体用法?Python Table.add_cell怎么用?Python Table.add_cell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Table
的用法示例。
在下文中一共展示了Table.add_cell方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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()
示例2: get_files_checkbox_from_file_list
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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
示例3: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
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
示例4: make_check_table
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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
示例5: get_sobject_info_wdg
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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)
示例6: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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
示例7: get_delivery_snapshot_section
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
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
示例8: get_header_wdg
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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
示例9: get_section_one_table_one
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
def get_section_one_table_one(self, label_value_pairs_1, label_value_pairs_2):
table = Table()
table.add_row()
table.add_header('')
table.add_header('Feature')
table.add_header('Trailer/Preview')
for label_value_pair in label_value_pairs_1:
label, value = label_value_pair
table.add_row()
table.add_cell(label)
for column in ('feature', 'preview'):
select_wdg_id = value + '_' + column
table.add_cell(self.get_true_false_select_wdg(select_wdg_id))
for label_value_pair in label_value_pairs_2:
label, value = label_value_pair
table.add_row()
table.add_cell(label)
table.add_cell()
table.add_cell(self.get_true_false_select_wdg(value))
return table
示例10: get_section_two_bottom_table
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
def get_section_two_bottom_table(self):
table = Table()
table.add_style('margin', '10px')
table.add_row()
table.add_header('')
table.add_header('Feature')
table.add_header('Audio Bundle')
table.add_header('Trailer/Preview')
label_value_pairs = (
('Audio configuration verified (stereo or mono/mapping is correct)?', 'audio_configuration_verified'),
('Audio is in sync with video (checked in 3 random spots and head/tail)?', 'audio_in_sync_with_video'),
('Audio is tagged correctly?', 'audio_tagged_correctly'),
('No audio is cut off (at beginning or end)?', 'no_audio_cut_off'),
('TRT of audio equals TRT of the video?', 'trt_audio_equals_trt_video'),
('Correct language is present (on applicable channels)?', 'correct_language_present')
)
for label_value_pair in label_value_pairs:
table.add_row()
table.add_cell(label_value_pair[0])
for section in ('feature', 'audio', 'preview'):
table.add_cell(self.get_true_false_select_wdg(label_value_pair[1] + '_' + section))
return table
示例11: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
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
示例12: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
def get_display(my):
from tactic.ui.widget import SObjectCheckinHistoryWdg
my.sob_code = str(my.kwargs.get('sob_code'))
my.st = str(my.kwargs.get('st'))
my.open_type = str(my.kwargs.get('open_type'))
my.name = str(my.kwargs.get('name'))
sk = my.server.build_search_key(my.st, my.sob_code)
obs = InspectScripts()
edit_wdg = EditWdg(element_name='general', mode=my.open_type, search_type=my.st, code=my.sob_code, title=my.name, view='edit', widget_key='edit_layout')
table = Table()
table.add_attr('class','sob_edit_top')
table.add_row()
edit_sob_cell = table.add_cell(edit_wdg)
edit_sob_cell.add_attr('valign','top')
table.add_row()
history = SObjectCheckinHistoryWdg(search_key=sk)
history_cell = table.add_cell(history)
history_cell.add_attr('class','history_sob_cell')
table.add_row()
checkin = TwogEasyCheckinWdg2(sk=sk,code=my.sob_code)
checkin_cell = table.add_cell(checkin)
checkin_cell.add_attr('class','checkin_sob_cell')
checkin_cell.add_attr('width','100%s' % '%')
checkin_cell.add_attr('align','center')
return table
示例13: get_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
def get_display(my):
dd_activator = DivWdg()
if my.style:
dd_activator.add_styles( my.style )
dd_activator.add_style( "width: %spx" % my.width )
dd_activator.add_class("SPT_DTS");
if my.nudge_menu_horiz != 0:
dd_activator.set_attr("spt_nudge_menu_horiz", my.nudge_menu_horiz)
if my.nudge_menu_vert != 0:
dd_activator.set_attr("spt_nudge_menu_vert", my.nudge_menu_vert)
# Generate button ...
#
table = Table()
table.add_row()
table.add_styles("width: 100%; padding: 0px; margin: 0px;")
td = table.add_cell()
td.add_looks("menu border curs_default")
td.add_styles( "padding: 0px; width: 100%; overflow: hidden; height: 12px; max-height: 12px;" )
title_div = DivWdg()
title_div.add_styles( "padding: 0px; margin-left: 4px; margin-top: 1px;" )
if my.icon_path:
img = HtmlElement.img()
img.set_attr("src", my.icon_path)
img.set_attr("title", my.title)
img.add_styles("padding: 0px; padding-bottom: 1px; margin: 0px; text-decoration: none;")
title_div.add(img)
title_div.add_looks("menu")
else:
title_div.add(my.title)
title_div.add_looks("menu fnt_text")
td.add( title_div )
td = table.add_cell()
# -- Example of setting only some of the borders with dotted style ...
# td.add_looks( "menu_btn_icon clear_borders border_bottom border_right dotted" )
td.add_looks( "menu_btn_icon border curs_default" )
td.add_styles( "padding: 0px; text-align: center; overflow: hidden; " \
"width: 15px; min-width: 15px;" \
"height: 12px; max-height: 12px;" )
arrow_img = HtmlElement.img("/context/icons/silk/_spt_bullet_arrow_down_dark_8x8.png")
arrow_img.add_styles( "border: 0px; margin-left: 1px; margin-top: 0px;" )
td.add( arrow_img )
dd_activator.add(table)
dd_activator.add( my.kwargs.get("smart_menu_set") )
dd_activator.add_class("SPT_SMENU_ACTIVATOR")
dd_activator.add_behavior( { 'type': 'click_up', 'activator_type' : 'smart_menu',
'cbjs_action': 'spt.smenu.show_on_dropdown_click_cbk( evt, bvr )' } )
return dd_activator
示例14: get_example_display
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [as 别名]
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
示例15: handle_python_script_test
# 需要导入模块: from pyasm.web import Table [as 别名]
# 或者: from pyasm.web.Table import add_cell [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));
}
'''
})