diff --git a/generator.conf.example b/generator.conf.example index 01f6b9c..c0a0e3f 100644 --- a/generator.conf.example +++ b/generator.conf.example @@ -23,6 +23,7 @@ pre_tops: post_tops: - title: Unbeantwortete E-Mails + command: ./read_ubmails.py protostub: ' {{top.body}} diff --git a/prepare_presentation.sh b/prepare_presentation.sh index 0dfdfbc..9c30191 100755 --- a/prepare_presentation.sh +++ b/prepare_presentation.sh @@ -4,8 +4,6 @@ dest_file="$(realpath "$(dirname "$0")")/data/presentation_$(date +%Y-%m-%d).tex echo Reading old protocols ./read_db.sh -echo Getting E-Mail -./read_ubmails.py echo Generating ./generate.py --presentation >"$dest_file" diff --git a/prepare_protocol.sh b/prepare_protocol.sh index 9f38ca4..b25a6a2 100755 --- a/prepare_protocol.sh +++ b/prepare_protocol.sh @@ -4,7 +4,6 @@ echo Reading old protocols ./read_db.sh echo Getting E-Mail ./read_topmails.py -./read_ubmails.py echo Generating ./generate.py --proto > ~/fsmi/protokolle/$(date +%Y-%m-%d) diff --git a/read_ubmails.py b/read_ubmails.py index 083286a..7a2f4db 100755 --- a/read_ubmails.py +++ b/read_ubmails.py @@ -12,8 +12,7 @@ import quopri from pprint import pprint from dateutil import parser -MAILDIR = "/home/yannik/mail/INBOX/" -OUTFILE = "data/ubemails.txt" +MAILDIR = "/home/yannik/mail/INBOX.FSMI/" def decode_header(header): decoded_header = email.header.decode_header(header)[0] @@ -46,5 +45,4 @@ if __name__ == "__main__": print("WARNING: Mail is not from today", file=sys.stderr) payload = latest.get_payload(decode=True).decode("utf8").strip() result = (payload.rpartition("\n--")[0].strip() if "\n--" in payload else payload) - with open(OUTFILE, "w") as f: - f.write(result+"\n") + print(result)