udpated variable name and spacing

This commit is contained in:
lmckiwo 2014-12-06 08:42:54 -05:00
parent 319345b5d4
commit 62ab6d36ff

View file

@ -114,14 +114,14 @@ class Journal(object):
"""Parses a journal that's stored in a string and returns a list of entries""" """Parses a journal that's stored in a string and returns a list of entries"""
def get_date_length(myline): def get_date_length(myline):
j='' tmpdate=''
for i in [x for x in myline.split(' ') ]: for i in [x for x in myline.split(' ') ]:
try: try:
dateutil.parser.parse(j+' ' +i) dateutil.parser.parse(tmpdate + ' ' + i)
j=j+' ' +i tmpdate = tmpdate + ' ' + i
except: except:
break break
return len(j.strip()) return len(tmpdate.strip())
# Entries start with a line that looks like 'date title' - let's figure out how # Entries start with a line that looks like 'date title' - let's figure out how
# long the date will be by constructing one # long the date will be by constructing one