forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiana-review-email
More file actions
executable file
·36 lines (24 loc) · 1.05 KB
/
iana-review-email
File metadata and controls
executable file
·36 lines (24 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
import os, sys, re, json, datetime, optparse
import syslog
# boilerplate
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
virtualenv_activation = os.path.join(basedir, "env", "bin", "activate_this.py")
if os.path.exists(virtualenv_activation):
execfile(virtualenv_activation, dict(__file__=virtualenv_activation))
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_USER)
import django
django.setup()
from ietf.sync.iana import *
from ietf.doc.models import Document
msg = sys.stdin.read()
doc_name, review_time, by, comment = parse_review_email(msg)
syslog.syslog(u"Read IANA review email for %s at %s by %s" % (doc_name, review_time, by))
if by.name == "(System)":
syslog.syslog("WARNING: person responsible for email does not have a IANA role")
try:
add_review_comment(doc_name, review_time, by, comment)
except Document.DoesNotExist:
syslog.syslog("ERROR: unknown document %s" % doc_name)