Ignore Signed Pages and just do it
This commit is contained in:
parent
2f73bfae47
commit
8a8d20d241
15
pgp-sign.py
15
pgp-sign.py
@ -10,11 +10,18 @@ for file_ in sys.argv[1:]:
|
||||
print(f'Signing {file_} ...')
|
||||
with open(file_, 'r') as fh:
|
||||
content = fh.read()
|
||||
content = re.sub(r'^\s*<!doctype[^>]*>', '', content)
|
||||
proc = subprocess.run(['gpg', '--armor', '--detach-sign', '--output', '-', '--local-user', 'papatutuwawa@polynom.me', file_],
|
||||
capture_output=True, check=True, input=content, encoding='utf-8')
|
||||
#content = re.sub(r'^\s*<!doctype[^>]*>', '', content)
|
||||
proc = subprocess.run(['gpg',
|
||||
'--armor',
|
||||
'--detach-sign',
|
||||
'--output', '-',
|
||||
'--local-user', 'papatutuwawa@polynom.me',
|
||||
file_],
|
||||
capture_output=True,
|
||||
check=True,
|
||||
input=content,
|
||||
encoding='utf-8')
|
||||
signature = proc.stdout[:-1]
|
||||
print(signature)
|
||||
with open(file_, 'r') as fh:
|
||||
content = fh.read().replace('%%%SIGNED_PAGES_PGP_SIGNATURE%%%', signature)
|
||||
with open(file_, 'w') as fh:
|
||||
|
Loading…
Reference in New Issue
Block a user