Replace pylint "disable-msg" by "disable", and disable one more msg in setup.

This commit is contained in:
Guillaume Ayoub 2010-06-05 01:18:59 +02:00
parent ab0ee2c301
commit 9b86e6ef27
4 changed files with 19 additions and 16 deletions

View File

@ -38,13 +38,13 @@ import posixpath
import base64 import base64
import socket import socket
# Manage Python2/3 different modules # Manage Python2/3 different modules
# pylint: disable-msg=F0401 # pylint: disable=F0401
try: try:
from http import client, server from http import client, server
except ImportError: except ImportError:
import httplib as client import httplib as client
import BaseHTTPServer as server import BaseHTTPServer as server
# pylint: enable-msg=F0401 # pylint: enable=F0401
from radicale import acl, config, ical, xmlutils from radicale import acl, config, ical, xmlutils
@ -57,9 +57,9 @@ def _check(request, function):
if authorization: if authorization:
challenge = authorization.lstrip("Basic").strip().encode("ascii") challenge = authorization.lstrip("Basic").strip().encode("ascii")
# ``_check`` decorator can access ``request`` protected functions # ``_check`` decorator can access ``request`` protected functions
# pylint: disable-msg=W0212 # pylint: disable=W0212
plain = request._decode(base64.b64decode(challenge)) plain = request._decode(base64.b64decode(challenge))
# pylint: enable-msg=W0212 # pylint: enable=W0212
user, password = plain.split(":") user, password = plain.split(":")
else: else:
user = password = None user = password = None
@ -77,12 +77,12 @@ def _check(request, function):
class HTTPServer(server.HTTPServer): class HTTPServer(server.HTTPServer):
"""HTTP server.""" """HTTP server."""
# Maybe a Pylint bug, ``__init__`` calls ``server.HTTPServer.__init__`` # Maybe a Pylint bug, ``__init__`` calls ``server.HTTPServer.__init__``
# pylint: disable-msg=W0231 # pylint: disable=W0231
def __init__(self, address, handler): def __init__(self, address, handler):
"""Create server.""" """Create server."""
server.HTTPServer.__init__(self, address, handler) server.HTTPServer.__init__(self, address, handler)
self.acl = acl.load() self.acl = acl.load()
# pylint: enable-msg=W0231 # pylint: enable=W0231
class HTTPSServer(HTTPServer): class HTTPSServer(HTTPServer):
@ -90,9 +90,9 @@ class HTTPSServer(HTTPServer):
def __init__(self, address, handler): def __init__(self, address, handler):
"""Create server by wrapping HTTP socket in an SSL socket.""" """Create server by wrapping HTTP socket in an SSL socket."""
# Fails with Python 2.5, import if needed # Fails with Python 2.5, import if needed
# pylint: disable-msg=F0401 # pylint: disable=F0401
import ssl import ssl
# pylint: enable-msg=F0401 # pylint: enable=F0401
HTTPServer.__init__(self, address, handler) HTTPServer.__init__(self, address, handler)
self.socket = ssl.wrap_socket( self.socket = ssl.wrap_socket(
@ -146,7 +146,7 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
raise UnicodeDecodeError raise UnicodeDecodeError
# Naming methods ``do_*`` is OK here # Naming methods ``do_*`` is OK here
# pylint: disable-msg=C0103 # pylint: disable=C0103
@check_rights @check_rights
def do_GET(self): def do_GET(self):
@ -241,4 +241,4 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
self.end_headers() self.end_headers()
self.wfile.write(answer) self.wfile.write(answer)
# pylint: enable-msg=C0103 # pylint: enable=C0103

View File

@ -30,12 +30,12 @@ Give a configparser-like interface to read and write configuration.
import os import os
import sys import sys
# Manage Python2/3 different modules # Manage Python2/3 different modules
# pylint: disable-msg=F0401 # pylint: disable=F0401
try: try:
from configparser import RawConfigParser as ConfigParser from configparser import RawConfigParser as ConfigParser
except ImportError: except ImportError:
from ConfigParser import RawConfigParser as ConfigParser from ConfigParser import RawConfigParser as ConfigParser
# pylint: enable-msg=F0401 # pylint: enable=F0401
# Default configuration # Default configuration

View File

@ -35,11 +35,11 @@ FOLDER = os.path.expanduser(config.get("storage", "folder"))
# This function overrides the builtin ``open`` function for this module # This function overrides the builtin ``open`` function for this module
# pylint: disable-msg=W0622 # pylint: disable=W0622
def open(path, mode="r"): def open(path, mode="r"):
"""Open file at ``path`` with ``mode``, automagically managing encoding.""" """Open file at ``path`` with ``mode``, automagically managing encoding."""
return codecs.open(path, mode, config.get("encoding", "stock")) return codecs.open(path, mode, config.get("encoding", "stock"))
# pylint: enable-msg=W0622 # pylint: enable=W0622
def serialize(headers=(), items=()): def serialize(headers=(), items=()):
@ -118,9 +118,9 @@ class Event(Item):
class Todo(Item): class Todo(Item):
"""Internal todo class.""" """Internal todo class."""
# This is not a TODO! # This is not a TODO!
# pylint: disable-msg=W0511 # pylint: disable=W0511
tag = "VTODO" tag = "VTODO"
# pylint: enable-msg=W0511 # pylint: enable=W0511
class Timezone(Item): class Timezone(Item):

View File

@ -43,6 +43,8 @@ from distutils.command.build_scripts import build_scripts
import radicale import radicale
# build_scripts is known to have a lot of public methods
# pylint: disable=R0904
class BuildScripts(build_scripts): class BuildScripts(build_scripts):
"""Build the package.""" """Build the package."""
def run(self): def run(self):
@ -52,6 +54,7 @@ class BuildScripts(build_scripts):
for script in self.scripts: for script in self.scripts:
root, _ = os.path.splitext(script) root, _ = os.path.splitext(script)
self.copy_file(script, os.path.join(self.build_dir, root)) self.copy_file(script, os.path.join(self.build_dir, root))
# pylint: enable=R0904
# When the version is updated, ``radicale.VERSION`` must be modified. # When the version is updated, ``radicale.VERSION`` must be modified.