datatracker/ietf/bin/rfc-editor-index-updates
Ole Laursen 09e6203f18 Revamp sync from RFC Editor to include more info, fix a couple of bugs
and email the Secretariet when a draft sent to the RFC Editor ends up
in the queue, split it up so it's easier to test; also moved the
location of the binaries to bin/
 - Legacy-Id: 4848
2012-09-17 15:45:27 +00:00

31 lines
752 B
Python
Executable file

#!/usr/bin/env python
import os, sys, re, json, datetime
import syslog
syslog.openlog(os.path.basename(__file__), syslog.LOG_PID, syslog.LOG_LOCAL0)
# boilerplate
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
sys.path = [ basedir ] + sys.path
from ietf import settings
from django.core import management
management.setup_environ(settings)
from ietf.sync.rfceditor import *
syslog.syslog("Updating document metadata from RFC index from %s" % QUEUE_URL)
response = fetch_index_xml(INDEX_URL)
data = parse_index(response)
if len(data) < MIN_INDEX_RESULTS:
syslog.syslog("Not enough results, only %s" % len(data))
sys.exit(1)
changed = update_docs_from_rfc_index(data)
for c in changed:
syslog.syslog(c)