Apply Python 3 futurize transform lib2to3.fixes.fix_ws_comma

This commit is contained in:
Eklavya Sharma 2016-03-10 21:03:07 +05:30 committed by Tim Abbott
parent 26eeb9549e
commit d998bc400a
3 changed files with 4 additions and 4 deletions

View file

@ -189,7 +189,7 @@ def since():
timestamp = float(datestring)
max_timestamp_processed = datetime.fromtimestamp(timestamp)
logging.info("Reading from resume file: " + datestring)
except (ValueError,IOError) as e:
except (ValueError, IOError) as e:
logging.warn("Could not open resume file: %s" % (
e.message or e.strerror,))
max_timestamp_processed = default_since()

View file

@ -92,7 +92,7 @@ def build_message(event):
action = htmlParser.unescape(re.sub(r"<[^<>]+>", "", event.get('action', '')))
target = htmlParser.unescape(event.get('target', ''))
# Some events have "excerpts", which we blockquote
excerpt = htmlParser.unescape(event.get('excerpt',''))
excerpt = htmlParser.unescape(event.get('excerpt', ''))
if excerpt.strip() == "":
message = '**%s** %s [%s](%s).' % (event['creator']['name'], action, target, event['html_url'])
else:
@ -116,7 +116,7 @@ def run_mirror():
since = re.search(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-\d{2}:\d{2}", since)
assert since, "resume file does not meet expected format"
since = since.string
except (AssertionError,IOError) as e:
except (AssertionError, IOError) as e:
logging.warn("Could not open resume file: %s" % (e.message or e.strerror,))
since = (datetime.utcnow() - timedelta(hours=config.BASECAMP_INITIAL_HISTORY_HOURS)).isoformat() + "-00:00"
try:

View file

@ -271,7 +271,7 @@ def run_mirror():
else:
timestamp = int(timestamp, 10)
since = datetime.fromtimestamp(timestamp)
except (ValueError,IOError) as e:
except (ValueError, IOError) as e:
logging.warn("Could not open resume file: %s" % (e.message or e.strerror,))
since = default_since()