From 9bea1f46c7a557817bffbd42347890ec85d97494 Mon Sep 17 00:00:00 2001 From: Taranjeet Singh Date: Sun, 24 Jul 2016 00:40:58 +0530 Subject: [PATCH] zerver/views/webhooks/bitbucket2.py: Fix line with length greater than 120. --- zerver/views/webhooks/bitbucket2.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/zerver/views/webhooks/bitbucket2.py b/zerver/views/webhooks/bitbucket2.py index 80e3e81d18..b4446b0577 100644 --- a/zerver/views/webhooks/bitbucket2.py +++ b/zerver/views/webhooks/bitbucket2.py @@ -12,14 +12,15 @@ from zerver.models import Client, UserProfile BITBUCKET_SUBJECT_TEMPLATE = '{repository_name}' +USER_PART = 'User {display_name}(login: {username})' -BITBUCKET_PUSH_BODY = 'User {display_name}(login: {username}) pushed [{number_of_commits} commit{s}]({commits_url}) into {branch} branch.' -BITBUCKET_FORK_BODY = 'User {display_name}(login: {username}) forked the repository into [{fork_name}]({fork_url}).' -BITBUCKET_COMMIT_COMMENT_BODY = 'User {display_name}(login: {username}) added [comment]({url_to_comment}) to commit.' +BITBUCKET_PUSH_BODY = USER_PART + ' pushed [{number_of_commits} commit{s}]({commits_url}) into {branch} branch.' +BITBUCKET_FORK_BODY = USER_PART + ' forked the repository into [{fork_name}]({fork_url}).' +BITBUCKET_COMMIT_COMMENT_BODY = USER_PART + ' added [comment]({url_to_comment}) to commit.' BITBUCKET_COMMIT_STATUS_CHANGED_BODY = '[System {key}]({system_url}) changed status of {commit_info} to {status}.' -BITBUCKET_ISSUE_ACTION_BODY = 'User {display_name}(login: {username}) {action} [an issue]({issue_url})' -BITBUCKET_PULL_REQUEST_ACTION_BODY = 'User {display_name}(login: {username}) {action} ["{title}" pull request]({pull_request_url})' -BITBUCKET_PULL_REQUEST_COMMENT_ACTION_BODY = 'User {display_name}(login: {username}) {action} [comment]({comment_url} in ["{title}" pull request]({pull_request_url})' +BITBUCKET_ISSUE_ACTION_BODY = USER_PART + ' {action} [an issue]({issue_url})' +BITBUCKET_PULL_REQUEST_ACTION_BODY = USER_PART + ' {action} ["{title}" pull request]({pull_request_url})' +BITBUCKET_PULL_REQUEST_COMMENT_ACTION_BODY = USER_PART + ' {action} [comment]({comment_url} in ["{title}" pull request]({pull_request_url})' PULL_REQUEST_SUPPORTED_ACTIONS = [ 'approved', @@ -39,7 +40,8 @@ class UnknownTriggerType(Exception): @api_key_only_webhook_view('Bitbucket2') @has_request_variables -def api_bitbucket2_webhook(request, user_profile, client, payload=REQ(argument_type='body'), stream=REQ(default='bitbucket')): +def api_bitbucket2_webhook(request, user_profile, client, payload=REQ(argument_type='body'), + stream=REQ(default='bitbucket')): # type: (HttpRequest, UserProfile, Client, Dict[str, Any], str) -> HttpResponse try: subject = get_subject(payload)