本文整理汇总了Python中job.Job.visible方法的典型用法代码示例。如果您正苦于以下问题:Python Job.visible方法的具体用法?Python Job.visible怎么用?Python Job.visible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类job.Job
的用法示例。
在下文中一共展示了Job.visible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _running_queue_generator
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import visible [as 别名]
def _running_queue_generator(qs_output, user_pattern):
queue = None
for info in map(lambda l: l.split(), qs_output.split('\n')[2:]):
if not info:
break
elif not (len(info) == 1 and set(info[0]) == set(['-'])):
if not info[0].isdigit():
queue = Queue(*info)
else:
job = Job(*info)
if user_pattern.match(job.user):
job.visible()
queue.set_job(job)
else:
yield queue
queue = None
if queue:
yield queue
示例2: _get_pending_job
# 需要导入模块: from job import Job [as 别名]
# 或者: from job.Job import visible [as 别名]
def _get_pending_job(qs_output, user_pattern):
pjline_no = -1
for i, info in enumerate(map(lambda l: l.split(), qs_output.split('\n'))):
if len(info) == 1 and set(info[0]) == set('#'):
pjline_no = i
break
jobs = []
if pjline_no >= 0:
for line in qs_output.split('\n')[pjline_no + 3:]:
if not line:
break
jobid, prior = line.split()[:2]
name = line.lstrip()[len(jobid+prior)+2:][:10].rstrip()
job = Job(*([jobid, prior, name] + line.lstrip()[len(jobid+prior)+13:].split()))
if user_pattern.match(job.user):
job.visible()
jobs.append(job)
return jobs