Move header extraction to python script and improve compatibility.
This commit is contained in:
parent
005639c032
commit
86bc49c244
22
headerextract.py
Normal file
22
headerextract.py
Normal file
@ -0,0 +1,22 @@
|
||||
import sys
|
||||
|
||||
#inFile = sys.stdin
|
||||
|
||||
beginSig = "-----BEGIN PGP"
|
||||
endSig = "-----END PGP"
|
||||
output = ""
|
||||
keyBegun = False
|
||||
|
||||
for line in sys.stdin:
|
||||
sigIndex = 0
|
||||
if beginSig in line:
|
||||
if keyBegun:
|
||||
exit(1)
|
||||
keyBegun = True
|
||||
sigIndex = line.find(beginSig)
|
||||
if keyBegun:
|
||||
output += line[sigIndex:]
|
||||
if endSig in line:
|
||||
break
|
||||
|
||||
print(output)
|
Loading…
x
Reference in New Issue
Block a user