outdated_tasks: Filter tasks by repo and by owner

This commit is contained in:
Ivan A. Melnikov 2021-08-12 15:05:36 +04:00
parent b060666d91
commit 58c796d15c

View File

@ -55,7 +55,7 @@ def is_outdated(task, package_evrs):
return True
def main(config_path, repo):
def main(config_path, repo, owner='all'):
logging.basicConfig(
format='%(asctime)s %(levelname)-5s %(name)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
@ -70,9 +70,11 @@ def main(config_path, repo):
task_list = tasks.load_tasks(config['tasks'], repo)
outdated = sorted((task for task in task_list
if is_outdated(task, existing)),
key=lambda x: utils.maybe_int(x['taskid']))
outdated = (task for task in task_list
if task['repo'] == repo and is_outdated(task, existing))
if owner and owner != 'all':
outdated = (task for task in outdated
if task['owner'] == owner)
for task in outdated:
print(tasks.format_task(task))