本文整理汇总了Python中pyasm.widget.SelectWdg.append_option方法的典型用法代码示例。如果您正苦于以下问题:Python SelectWdg.append_option方法的具体用法?Python SelectWdg.append_option怎么用?Python SelectWdg.append_option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.SelectWdg
的用法示例。
在下文中一共展示了SelectWdg.append_option方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [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
示例2: get_task_status_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_task_status_select_wdg(task_sobject):
"""
Given a sthpw/task sobject, return a SelectWdg with all its potential status options. This is done by looking up
what those options are through the parent Pipeline.
:param task_sobject: sthpw/task sobject
:return: SelectWdg
"""
task_status_select = SelectWdg('task_status_select')
task_status_select.set_id('task_status_select')
task_status_select.add_style('width: 165px;')
task_status_select.add_empty_option()
task_pipe_code = task_sobject.get_value('pipeline_code')
# if the current task has no pipeline, then search for
# any task pipeline
if not task_pipe_code:
# just use the default
task_pipe_code = 'task'
pipeline = Pipeline.get_by_code(task_pipe_code)
if not pipeline:
pipeline = Pipeline.get_by_code('task')
for status in pipeline.get_process_names():
task_status_select.append_option(status, status)
if task_sobject.get('status'):
task_status_select.set_value(task_sobject.get('status'))
return task_status_select
示例3: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_display(self):
div_wdg = DivWdg()
current_code_div = DivWdg()
component_code = self.file_flow_sobject.get('component_code')
component_sobject = get_sobject_by_code('twog/component', component_code)
current_code_div.add('Current Component set to {0} ({1})'.format(component_sobject.get('name'),
component_code))
order_sobject = get_order_sobject_from_component_sobject(component_sobject)
component_sobjects_for_order = get_component_sobjects_from_order_code(order_sobject.get_code())
component_select_wdg = SelectWdg()
component_select_wdg.set_id('component_select')
component_select_wdg.add_style('width: 165px;')
component_select_wdg.add_empty_option()
for component in component_sobjects_for_order:
component_select_wdg.append_option(component.get('name'), component.get_code())
div_wdg.add(current_code_div)
div_wdg.add(component_select_wdg)
return div_wdg
示例4: get_frame_rate_section
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_frame_rate_section(self):
section_span = SpanWdg()
section_span.add('Frame Rate: ')
frame_rate_select = SelectWdg('frame_rate_select')
frame_rate_select.set_id('frame_rate_code')
frame_rate_select.add_style('width', '153px')
frame_rate_select.add_style('display', 'inline-block')
frame_rate_select.add_empty_option()
frame_rate_search = Search('twog/frame_rate')
frame_rates = frame_rate_search.get_sobjects()
for frame_rate in frame_rates:
frame_rate_select.append_option(frame_rate.get_value('name'), frame_rate.get_code())
try:
frame_rate_select.set_value(self.frame_rate_code)
except AttributeError:
pass
section_span.add(frame_rate_select)
return section_span
示例5: get_season_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_season_select_wdg(width=300):
season_select_wdg = SelectWdg('season_code')
season_select_wdg.set_id('season_code')
season_select_wdg.add_style('width', '{0}px'.format(width))
season_search = Search('twog/season')
seasons = season_search.get_sobjects()
for season in seasons:
season_select_wdg.append_option(season.get_value('name'), season.get_code())
return season_select_wdg
示例6: get_file_in_package_status_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_file_in_package_status_select():
task_status_select = SelectWdg('file_status_select')
task_status_select.set_id('file_status_select')
task_status_select.add_style('width: 165px;')
task_status_select.add_empty_option()
pipeline = Pipeline.get_by_code('twog_Delivery')
for status in pipeline.get_process_names():
task_status_select.append_option(status, status)
return task_status_select
示例7: get_title_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_title_select_wdg(width=300):
title_select_wdg = SelectWdg('title_code')
title_select_wdg.set_id('title_code')
title_select_wdg.add_style('width', '{0}px'.format(width))
title_select_wdg.add_empty_option()
title_search = Search('twog/title')
titles = title_search.get_sobjects()
for title in titles:
title_select_wdg.append_option(title.get_value('name'), title.get_code())
return title_select_wdg
示例8: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_display(self):
outer_div = DivWdg()
outer_div.set_id('new-department-request-entry-form')
page_label = "<div>Fill out the following form to submit a new request. The request will be added to the " \
"department's list, and will be addressed as soon as possible. You will receive a " \
"notification when the request is complete.</div><br/>"
outer_div.add(page_label)
outer_div.add(get_label_widget('Name'))
outer_div.add(get_text_input_wdg('name', 800))
outer_div.add(get_label_widget('Description'))
outer_div.add(obu.get_text_area_input_wdg('description', 800, [('display', 'block')]))
outer_div.add(get_label_widget('Due Date'))
outer_div.add(get_datetime_calendar_wdg())
department_select_wdg = SelectWdg('department_select')
department_select_wdg.append_option('Onboarding', 'onboarding')
department_select_wdg.append_option('Edel', 'edel')
department_select_wdg.append_option('Compression', 'compression')
department_select_wdg.append_option('QC', 'qc')
outer_div.add(get_label_widget('Department'))
outer_div.add(department_select_wdg)
self.get_submit_widget(outer_div)
return outer_div
示例9: get_assigned_group_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_assigned_group_select(my, assigned, name):
# Make the select element for groups
groups_expr = "@GET(sthpw/login_group['login_group','not in','user|client|compression supervisor|edit supervisor|machine room supervisor|media vault supervisor|qc supervisor|sales supervisor|scheduling supervisor|streamz|executives|admin|management|office employees|it'].login_group)"
groups = my.server.eval(groups_expr)
group_sel = SelectWdg(name)
if len(groups) > 0:
group_sel.append_option('--Select--', '')
if assigned:
group_sel.set_value(assigned)
else:
group_sel.set_value('')
for group in groups:
group_sel.append_option(group, group)
return group_sel
示例10: get_assigned_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_assigned_select(my, assigned):
# Make the select element for workers
workers_expr = "@GET(sthpw/login['location','internal']['license_type','user'].login)"
workers = my.server.eval(workers_expr)
work_sel = SelectWdg('task_assigned_select')
if len(workers) > 0:
work_sel.append_option('--Select--', '')
if assigned:
work_sel.set_value(assigned)
else:
work_sel.set_value('')
for worker in workers:
work_sel.append_option(worker, worker)
return work_sel
示例11: get_bay_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_bay_select(self):
bay_sel = SelectWdg('bay_select')
bay_sel.set_id('bay')
bay_sel.add_style('width', '135px')
bay_sel.add_empty_option()
for i in range(1, 13):
bay_sel.append_option('Bay %s' % i, 'Bay %s' % i)
try:
bay_sel.set_value(self.bay)
except AttributeError:
pass
return bay_sel
示例12: get_style_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_style_select(self):
style_sel = SelectWdg('style_select')
style_sel.set_id('style')
style_sel.add_style('width: 135px;')
style_sel.add_empty_option()
for style in ('Technical', 'Spot QC', 'Mastering'):
style_sel.append_option(style, style)
try:
style_sel.set_value(self.style_sel)
except AttributeError:
pass
return style_sel
示例13: get_status_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_status_select(self):
status_sel = SelectWdg('status_select')
status_sel.set_id('status')
status_sel.add_style('width', '135px')
status_sel.add_empty_option()
statuses = ('Approved', 'In Progress', 'Rejected')
for status in statuses:
status_sel.append_option(status, status)
if hasattr(self, 'status'):
status_sel.set_value(self.status)
return status_sel
示例14: get_assigned_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_assigned_select(self, assigned):
workers_search = Search("sthpw/login")
workers_search.add_filter('location', 'internal')
workers_search.add_filter('license_type', 'user')
workers = workers_search.get_sobjects()
work_sel = SelectWdg('task_assigned_select')
if len(workers) > 0:
work_sel.append_option('--Select--', '')
if assigned:
work_sel.set_value(assigned)
else:
work_sel.set_value('')
for worker in workers:
work_sel.append_option(worker.get_value('login'), worker.get_value('login'))
return work_sel
示例15: get_sel
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import append_option [as 别名]
def get_sel(my, id_name, arr, default, alpha_sort):
this_sel = SelectWdg(id_name)
this_sel.add_attr('id',id_name)
if default not in arr and default not in [None,'']:
arr.append(default)
if alpha_sort:
arr.sort()
arr2 = []
for a in arr:
arr2.append(a)
this_sel.append_option('--Select--','')
for a in arr2:
this_sel.append_option(a,a)
this_sel.set_value(default)
return this_sel