Mercurial > hg > python
comparison mailer.py @ 52:10f17205908f
debug info for bad subdict
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Mon, 29 May 2023 21:57:13 +0100 |
parents | e67a5ecd6198 |
children |
comparison
equal
deleted
inserted
replaced
51:44fea514ca45 | 52:10f17205908f |
---|---|
400 mailer=smtplib.SMTP() | 400 mailer=smtplib.SMTP() |
401 mailer.connect() | 401 mailer.connect() |
402 for l in addrFile: | 402 for l in addrFile: |
403 addrFields=l.rstrip().split('\t') | 403 addrFields=l.rstrip().split('\t') |
404 if doSub: | 404 if doSub: |
405 bodyPlus=body%subDict(addrFields) | 405 try: |
406 bodyPlus=body%subDict(addrFields) | |
407 except KeyError: | |
408 print("can't subDict",repr(subDict(addrFields)), | |
409 body) | |
410 usage('-S') | |
406 else: | 411 else: |
407 bodyPlus=body | 412 bodyPlus=body |
408 if signature is not None: | 413 if signature is not None: |
409 bodyPlus+="\n--\n" | 414 bodyPlus+="\n--\n" |
410 bodyPlus+=signature | 415 bodyPlus+=signature |