lyxpaperview: take the first match

This commit is contained in:
Juergen Spitzmueller 2020-08-27 12:05:49 +02:00
parent d44929ff81
commit 0d98fb8548

View File

@ -84,7 +84,7 @@ def find(args, path):
# have this already # have this already
continue continue
px = subprocess.Popen(['grep', '-i', arg], stdin=px.stdout, stdout=subprocess.PIPE) px = subprocess.Popen(['grep', '-i', arg], stdin=px.stdout, stdout=subprocess.PIPE)
p4 = subprocess.Popen(['head', '-n 2'], stdin=px.stdout, stdout=subprocess.PIPE) p4 = subprocess.Popen(['head', '-n 1'], stdin=px.stdout, stdout=subprocess.PIPE)
p1.stdout.close() p1.stdout.close()
output = p4.communicate() output = p4.communicate()
return output[0].decode("utf8")[:-1]# strip trailing '\n' return output[0].decode("utf8")[:-1]# strip trailing '\n'