mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
pep8: Fix E128 violations.
With some line-wrapping tweaks by tabbott.
This commit is contained in:
@@ -322,28 +322,28 @@ def config_error(msg):
|
|||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = optparse.OptionParser(epilog=
|
parser = optparse.OptionParser(
|
||||||
'''Most general and Jabber configuration options may also be specified in the
|
epilog='''Most general and Jabber configuration options may also be specified in the
|
||||||
zulip configuration file under the jabber_mirror section (exceptions are noted
|
zulip configuration file under the jabber_mirror section (exceptions are noted
|
||||||
in their help sections). Keys have the same name as options with hyphens
|
in their help sections). Keys have the same name as options with hyphens
|
||||||
replaced with underscores. Zulip configuration options go in the api section,
|
replaced with underscores. Zulip configuration options go in the api section,
|
||||||
as normal.'''.replace("\n", " ")
|
as normal.'''.replace("\n", " ")
|
||||||
)
|
)
|
||||||
parser.add_option('--mode',
|
parser.add_option(
|
||||||
|
'--mode',
|
||||||
default=None,
|
default=None,
|
||||||
action='store',
|
action='store',
|
||||||
help=
|
help='''Which mode to run in. Valid options are "personal" and "public". In
|
||||||
'''Which mode to run in. Valid options are "personal" and "public". In
|
|
||||||
"personal" mode, the mirror uses an individual users' credentials and mirrors
|
"personal" mode, the mirror uses an individual users' credentials and mirrors
|
||||||
all messages they send on Zulip to Jabber and all private Jabber messages to
|
all messages they send on Zulip to Jabber and all private Jabber messages to
|
||||||
Zulip. In "public" mode, the mirror uses the credentials for a dedicated mirror
|
Zulip. In "public" mode, the mirror uses the credentials for a dedicated mirror
|
||||||
user and mirrors messages sent to Jabber rooms to Zulip. Defaults to
|
user and mirrors messages sent to Jabber rooms to Zulip. Defaults to
|
||||||
"personal"'''.replace("\n", " "))
|
"personal"'''.replace("\n", " "))
|
||||||
parser.add_option('--zulip-email-suffix',
|
parser.add_option(
|
||||||
|
'--zulip-email-suffix',
|
||||||
default=None,
|
default=None,
|
||||||
action='store',
|
action='store',
|
||||||
help=
|
help='''Add the specified suffix to the local part of email addresses constructed
|
||||||
'''Add the specified suffix to the local part of email addresses constructed
|
|
||||||
from JIDs and nicks before sending requests to the Zulip server, and remove the
|
from JIDs and nicks before sending requests to the Zulip server, and remove the
|
||||||
suffix before sending requests to the Jabber server. For example, specifying
|
suffix before sending requests to the Jabber server. For example, specifying
|
||||||
"+foo" will cause messages that are sent to the "bar" room by nickname "qux" to
|
"+foo" will cause messages that are sent to the "bar" room by nickname "qux" to
|
||||||
@@ -357,7 +357,8 @@ option does not affect login credentials.'''.replace("\n", " "))
|
|||||||
default=logging.INFO)
|
default=logging.INFO)
|
||||||
|
|
||||||
jabber_group = optparse.OptionGroup(parser, "Jabber configuration")
|
jabber_group = optparse.OptionGroup(parser, "Jabber configuration")
|
||||||
jabber_group.add_option('--jid',
|
jabber_group.add_option(
|
||||||
|
'--jid',
|
||||||
default=None,
|
default=None,
|
||||||
action='store',
|
action='store',
|
||||||
help="Your Jabber JID. If a resource is specified, "
|
help="Your Jabber JID. If a resource is specified, "
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ def check_pep8(files):
|
|||||||
# type: (List[str]) -> bool
|
# type: (List[str]) -> bool
|
||||||
failed = False
|
failed = False
|
||||||
ignored_rules = [
|
ignored_rules = [
|
||||||
'E402', 'E501', 'W503', 'E711', 'E128', 'E226',
|
'E402', 'E501', 'W503', 'E711', 'E226',
|
||||||
'E126', 'E121', 'E123', 'E266', 'E265', 'E261', 'E221',
|
'E126', 'E121', 'E123', 'E266', 'E265', 'E261', 'E221',
|
||||||
'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E731', 'E302',
|
'E241', 'E712', 'E702', 'E401', 'E115', 'E114', 'E731', 'E302',
|
||||||
'E741', 'E714', 'W391', 'E713', 'E305', 'E251', 'E306',
|
'E741', 'E714', 'W391', 'E713', 'E305', 'E251', 'E306',
|
||||||
@@ -460,8 +460,10 @@ def run():
|
|||||||
print('If you really know what you are doing, use --force to run anyway.')
|
print('If you really know what you are doing, use --force to run anyway.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
by_lang = cast(Dict[str, List[str]], lister.list_files(args, modified_only=options.modified,
|
by_lang = cast(Dict[str, List[str]],
|
||||||
ftypes=['py', 'sh', 'js', 'pp', 'css', 'handlebars', 'html', 'json', 'md', 'txt', 'text'],
|
lister.list_files(args, modified_only=options.modified,
|
||||||
|
ftypes=['py', 'sh', 'js', 'pp', 'css', 'handlebars',
|
||||||
|
'html', 'json', 'md', 'txt', 'text'],
|
||||||
use_shebang=True, group_by_ftype=True, exclude=EXCLUDED_FILES))
|
use_shebang=True, group_by_ftype=True, exclude=EXCLUDED_FILES))
|
||||||
|
|
||||||
# Invoke the appropriate lint checker for each language,
|
# Invoke the appropriate lint checker for each language,
|
||||||
|
|||||||
@@ -227,14 +227,19 @@ def send_signup_message(sender, signups_stream, user_profile,
|
|||||||
# Send notification to realm notifications stream if it exists
|
# Send notification to realm notifications stream if it exists
|
||||||
# Don't send notification for the first user in a realm
|
# Don't send notification for the first user in a realm
|
||||||
if user_profile.realm.notifications_stream is not None and user_count > 1:
|
if user_profile.realm.notifications_stream is not None and user_count > 1:
|
||||||
internal_send_message(sender, "stream",
|
internal_send_message(
|
||||||
|
sender,
|
||||||
|
"stream",
|
||||||
user_profile.realm.notifications_stream.name,
|
user_profile.realm.notifications_stream.name,
|
||||||
"New users", "%s just signed up for Zulip. Say hello!" %
|
"New users", "%s just signed up for Zulip. Say hello!" % (
|
||||||
(user_profile.full_name,),
|
user_profile.full_name,),
|
||||||
realm=user_profile.realm)
|
realm=user_profile.realm)
|
||||||
|
|
||||||
internal_send_message(sender,
|
internal_send_message(
|
||||||
"stream", signups_stream, user_profile.realm.domain,
|
sender,
|
||||||
|
"stream",
|
||||||
|
signups_stream,
|
||||||
|
user_profile.realm.domain,
|
||||||
"%s <`%s`> just signed up for Zulip!%s(total: **%i**)" % (
|
"%s <`%s`> just signed up for Zulip!%s(total: **%i**)" % (
|
||||||
user_profile.full_name,
|
user_profile.full_name,
|
||||||
user_profile.email,
|
user_profile.email,
|
||||||
@@ -303,8 +308,11 @@ def process_new_human_user(user_profile, prereg_user=None, newsletter_data=None)
|
|||||||
if not mit_beta_user and prereg_user is not None and prereg_user.referred_by is not None \
|
if not mit_beta_user and prereg_user is not None and prereg_user.referred_by is not None \
|
||||||
and settings.NOTIFICATION_BOT is not None:
|
and settings.NOTIFICATION_BOT is not None:
|
||||||
# This is a cross-realm private message.
|
# This is a cross-realm private message.
|
||||||
internal_send_message(settings.NOTIFICATION_BOT,
|
internal_send_message(
|
||||||
"private", prereg_user.referred_by.email, user_profile.realm.domain,
|
settings.NOTIFICATION_BOT,
|
||||||
|
"private",
|
||||||
|
prereg_user.referred_by.email,
|
||||||
|
user_profile.realm.domain,
|
||||||
"%s <`%s`> accepted your invitation to join Zulip!" % (
|
"%s <`%s`> accepted your invitation to join Zulip!" % (
|
||||||
user_profile.full_name,
|
user_profile.full_name,
|
||||||
user_profile.email,
|
user_profile.email,
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ def api_pivotal_webhook_v3(request, user_profile, stream):
|
|||||||
if estimate != '':
|
if estimate != '':
|
||||||
estimate = " worth %s story points" % (estimate,)
|
estimate = " worth %s story points" % (estimate,)
|
||||||
subject = name
|
subject = name
|
||||||
content = "%s (%s %s%s):\n\n~~~ quote\n%s\n~~~\n\n%s" % (description,
|
content = "%s (%s %s%s):\n\n~~~ quote\n%s\n~~~\n\n%s" % (
|
||||||
|
description,
|
||||||
issue_status,
|
issue_status,
|
||||||
issue_type,
|
issue_type,
|
||||||
estimate,
|
estimate,
|
||||||
|
|||||||
Reference in New Issue
Block a user