lint: Clean up E126 PEP-8 rule.
This commit is contained in:
parent
31efc903bd
commit
722fc56534
|
@ -252,16 +252,16 @@ logger.info("Sent Zephyr messages!")
|
|||
for key, (stream, test) in hzkeys.items():
|
||||
if stream == "message":
|
||||
send_zulip({
|
||||
"type": "private",
|
||||
"content": str(key),
|
||||
"to": zulip_user,
|
||||
"type": "private",
|
||||
"content": str(key),
|
||||
"to": zulip_user,
|
||||
})
|
||||
else:
|
||||
send_zulip({
|
||||
"type": "stream",
|
||||
"subject": "test",
|
||||
"content": str(key),
|
||||
"to": stream,
|
||||
"type": "stream",
|
||||
"subject": "test",
|
||||
"content": str(key),
|
||||
"to": stream,
|
||||
})
|
||||
receive_zephyrs()
|
||||
|
||||
|
|
|
@ -65,10 +65,10 @@ class IRCBot(irc.bot.SingleServerIRCBot):
|
|||
|
||||
# Forward the PM to Zulip
|
||||
print(zulip_client.send_message({
|
||||
"sender": sender,
|
||||
"type": "private",
|
||||
"to": "username@example.com",
|
||||
"content": content,
|
||||
"sender": sender,
|
||||
"type": "private",
|
||||
"to": "username@example.com",
|
||||
"content": content,
|
||||
}))
|
||||
|
||||
def on_pubmsg(self, c, e):
|
||||
|
@ -81,12 +81,12 @@ class IRCBot(irc.bot.SingleServerIRCBot):
|
|||
|
||||
# Forward the stream message to Zulip
|
||||
print(zulip_client.send_message({
|
||||
"forged": "yes",
|
||||
"sender": sender,
|
||||
"type": "stream",
|
||||
"to": stream,
|
||||
"subject": "IRC",
|
||||
"content": content,
|
||||
"forged": "yes",
|
||||
"sender": sender,
|
||||
"type": "stream",
|
||||
"to": stream,
|
||||
"subject": "IRC",
|
||||
"content": content,
|
||||
}))
|
||||
|
||||
def on_dccmsg(self, c, e):
|
||||
|
|
|
@ -332,7 +332,7 @@ zulip configuration file under the jabber_mirror section (exceptions are noted
|
|||
in their help sections). Keys have the same name as options with hyphens
|
||||
replaced with underscores. Zulip configuration options go in the api section,
|
||||
as normal.'''.replace("\n", " ")
|
||||
)
|
||||
)
|
||||
parser.add_option(
|
||||
'--mode',
|
||||
default=None,
|
||||
|
|
|
@ -22,22 +22,22 @@ def test():
|
|||
''' % (cmd, expected_response, client_dummy.output))
|
||||
def sample_conversation():
|
||||
return [
|
||||
('@convert 2 m cm', '2.0 m = 200.0 cm\n'),
|
||||
('@converter 2 m cm', ''),
|
||||
('@convert 12 celsius fahrenheit',
|
||||
'12.0 celsius = 53.600054 fahrenheit\n'),
|
||||
('@convert 0.002 kilometer millimile',
|
||||
'0.002 kilometer = 1.2427424 millimile\n'),
|
||||
('@convert 3 megabyte kilobit',
|
||||
'3.0 megabyte = 24576.0 kilobit\n'),
|
||||
(('foo @convert 120.5 g lb bar baz.\n'
|
||||
'baz bar bar @convert 22 k c lorem ipsum dolor'),
|
||||
('1. conversion: 120.5 g = 0.26565703 lb\n'
|
||||
'2. conversion: 22.0 k = -251.15 c\n')),
|
||||
('@convert foo bar',
|
||||
('Too few arguments given. Enter `@convert help` '
|
||||
'for help on using the converter.\n')),
|
||||
]
|
||||
('@convert 2 m cm', '2.0 m = 200.0 cm\n'),
|
||||
('@converter 2 m cm', ''),
|
||||
('@convert 12 celsius fahrenheit',
|
||||
'12.0 celsius = 53.600054 fahrenheit\n'),
|
||||
('@convert 0.002 kilometer millimile',
|
||||
'0.002 kilometer = 1.2427424 millimile\n'),
|
||||
('@convert 3 megabyte kilobit',
|
||||
'3.0 megabyte = 24576.0 kilobit\n'),
|
||||
(('foo @convert 120.5 g lb bar baz.\n'
|
||||
'baz bar bar @convert 22 k c lorem ipsum dolor'),
|
||||
('1. conversion: 120.5 g = 0.26565703 lb\n'
|
||||
'2. conversion: 22.0 k = -251.15 c\n')),
|
||||
('@convert foo bar',
|
||||
('Too few arguments given. Enter `@convert help` '
|
||||
'for help on using the converter.\n')),
|
||||
]
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
|
|
@ -85,12 +85,12 @@ class IssueHandler(object):
|
|||
|
||||
# Creates the issue json, that is transmitted to the github api servers
|
||||
issue = {
|
||||
'title': new_issue_title,
|
||||
'body': '{} **Sent by [{}](https://chat.zulip.org/#) from zulip**'.format(issue_content, original_sender),
|
||||
'assignee': '',
|
||||
'milestone': 'none',
|
||||
'labels': [''],
|
||||
}
|
||||
'title': new_issue_title,
|
||||
'body': '{} **Sent by [{}](https://chat.zulip.org/#) from zulip**'.format(issue_content, original_sender),
|
||||
'assignee': '',
|
||||
'milestone': 'none',
|
||||
'labels': [''],
|
||||
}
|
||||
# Sends the HTTP post request
|
||||
r = session.post(url_new, json.dumps(issue))
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ parser.add_option('--new-short-name')
|
|||
client = zulip.init_from_options(options)
|
||||
|
||||
print(client.create_user({
|
||||
'email': options.new_email,
|
||||
'password': options.new_password,
|
||||
'full_name': options.new_full_name,
|
||||
'short_name': options.new_short_name
|
||||
'email': options.new_email,
|
||||
'password': options.new_password,
|
||||
'full_name': options.new_full_name,
|
||||
'short_name': options.new_short_name
|
||||
}))
|
||||
|
|
|
@ -76,10 +76,10 @@ def trac_subject(ticket):
|
|||
def send_update(ticket, content):
|
||||
# type: (Any, str) -> None
|
||||
client.send_message({
|
||||
"type": "stream",
|
||||
"to": config.STREAM_FOR_NOTIFICATIONS,
|
||||
"content": content,
|
||||
"subject": trac_subject(ticket)
|
||||
"type": "stream",
|
||||
"to": config.STREAM_FOR_NOTIFICATIONS,
|
||||
"content": content,
|
||||
"subject": trac_subject(ticket)
|
||||
})
|
||||
|
||||
class ZulipPlugin(Component):
|
||||
|
|
|
@ -285,9 +285,9 @@ class Client(object):
|
|||
vendor_version = platform.mac_ver()[0]
|
||||
|
||||
return "{client_name} ({vendor}; {vendor_version})".format(
|
||||
client_name=self.client_name,
|
||||
vendor=vendor,
|
||||
vendor_version=vendor_version,
|
||||
client_name=self.client_name,
|
||||
vendor=vendor,
|
||||
vendor_version=vendor_version,
|
||||
)
|
||||
|
||||
def do_api_query(self, orig_request, url, method="POST", longpolling=False, files=None):
|
||||
|
@ -357,15 +357,15 @@ class Client(object):
|
|||
client_cert = self.client_cert
|
||||
|
||||
res = requests.request(
|
||||
method,
|
||||
urllib.parse.urljoin(self.base_url, url),
|
||||
auth=requests.auth.HTTPBasicAuth(self.email,
|
||||
self.api_key),
|
||||
verify=self.tls_verification,
|
||||
cert=client_cert,
|
||||
timeout=90,
|
||||
headers={"User-agent": self.get_user_agent()},
|
||||
**kwargs)
|
||||
method,
|
||||
urllib.parse.urljoin(self.base_url, url),
|
||||
auth=requests.auth.HTTPBasicAuth(self.email,
|
||||
self.api_key),
|
||||
verify=self.tls_verification,
|
||||
cert=client_cert,
|
||||
timeout=90,
|
||||
headers={"User-agent": self.get_user_agent()},
|
||||
**kwargs)
|
||||
|
||||
# On 50x errors, try again after a short sleep
|
||||
if str(res.status_code).startswith('5'):
|
||||
|
|
Loading…
Reference in a new issue