summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.buildout/bin/lint.sh.in2
-rw-r--r--pylint.rc2
-rw-r--r--src/mailman/app/moderator.py3
-rw-r--r--src/mailman/app/notifications.py2
-rw-r--r--src/mailman/bin/master.py19
-rw-r--r--src/mailman/docs/README.txt2
6 files changed, 17 insertions, 13 deletions
diff --git a/.buildout/bin/lint.sh.in b/.buildout/bin/lint.sh.in
index 4bb912bbc..cdcfcf1d2 100755
--- a/.buildout/bin/lint.sh.in
+++ b/.buildout/bin/lint.sh.in
@@ -1,4 +1,4 @@
#! /bin/bash
export PYTHONPATH=${os-paths}
-bin/pylint ${package} --rcfile=pylint.rc
+bin/pylint --rcfile=pylint.rc ${package}
diff --git a/pylint.rc b/pylint.rc
index 6e1ecfd9c..13031a15e 100644
--- a/pylint.rc
+++ b/pylint.rc
@@ -60,7 +60,7 @@ load-plugins=
# R0914: *Too many local variables*
# W0142: *Used * or ** magic*
# W0704: *Except doesn't do anything*
-disable-msg=C0103,I0011,R0903,R0914,W0142,W0704
+disable-msg=C0103,I0011,R0903,R0913,R0914,W0142,W0704
[REPORTS]
diff --git a/src/mailman/app/moderator.py b/src/mailman/app/moderator.py
index 1a86ce7cc..f562b3237 100644
--- a/src/mailman/app/moderator.py
+++ b/src/mailman/app/moderator.py
@@ -41,13 +41,14 @@ from mailman.app.notifications import (
send_admin_subscription_notice, send_welcome_message)
from mailman.config import config
from mailman.core import errors
-from mailman.email.message import Message, UserNotification
+from mailman.email.message import UserNotification
from mailman.interfaces.action import Action
from mailman.interfaces.member import AlreadySubscribedError, DeliveryMode
from mailman.interfaces.requests import RequestType
_ = i18n._
+NL = '\n'
vlog = logging.getLogger('mailman.vette')
slog = logging.getLogger('mailman.subscribe')
diff --git a/src/mailman/app/notifications.py b/src/mailman/app/notifications.py
index fcbfe95be..ac57a2154 100644
--- a/src/mailman/app/notifications.py
+++ b/src/mailman/app/notifications.py
@@ -33,7 +33,7 @@ from lazr.config import as_boolean
from mailman import Utils
from mailman import i18n
from mailman.config import config
-from mailman.email.message import Message, OwnerNotification, UserNotification
+from mailman.email.message import OwnerNotification, UserNotification
from mailman.interfaces.member import DeliveryMode
diff --git a/src/mailman/bin/master.py b/src/mailman/bin/master.py
index 076b3acfb..6f1015d1b 100644
--- a/src/mailman/bin/master.py
+++ b/src/mailman/bin/master.py
@@ -40,7 +40,6 @@ from mailman.config import config
from mailman.core.logging import reopen
from mailman.i18n import _
from mailman.options import Options
-from mailman.utilities.modules import find_name
DOT = '.'
@@ -76,6 +75,7 @@ to use this pid directly.
Usage: %prog [options]""")
def add_options(self):
+ """See `Options`."""
self.parser.add_option(
'-n', '--no-restart',
dest='restartable', default=True, action='store_false',
@@ -101,6 +101,7 @@ instead of the default set. Multiple -r options may be given. The values for
-r are passed straight through to bin/qrunner."""))
def sanity_check(self):
+ """See `Options`."""
if len(self.arguments) > 0:
self.parser.error(_('Too many arguments'))
@@ -120,7 +121,9 @@ def get_lock_data():
return hostname, int(pid), filename
+# pylint: disable-msg=W0232
class WatcherState(Enum):
+ """Enum for the state of the master process watcher."""
# Another master watcher is running.
conflict = 1
# No conflicting process exists.
@@ -134,12 +137,9 @@ def master_state():
:return: WatcherState describing the state of the lock file.
"""
-
- # 1 if proc exists on host (but is it qrunner? ;)
- # 0 if host matches but no proc
- # hostname if hostname doesn't match
+ # pylint: disable-msg=W0612
hostname, pid, tempfile = get_lock_data()
- if hostname <> socket.gethostname():
+ if hostname != socket.gethostname():
return WatcherState.host_mismatch
# Find out if the process exists by calling kill with a signal 0.
try:
@@ -169,6 +169,7 @@ def acquire_lock_1(force):
raise
# Force removal of lock first.
lock.disown()
+ # pylint: disable-msg=W0612
hostname, pid, tempfile = get_lock_data()
os.unlink(config.LOCK_FILE)
os.unlink(os.path.join(config.LOCK_DIR, tempfile))
@@ -200,9 +201,10 @@ The master qrunner lock could not be acquired. It appears as though there is
a stale master qrunner lock. Try re-running mailmanctl with the -s flag.
""")
else:
+ # Hostname doesn't even match.
assert status == WatcherState.host_mismatch, (
'Invalid enum value: %s' % status)
- # Hostname doesn't even match.
+ # pylint: disable-msg=W0612
hostname, pid, tempfile = get_lock_data()
message = _("""\
The master qrunner lock could not be acquired, because it appears as if some
@@ -232,6 +234,7 @@ class Loop:
# Set up our signal handlers. Also set up a SIGALRM handler to
# refresh the lock once per day. The lock lifetime is 1 day + 6 hours
# so this should be plenty.
+ # pylint: disable-msg=W0613,C0111
def sigalrm_handler(signum, frame):
self._lock.refresh()
signal.alarm(SECONDS_IN_A_DAY)
@@ -320,7 +323,6 @@ class Loop:
qrunner_config = getattr(config, section_name)
if not as_boolean(qrunner_config.start):
continue
- class_ = find_name(qrunner_config['class'])
# Find out how many qrunners to instantiate. This must be a power
# of 2.
count = int(qrunner_config.instances)
@@ -409,6 +411,7 @@ qrunner %s reached maximum restart limit of %d, not restarting.""",
# Wait for all the children to go away.
while self._kids:
try:
+ # pylint: disable-msg=W0612
pid, status = os.wait()
del self._kids[pid]
except OSError, e:
diff --git a/src/mailman/docs/README.txt b/src/mailman/docs/README.txt
index dfc75e014..72794f111 100644
--- a/src/mailman/docs/README.txt
+++ b/src/mailman/docs/README.txt
@@ -80,7 +80,7 @@ lists and archives, etc., are available at:
Requirements
============
-Mailman 3.0 requires `Python 2.6` or newer.
+Mailman 3.0 requires `Python 2.6`_ or newer.
.. _`GNU Mailman`: http://www.list.org