mirror of https://github.com/zulip/zulip.git
Apply Python 3 futurize transform lib2to3.fixes.fix_ws_comma
This commit is contained in:
parent
4fb549abe8
commit
e2d5ec1868
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ elems = [tree.getroot().findall(
|
|||
".//*[@id='%s']/{http://www.w3.org/2000/svg}tspan" % (name,))[0]
|
||||
for name in ('number_back', 'number_front')]
|
||||
|
||||
for i in xrange(1,100):
|
||||
for i in xrange(1, 100):
|
||||
# Prepare a modified SVG
|
||||
s = '%2d' % (i,)
|
||||
for e in elems:
|
||||
|
|
|
@ -25,7 +25,7 @@ def get_loc_over_ssh(host, func):
|
|||
'psql -t -c "SELECT %s()"' % (func,)],
|
||||
stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as e:
|
||||
report('CRITICAL', 'ssh failed: %s: %s' % (str(e),e.output))
|
||||
report('CRITICAL', 'ssh failed: %s: %s' % (str(e), e.output))
|
||||
|
||||
def loc_to_abs_offset(loc_str):
|
||||
m = re.match(r'^\s*([0-9a-fA-F]+)/([0-9a-fA-F]+)\s*$', loc_str)
|
||||
|
|
|
@ -56,7 +56,7 @@ f = codecs.open("output-candidate.html", encoding='utf-8', mode="wb")
|
|||
def uniwrite(f, s):
|
||||
f.write(s)
|
||||
|
||||
uniwrite(f,"""
|
||||
uniwrite(f, """
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
@ -148,19 +148,19 @@ for msg in result['messages']:
|
|||
# Don't put tweets in the iframe
|
||||
continue
|
||||
|
||||
uniwrite(f,'<div class="message">')
|
||||
uniwrite(f, '<div class="message">')
|
||||
|
||||
uniwrite(f,'<img class="avatar" src="%s" />' % msg['avatar_url'])
|
||||
uniwrite(f, '<img class="avatar" src="%s" />' % msg['avatar_url'])
|
||||
|
||||
uniwrite(f,'<div class="sender-bar">')
|
||||
uniwrite(f,'<div class="recipient" style="background-color: %s;">%s > %s</div>' % (color[msg['display_recipient']], msg['display_recipient'], msg['subject']))
|
||||
uniwrite(f,'<span class="sender">%s</span>' % msg['sender_full_name'])
|
||||
uniwrite(f,'</div>')
|
||||
uniwrite(f, '<div class="sender-bar">')
|
||||
uniwrite(f, '<div class="recipient" style="background-color: %s;">%s > %s</div>' % (color[msg['display_recipient']], msg['display_recipient'], msg['subject']))
|
||||
uniwrite(f, '<span class="sender">%s</span>' % msg['sender_full_name'])
|
||||
uniwrite(f, '</div>')
|
||||
|
||||
uniwrite(f,'<div class="content">%s</div>' % msg['content'])
|
||||
uniwrite(f,"</div>")
|
||||
uniwrite(f, '<div class="content">%s</div>' % msg['content'])
|
||||
uniwrite(f, "</div>")
|
||||
|
||||
uniwrite(f,"""
|
||||
uniwrite(f, """
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -270,7 +270,7 @@ def edit(repo, opts, revs, headers):
|
|||
|
||||
# Open EDITOR to edit buffer.
|
||||
|
||||
editor = os.getenv('EDITOR','emacs')
|
||||
editor = os.getenv('EDITOR', 'emacs')
|
||||
subprocess.check_call(shlex.split(editor) + [temp.name])
|
||||
|
||||
# Check if buffer is empty, and if so abort.
|
||||
|
|
Loading…
Reference in New Issue