Skip to content

Commit 9d5a9c1

Browse files
committed
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 a8ddac1
1 parent a8ddac1 commit 9d5a9c1

1 file changed

Lines changed: 5 additions & 19 deletions

File tree

ietf/utils/draft.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import sys
4141
import time
4242

43-
version = "0.33"
43+
version = "0.31"
4444
program = os.path.basename(sys.argv[0])
4545
progdir = os.path.dirname(sys.argv[0])
4646

@@ -75,10 +75,7 @@
7575
}
7676
longform = dict([ (short+" ", longform[short]+" ") for short in longform ])
7777

78-
79-
month_names = [ 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december' ]
80-
month_names_abbrev3 = [ n[:3] for n in month_names ]
81-
month_names_abbrev4 = [ n[:4] for n in month_names ]
78+
month_names = [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' ]
8279

8380
# ----------------------------------------------------------------------
8481
# Functions
@@ -314,8 +311,6 @@ def get_creation_date(self):
314311
r'\s{3,}(?P<month>\w+)\s+(?P<day>\d{1,2})(,|\s)+(?P<year>\d{4})',
315312
r'\s{3,}(?P<day>\d{1,2})(,|\s)+(?P<month>\w+)\s+(?P<year>\d{4})',
316313
r'\s{3,}(?P<day>\d{1,2})-(?P<month>\w+)-(?P<year>\d{4})',
317-
# RFC 3339 date (also ISO date)
318-
r'\s{3,}(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})',
319314
# 'October 2008' - default day to today's.
320315
r'\s{3,}(?P<month>\w+)\s+(?P<year>\d{4})',
321316
]
@@ -331,20 +326,11 @@ def get_creation_date(self):
331326
dates.sort()
332327
for start, match in dates:
333328
md = match.groupdict()
334-
mon = md['month'].lower()
329+
mon = md['month'][0:3].lower()
335330
day = int( md.get( 'day', 0 ) )
336331
year = int( md['year'] )
337332
try:
338-
if mon in month_names:
339-
month = month_names.index( mon ) + 1
340-
elif mon in month_names_abbrev3:
341-
month = month_names_abbrev3.index( mon ) + 1
342-
elif mon in month_names_abbrev4:
343-
month = month_names_abbrev4.index( mon ) + 1
344-
elif mon.isdigit() and int(mon) in range(1,13):
345-
month = mon
346-
else:
347-
continue
333+
month = month_names.index( mon ) + 1
348334
today = datetime.date.today()
349335
if day==0:
350336
# if the date was given with only month and year, use
@@ -1093,7 +1079,7 @@ def getmeta(fn):
10931079
fields["docaffiliations"] = ", ".join(draft.get_authors_with_firm())
10941080
if opt_debug:
10951081
fields["docheader"] = draft._docheader
1096-
normrefs, rfcrefs, draftrefs, refs = draft.old_get_refs()
1082+
normrefs, rfcrefs, draftrefs, refs = draft.get_refs()
10971083
fields["docrfcrefs"] = ", ".join(rfcrefs)
10981084
fields["docdraftrefs"] = ", ".join(draftrefs)
10991085
fields["doccreationdate"] = str(draft.get_creation_date())

0 commit comments

Comments
 (0)