本文整理汇总了Python中pyasm.biz.Pipeline.get_by_search_type方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.get_by_search_type方法的具体用法?Python Pipeline.get_by_search_type怎么用?Python Pipeline.get_by_search_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.biz.Pipeline
的用法示例。
在下文中一共展示了Pipeline.get_by_search_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyasm.biz import Pipeline [as 别名]
# 或者: from pyasm.biz.Pipeline import get_by_search_type [as 别名]
def __init__(self, name='task_status', task_pipeline=None):
'''by default, it should grab all sthpw/task pipelines'''
if not task_pipeline:
project_code = Project.get_project_code()
task_pipeline = Pipeline.get_by_search_type('sthpw/task', project_code)
if isinstance(task_pipeline, list):
self.task_pipelines = task_pipeline
else:
self.task_pipelines = [Pipeline.get_by_code(task_pipeline)]
self.process_names = []
self.checkbox_control = None
super(TaskStatusFilterWdg,self).__init__(name)
self.label = "Task Status Filter: "
self.set_persistence()
示例2: get_context_data
# 需要导入模块: from pyasm.biz import Pipeline [as 别名]
# 或者: from pyasm.biz.Pipeline import get_by_search_type [as 别名]
def get_context_data(my, search_type='', process=''):
'''get the labels and values of contexts that can be checked in with this widget'''
# TODO: this also shows input contexts ... it should only show output
# contexts
if not search_type:
search_type = my.search_type
pipelines = Pipeline.get_by_search_type(search_type, Project.get_project_code() )
if not pipelines:
return [], []
# account for sub-pipeline
if '/' in process:
process = process.split('/', 1)[1]
contexts = []
for pipeline in pipelines:
pipeline_contexts = []
pipeline_processes = pipeline.get_process_names()
if process:
if process not in pipeline_processes:
continue
pipeline_contexts = pipeline.get_output_contexts(process)
else:
pipeline_contexts = pipeline.get_all_contexts()
for context in pipeline_contexts:
# for now, cut out the sub_context, until the pipeline
# completely defines the sub contexts as well
if context.find("/") != -1:
parts = context.split("/")
context = parts[0]
if context not in contexts:
contexts.append(context)
labels = contexts
values = contexts
return labels, values