From 4a742162d0897d3cc9ca5464e97a1d48dac4943c Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Mon, 10 Feb 2020 01:18:11 +0000 Subject: [PATCH] Suppress output if there are no matched jobs --- archivebot-jobs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archivebot-jobs b/archivebot-jobs index c3c4578..169b5d2 100755 --- a/archivebot-jobs +++ b/archivebot-jobs @@ -177,6 +177,9 @@ if True: # For sensible indentation transform = lambda x: x.lower() if "'${filtercaseinsensitive}'" and isinstance(x, str) else x jobs = [job for job in jobs if compFunc(transform(job[columnIdx]), transform(filterDict["value"]))] + if not jobs: + sys.exit(0) + # Sort class reversor: # https://stackoverflow.com/a/56842689 def __init__(self, obj):