From f5708bdd46546520245c60a9d11bcbd18df2cba6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 29 2016 09:25:52 +0000 Subject: Final style fixes to pagure.lib --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index e8d7ddd..2bd4ca6 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -16,6 +16,8 @@ # pylint: disable=R0914 # too-many-statements # pylint: disable=R0915 +# too-many-lines +# pylint: disable=C0302 try: diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index 890f6cd..6c789ce 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - (c) 2014-2015 - Copyright Red Hat Inc + (c) 2014-2016 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon @@ -9,6 +9,12 @@ pagure notifications. """ +# too-many-branches +# pylint: disable=R0912 +# too-many-arguments +# pylint: disable=R0913 + + import datetime import hashlib import json @@ -19,8 +25,6 @@ import time import warnings import flask -import requests -import six import pagure from email.mime.text import MIMEText @@ -66,8 +70,8 @@ def _add_mentioned_users(emails, comment): ''' Check the comment to see if an user is mentioned in it and if so add this user to the list of people to notify. ''' - MENTION_RE = r'@(\w+)' - for username in re.findall(MENTION_RE, comment): + mentio_re = r'@(\w+)' + for username in re.findall(mentio_re, comment): user = pagure.lib.search_user(pagure.SESSION, username=username) if user: emails.add(user.default_email) diff --git a/pagure/lib/repo.py b/pagure/lib/repo.py index 1b77330..ef3c11b 100644 --- a/pagure/lib/repo.py +++ b/pagure/lib/repo.py @@ -76,7 +76,7 @@ class PagureRepo(pygit2.Repository): else: pagure.LOG.debug( 'Un-expected merge result: %s' % ( - pygit2.GIT_MERGE_ANALYSIS_NORMAL)) + pygit2.GIT_MERGE_ANALYSIS_NORMAL)) raise AssertionError('Unknown merge analysis result') def run_hook(self, old, new, ref, username):