本文整理汇总了Python中pyasm.web.Widget.add_color方法的典型用法代码示例。如果您正苦于以下问题:Python Widget.add_color方法的具体用法?Python Widget.add_color怎么用?Python Widget.add_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.Widget
的用法示例。
在下文中一共展示了Widget.add_color方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import Widget [as 别名]
# 或者: from pyasm.web.Widget import add_color [as 别名]
def get_display(self):
self.check()
if self.is_refresh:
div = Widget()
else:
div = DivWdg()
self.set_as_panel(div)
div.add_style('padding','6px')
min_width = '400px'
div.add_style('min-width', min_width)
div.add_color('background','background')
div.add_class('spt_add_task_panel')
div.add_style("padding: 20px")
from tactic.ui.app import HelpButtonWdg
help_button = HelpButtonWdg(alias="creating-tasks")
div.add(help_button)
help_button.add_style("float: right")
help_button.add_style("margin-top: -5px")
if not self.search_key_list:
msg_div = DivWdg()
msg_table = Table()
msg_div.add(msg_table)
msg_table.add_row()
msg_table.add_cell( IconWdg("No items selected", IconWdg.WARNING) )
msg_table.add_cell('Please select at least 1 item to add tasks to.')
msg_div.add_style('margin: 10px')
msg_table.add_style("font-weight: bold")
div.add(msg_div)
return div
msg_div = DivWdg()
msg_div.add_style('margin-left: 4px')
div.add(msg_div, 'info')
msg_div.add('Total: %s item/s to add tasks to' %len(self.search_key_list))
div.add(HtmlElement.br())
hint = HintWdg('Tasks are added according to the assigned pipeline.')
msg_div.add(" ")
msg_div.add(hint)
msg_div.add(HtmlElement.br())
option_div = DivWdg(css='spt_ui_options')
#option_div.add_style('margin-left: 12px')
sel = SelectWdg('pipeline_mode', label='Create tasks by: ')
sel.set_option('values', ['simple process','context', 'standard'])
sel.set_option('labels', ['process','context', 'all contexts in process'])
sel.set_persistence()
sel.add_behavior({'type':'change',
'cbjs_action': 'spt.panel.refresh(bvr.src_el)'})
option_div.add(sel)
value = sel.get_value()
# default to simple process
if not value:
value = 'simple process'
msg = ''
if value not in ['simple process','context','standard']:
value = 'simple process'
if value == 'context':
msg = 'In context mode, a single task will be created for each selected context.'
elif value == 'simple process':
msg = 'In process mode, a single task will be created for each selected process.'
elif value == 'standard':
msg = 'In this mode, a task will be created for all contexts of each selected process.'
option_div.add(HintWdg(msg))
div.add(option_div)
div.add(HtmlElement.br())
title = DivWdg('Assigned Pipelines')
title.add_style('padding: 6px')
title.add_color('background','background2')
title.add_color('color','color', +120)
div.add(title)
content_div = DivWdg()
content_div.add_style('min-height', '150px')
div.add(content_div)
content_div.add_border()
filtered_search_key_list = []
for sk in self.search_key_list:
id = SearchKey.extract_id(sk)
if id=='-1':
continue
filtered_search_key_list.append(sk)
sobjects = SearchKey.get_by_search_keys(filtered_search_key_list)
skipped = []
pipeline_codes = []
for sobject in sobjects:
if isinstance(sobject, Task):
#.........这里部分代码省略.........