summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2024-01-16 21:51:47 +0100
committerTimotej Lazar <timotej.lazar@araneo.si>2024-01-16 21:52:20 +0100
commit5f0ceead2408003559310054789eccce271d3f52 (patch)
treee34b865d737f73a4d7b29dd6d1a1214171a4bb7b
parent816171f23522f6200d3af538146a9740f45f439e (diff)
Use more Python
-rwxr-xr-xmargfools4
1 files changed, 2 insertions, 2 deletions
diff --git a/margfools b/margfools
index 5b70fd4..5fc52a9 100755
--- a/margfools
+++ b/margfools
@@ -97,8 +97,8 @@ if __name__ == '__main__':
# keep signing whatever they send us
while True:
for name in ('AttachmentHashes', 'XmlHashes'):
- if request.get(name) is not None:
- request[f'Signed{name}'] = [sign(e, args.key, pin, engine=args.engine) for e in request[name]]
+ if values := request.get(name, []):
+ request[f'Signed{name}'] = [sign(v, args.key, pin, engine=args.engine) for v in values]
r = session.put(f'{url}signatures/{request["SignatureRequestId"]}',
headers=headers | {'Content-Type': 'application/json; charset=utf-8'},