read ubmails at generation time
This commit is contained in:
@@ -23,6 +23,7 @@ pre_tops:
|
|||||||
|
|
||||||
post_tops:
|
post_tops:
|
||||||
- title: Unbeantwortete E-Mails
|
- title: Unbeantwortete E-Mails
|
||||||
|
command: ./read_ubmails.py
|
||||||
protostub: '<intern>
|
protostub: '<intern>
|
||||||
|
|
||||||
{{top.body}}
|
{{top.body}}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ dest_file="$(realpath "$(dirname "$0")")/data/presentation_$(date +%Y-%m-%d).tex
|
|||||||
|
|
||||||
echo Reading old protocols
|
echo Reading old protocols
|
||||||
./read_db.sh
|
./read_db.sh
|
||||||
echo Getting E-Mail
|
|
||||||
./read_ubmails.py
|
|
||||||
echo Generating
|
echo Generating
|
||||||
./generate.py --presentation >"$dest_file"
|
./generate.py --presentation >"$dest_file"
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ echo Reading old protocols
|
|||||||
./read_db.sh
|
./read_db.sh
|
||||||
echo Getting E-Mail
|
echo Getting E-Mail
|
||||||
./read_topmails.py
|
./read_topmails.py
|
||||||
./read_ubmails.py
|
|
||||||
echo Generating
|
echo Generating
|
||||||
|
|
||||||
./generate.py --proto > ~/fsmi/protokolle/$(date +%Y-%m-%d)
|
./generate.py --proto > ~/fsmi/protokolle/$(date +%Y-%m-%d)
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ import quopri
|
|||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
|
||||||
MAILDIR = "/home/yannik/mail/INBOX/"
|
MAILDIR = "/home/yannik/mail/INBOX.FSMI/"
|
||||||
OUTFILE = "data/ubemails.txt"
|
|
||||||
|
|
||||||
def decode_header(header):
|
def decode_header(header):
|
||||||
decoded_header = email.header.decode_header(header)[0]
|
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)
|
print("WARNING: Mail is not from today", file=sys.stderr)
|
||||||
payload = latest.get_payload(decode=True).decode("utf8").strip()
|
payload = latest.get_payload(decode=True).decode("utf8").strip()
|
||||||
result = (payload.rpartition("\n--")[0].strip() if "\n--" in payload else payload)
|
result = (payload.rpartition("\n--")[0].strip() if "\n--" in payload else payload)
|
||||||
with open(OUTFILE, "w") as f:
|
print(result)
|
||||||
f.write(result+"\n")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user