read ubmails at generation time
This commit is contained in:
@@ -23,6 +23,7 @@ pre_tops:
|
||||
|
||||
post_tops:
|
||||
- title: Unbeantwortete E-Mails
|
||||
command: ./read_ubmails.py
|
||||
protostub: '<intern>
|
||||
|
||||
{{top.body}}
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user