]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Renamed _normalise to _munge to avoid overlap with the other meaning of "normalise...
authorMenno Smits <menno@freshfoo.com>
Mon, 29 Jun 2015 23:04:14 +0000 (11:04 +1200)
committerMenno Smits <menno@freshfoo.com>
Mon, 29 Jun 2015 23:04:14 +0000 (11:04 +1200)
imapclient/datetime_util.py

index bb807b44d874441d533d0bc679552bf72ef7190a..231979ebc2faf04652701ac936f15da7b2ece01e 100644 (file)
@@ -20,7 +20,7 @@ def parse_to_datetime(timestamp, normalise=True):
     If normalise is False, then the returned datetime will be
     unadjusted but will contain timezone information as per the input.
     """
-    time_tuple = parsedate_tz(_normalise(timestamp))
+    time_tuple = parsedate_tz(_munge(timestamp))
     if time_tuple == None:
         raise ValueError("couldn't parse datetime %r" % timestamp)
 
@@ -43,7 +43,7 @@ def datetime_to_native(dt):
 # issue #154). For example: 'Sat, 8 May 2010 16.03.09 +0200'
 _rfc822_dotted_time = re.compile("\w+, ?\d{1,2} \w+ \d\d(\d\d)? \d\d?\.\d\d?\.\d\d?.*")
 
-def _normalise(s):
+def _munge(s):
     s = s.decode('latin-1')  # parsedate_tz only works with strings
     if _rfc822_dotted_time.match(s):
         return s.replace(".", ":")