Added some doc strings as suggested by pylint.

svn: r11934
This commit is contained in:
Peter Landgren 2009-02-09 10:47:03 +00:00
parent dff2d75e26
commit 0671acaf69
2 changed files with 9 additions and 4 deletions

View File

@ -60,6 +60,7 @@ _max_days = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]
_leap_days = [ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ]
def gregorian_valid(date_tuple):
""" Checks if date_tuple is a valid date in Gregorian Calendar """
day = date_tuple[0]
month = date_tuple[1]
valid = True
@ -76,6 +77,7 @@ def gregorian_valid(date_tuple):
return valid
def julian_valid(date_tuple):
""" Checks if date_tuple is a valid date in Julian Calendar """
day = date_tuple[0]
month = date_tuple[1]
valid = True
@ -93,6 +95,7 @@ def julian_valid(date_tuple):
return valid
def swedish_valid(date_tuple):
""" Checks if date_tuple is a valid date in Swedish Calendar """
valid = gregorian_valid(date_tuple)
# not sure how <= and >= works with tuples???
date_tuple = (date_tuple[2], date_tuple[1], date_tuple[0])
@ -107,6 +110,7 @@ def swedish_valid(date_tuple):
return valid
def french_valid(date_tuple):
""" Checks if date_tuple is a valid date in French Calendar """
valid = True
# year 1 starts on 22.9.1792
if date_tuple[2] < 1:

View File

@ -95,6 +95,7 @@ class DateParserSv(DateParser):
}
def init_strings(self):
""" Define, in Swedish, span and range regular expressions"""
DateParser.init_strings(self)
self._span = re.compile(u"(från)?\s*(?P<start>.+)\s*(till|--|)\s*(?P<stop>.+)",
re.IGNORECASE)