本文整理汇总了Python中pyasm.widget.SelectWdg.add_style方法的典型用法代码示例。如果您正苦于以下问题:Python SelectWdg.add_style方法的具体用法?Python SelectWdg.add_style怎么用?Python SelectWdg.add_style使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.SelectWdg
的用法示例。
在下文中一共展示了SelectWdg.add_style方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_frame_rate_section
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例2: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例3: get_task_status_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例4: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例5: configure_category
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [as 别名]
def configure_category(my, title, category, options, options_type = {}):
div = DivWdg()
title_wdg = DivWdg()
div.add(title_wdg)
#from tactic.ui.widget.swap_display_wdg import SwapDisplayWdg
#swap = SwapDisplayWdg()
#div.add(swap)
title_wdg.add("<b>%s</b>" % title)
table = Table()
div.add(table)
#table.add_color("color", "color")
table.add_style("color: #000")
table.add_style("margin: 20px")
for option in options:
table.add_row()
display_title = Common.get_display_title(option)
td = table.add_cell("%s: " % display_title)
td.add_style("width: 150px")
option_type = options_type.get(option)
validation_scheme = ""
#add selectWdg for those options whose type is bool
if option_type == 'bool':
text = SelectWdg(name="%s/%s" % (category, option))
text.set_option('values','true|false')
text.set_option('empty','true')
text.add_style("margin-left: 0px")
elif option.endswith('password'):
text = PasswordInputWdg(name="%s/%s" % (category, option))
# dealing with options whose type is number
else:
if option_type == 'number':
validation_scheme = 'INTEGER'
else:
validation_scheme = ""
text = TextInputWdg(name="%s/%s" % (category, option), validation_scheme=validation_scheme, read_only="false")
value = Config.get_value(category, option)
if value:
text.set_value(value)
table.add_cell(text)
return div
示例6: get_season_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例7: get_file_in_package_status_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例8: get_title_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例9: get_action_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [as 别名]
def get_action_wdg(my):
filter_div = DivWdg()
select = SelectWdg("filter_action")
select.add_empty_option("-- search action --")
select.add_style("text-align: right")
select.set_option("labels", "Retrieve Search|Save Search")
select.set_option("values", "retrieve|save")
select.add_event("onchange", "spt.dg_table.search_action_cbk(this)")
filter_div.add(select)
return filter_div
示例10: get_display
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [as 别名]
def get_display(self):
# add a view action
view_div = DivWdg()
view_select = SelectWdg("action|view_action")
view_select.add_style("text-align: right")
view_select.add_empty_option("-- view --")
view_select.set_option("values", "copy_url|add_my_view|edit|save|rename|delete|custom_property|custom_script")
view_select.set_option("labels", "X Copy URL to this View|Add to My Views|Edit as Draft|Save Project View As|X Rename View|X Delete View|Add Custom Property|Add Custom Script")
view_div.add_style("float: right")
view_div.add(view_select)
view_select.add_event("onchange", "spt.dg_table.view_action_cbk(this,'%s')" % self.table_id)
return view_div
示例11: get_bay_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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_language_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [as 别名]
def get_language_select_wdg():
language_select_wdg = SelectWdg('language_code')
language_select_wdg.set_id('language_code')
language_select_wdg.add_style('display', 'inline-block')
language_select_wdg.add_empty_option()
language_search = Search('twog/language')
languages = language_search.get_sobjects()
languages = sorted(languages, key=lambda x: x.get_value('name'))
for language in languages:
language_select_wdg.append_option(language.get_value('name'), language.get_code())
return language_select_wdg
示例13: get_style_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例14: get_status_select
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [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
示例15: get_type_select_wdg
# 需要导入模块: from pyasm.widget import SelectWdg [as 别名]
# 或者: from pyasm.widget.SelectWdg import add_style [as 别名]
def get_type_select_wdg(self, name, width=80):
"""
:name: String, set as the name and ID for the select widget. Should correspond to a column on the MetaData
sobject
:width: int, the desired width of the widget in pixels
:return: SelectWdg
"""
select_wdg = SelectWdg(name)
select_wdg.set_id(name)
select_wdg.add_style('width', '{0}px'.format(width))
select_wdg.add_empty_option()
types = (
('(5.1) L', '5_1_l'),
('(5.1) R', '5_1_r'),
('(5.1) C', '5_1_c'),
('(5.1) Lfe', '5_1_lfe'),
('(5.1) Ls', '5_1_ls'),
('(5.1) Rs', '5_1_rs'),
('(7.1) L', '7_1_l'),
('(7.1) R', '7_1_r'),
('(7.1) C', '7_1_c'),
('(7.1) Lfe', '7_1_lfe'),
('(7.1) Ls', '7_1_ls'),
('(7.1) Rs', '7_1_rs'),
('(7.1) SBL', '7_1_sbl'),
('(7.1) SBR', '7_1_sbr'),
('(Stereo) Lt', 'stereo_lt'),
('(Stereo) Rt', 'stereo_rt'),
('(Stereo) Lt, Rt', 'stereo_lt_rt'),
('(Stereo) L', 'stereo_l'),
('(Stereo) R', 'stereo_r'),
('(Stereo) L, R', 'stereo_l_r'),
('Mono', 'mono')
)
for audio_type in types:
type_label = audio_type[0]
type_value = audio_type[1]
select_wdg.append_option(type_label, type_value)
# If the report was loaded from a save, and if the value is set, load it in the widget
if hasattr(self, name):
select_wdg.set_value(getattr(self, name))
return select_wdg