本文整理汇总了Python中pyasm.biz.Task.get_default_color方法的典型用法代码示例。如果您正苦于以下问题:Python Task.get_default_color方法的具体用法?Python Task.get_default_color怎么用?Python Task.get_default_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.biz.Task
的用法示例。
在下文中一共展示了Task.get_default_color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_td
# 需要导入模块: from pyasm.biz import Task [as 别名]
# 或者: from pyasm.biz.Task import get_default_color [as 别名]
def handle_td(my, td):
sobject = my.get_current_sobject()
value = my.get_value()
color = Task.get_default_color(value)
if color:
td.add_style("background-color: %s" % color)
super(SObjectStatusElementWdg, my).handle_td(td)
示例2: handle_td
# 需要导入模块: from pyasm.biz import Task [as 别名]
# 或者: from pyasm.biz.Task import get_default_color [as 别名]
def handle_td(self, td):
sobject = self.get_current_sobject()
edit_scope = self.get_option("edit_scope")
if edit_scope == "assigned":
login = Environment.get_user_name()
user = Environment.get_login()
security = Environment.get_security()
if not security.is_admin() and login != sobject.get_value("assigned"):
td.add_class("spt_cell_no_edit")
# find the pipeline code of the task
pipeline_code = sobject.get_value('pipeline_code', no_exception=True)
parent_pipeline_code = ''
if self.parent:
parent_pipeline_code = self.parent.get_value('pipeline_code', no_exception=True)
if sobject.get_base_search_type() == "sthpw/snapshot":
pipeline_code = "snapshot"
# if not find the pipeline of the parent and match the process
if not pipeline_code:
task_process = sobject.get_value("process")
if task_process:
parent = self.parent
if parent:
parent_pipeline_code = parent.get_value('pipeline_code', no_exception=True)
pipeline = Pipeline.get_by_code(parent_pipeline_code)
if pipeline:
attributes = pipeline.get_process_attrs(task_process)
pipeline_code = attributes.get('task_pipeline')
value = self.get_value()
color = Task.get_default_color(value)
# If task status pipeline is chosen,
# use color attribute from status (process)
if pipeline_code:
td.set_attr("spt_pipeline_code", pipeline_code)
pipeline = Pipeline.get_by_code(pipeline_code)
if pipeline:
#attributes = pipeline.get_process_attrs(value)
#color = attributes.get("color")
process = pipeline.get_process(value)
if process:
color = process.get_color()
if not color:
process_sobject = pipeline.get_process_sobject(value)
if process_sobject:
color = process_sobject.get_value("color")
if color:
td.add_style("background-color: %s" % color)
if parent_pipeline_code:
td.set_attr("spt_parent_pipeline_code", parent_pipeline_code)
super(TaskStatusElementWdg, self).handle_td(td)