From 9d5a9c143edb49b6270cf9e2dadd9312cce169a3 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 27 Oct 2014 16:35:50 +0000 Subject: [PATCH] Reverted changes in ietf/utils/draft.py which should not have been part of [8499]. - Legacy-Id: 8500 Note: SVN reference [8499] has been migrated to Git commit a8ddac15e2d00762da59c7fef1fab4929d805669 --- ietf/utils/draft.py | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ietf/utils/draft.py b/ietf/utils/draft.py index 250cbbdb7..6701b7b51 100755 --- a/ietf/utils/draft.py +++ b/ietf/utils/draft.py @@ -40,7 +40,7 @@ import stat import sys import time -version = "0.33" +version = "0.31" program = os.path.basename(sys.argv[0]) progdir = os.path.dirname(sys.argv[0]) @@ -75,10 +75,7 @@ longform = { } longform = dict([ (short+" ", longform[short]+" ") for short in longform ]) - -month_names = [ 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december' ] -month_names_abbrev3 = [ n[:3] for n in month_names ] -month_names_abbrev4 = [ n[:4] for n in month_names ] +month_names = [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' ] # ---------------------------------------------------------------------- # Functions @@ -314,8 +311,6 @@ class Draft(): r'\s{3,}(?P\w+)\s+(?P\d{1,2})(,|\s)+(?P\d{4})', r'\s{3,}(?P\d{1,2})(,|\s)+(?P\w+)\s+(?P\d{4})', r'\s{3,}(?P\d{1,2})-(?P\w+)-(?P\d{4})', - # RFC 3339 date (also ISO date) - r'\s{3,}(?P\d{4})-(?P\d{2})-(?P\d{2})', # 'October 2008' - default day to today's. r'\s{3,}(?P\w+)\s+(?P\d{4})', ] @@ -331,20 +326,11 @@ class Draft(): dates.sort() for start, match in dates: md = match.groupdict() - mon = md['month'].lower() + mon = md['month'][0:3].lower() day = int( md.get( 'day', 0 ) ) year = int( md['year'] ) try: - if mon in month_names: - month = month_names.index( mon ) + 1 - elif mon in month_names_abbrev3: - month = month_names_abbrev3.index( mon ) + 1 - elif mon in month_names_abbrev4: - month = month_names_abbrev4.index( mon ) + 1 - elif mon.isdigit() and int(mon) in range(1,13): - month = mon - else: - continue + month = month_names.index( mon ) + 1 today = datetime.date.today() if day==0: # if the date was given with only month and year, use @@ -1093,7 +1079,7 @@ def getmeta(fn): fields["docaffiliations"] = ", ".join(draft.get_authors_with_firm()) if opt_debug: fields["docheader"] = draft._docheader - normrefs, rfcrefs, draftrefs, refs = draft.old_get_refs() + normrefs, rfcrefs, draftrefs, refs = draft.get_refs() fields["docrfcrefs"] = ", ".join(rfcrefs) fields["docdraftrefs"] = ", ".join(draftrefs) fields["doccreationdate"] = str(draft.get_creation_date())