From 6034ae7b9af95527003d5ee56d33fdb10ce14b3a Mon Sep 17 00:00:00 2001 From: Taranjeet Date: Sat, 2 Jul 2016 23:23:19 +0530 Subject: [PATCH] Wrap some lines with length greater than 120. With some tweaks by tabbott. --- bots/jabber_mirror_backend.py | 3 ++- integrations/codebase/zulip_codebase_mirror | 6 ++++-- integrations/twitter/twitter-bot | 15 +++++++++------ zulip/__init__.py | 3 ++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/bots/jabber_mirror_backend.py b/bots/jabber_mirror_backend.py index 2a1bc05..0ad3ed2 100755 --- a/bots/jabber_mirror_backend.py +++ b/bots/jabber_mirror_backend.py @@ -381,7 +381,8 @@ option does not affect login credentials.'''.replace("\n", " ")) config.readfp(f, config_file) except IOError: pass - for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix", "jabber_server_address", "jabber_server_port"): + for option in ("jid", "jabber_password", "conference_domain", "mode", "zulip_email_suffix", + "jabber_server_address", "jabber_server_port"): if (getattr(options, option) is None and config.has_option("jabber_mirror", option)): setattr(options, option, config.get("jabber_mirror", option)) diff --git a/integrations/codebase/zulip_codebase_mirror b/integrations/codebase/zulip_codebase_mirror index cf32137..b344566 100755 --- a/integrations/codebase/zulip_codebase_mirror +++ b/integrations/codebase/zulip_codebase_mirror @@ -208,7 +208,8 @@ def handle_event(event): subject = "Discussion: %s" % (subj,) if category: - content = "%s started a new discussion in %s:\n\n~~~ quote\n%s\n~~~" % (actor_name, category, comment_content) + format_str = "%s started a new discussion in %s:\n\n~~~ quote\n%s\n~~~" + content = format_str % (actor_name, category, comment_content) else: content = "%s posted:\n\n~~~ quote\n%s\n~~~" % (actor_name, comment_content) @@ -223,7 +224,8 @@ def handle_event(event): start_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, start_ref)) end_ref_url = make_url("projects/%s/repositories/%s/commit/%s" % (project_link, repo_link, end_ref)) - between_url = make_url("projects/%s/repositories/%s/compare/%s...%s" % (project_link, repo_link, start_ref, end_ref)) + between_url = make_url("projects/%s/repositories/%s/compare/%s...%s" % ( + project_link, repo_link, start_ref, end_ref)) subject = "Deployment to %s" % (environment,) diff --git a/integrations/twitter/twitter-bot b/integrations/twitter/twitter-bot index aaecbeb..3adc0eb 100755 --- a/integrations/twitter/twitter-bot +++ b/integrations/twitter/twitter-bot @@ -45,11 +45,12 @@ parser = optparse.OptionParser(r""" Slurp tweets on your timeline into a specific zulip stream. - Run this on your personal machine. Your API key and twitter id are revealed to local - users through the command line or config file. + Run this on your personal machine. Your API key and twitter id + are revealed to local users through the command line or config + file. - This bot uses OAuth to authenticate with twitter. Please create a ~/.zulip_twitterrc with - the following contents: + This bot uses OAuth to authenticate with twitter. Please create a + ~/.zulip_twitterrc with the following contents: [twitter] consumer_key = @@ -57,14 +58,16 @@ parser = optparse.OptionParser(r""" access_token_key = access_token_secret = - In order to obtain a consumer key & secret, you must register a new application under your twitter account: + In order to obtain a consumer key & secret, you must register a + new application under your twitter account: 1. Go to http://dev.twitter.com 2. Log in 3. In the menu under your username, click My Applications 4. Create a new application - Make sure to go the application you created and click "create my access token" as well. Fill in the values displayed. + Make sure to go the application you created and click "create my + access token" as well. Fill in the values displayed. Depends on: twitter-python """) diff --git a/zulip/__init__.py b/zulip/__init__.py index 12dade9..cbff8c2 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -150,7 +150,8 @@ def get_default_config_filename(): config_file = os.path.join(os.environ["HOME"], ".zuliprc") if (not os.path.exists(config_file) and os.path.exists(os.path.join(os.environ["HOME"], ".humbugrc"))): - raise RuntimeError("The Zulip API configuration file is now ~/.zuliprc; please run:\n\n mv ~/.humbugrc ~/.zuliprc\n") + raise RuntimeError("The Zulip API configuration file is now ~/.zuliprc; please run:\n\n" + " mv ~/.humbugrc ~/.zuliprc\n") return config_file class Client(object):