Replace pylint "disable-msg" by "disable", and disable one more msg in setup.
This commit is contained in:
parent
ab0ee2c301
commit
9b86e6ef27
@ -38,13 +38,13 @@ import posixpath
|
||||
import base64
|
||||
import socket
|
||||
# Manage Python2/3 different modules
|
||||
# pylint: disable-msg=F0401
|
||||
# pylint: disable=F0401
|
||||
try:
|
||||
from http import client, server
|
||||
except ImportError:
|
||||
import httplib as client
|
||||
import BaseHTTPServer as server
|
||||
# pylint: enable-msg=F0401
|
||||
# pylint: enable=F0401
|
||||
|
||||
from radicale import acl, config, ical, xmlutils
|
||||
|
||||
@ -57,9 +57,9 @@ def _check(request, function):
|
||||
if authorization:
|
||||
challenge = authorization.lstrip("Basic").strip().encode("ascii")
|
||||
# ``_check`` decorator can access ``request`` protected functions
|
||||
# pylint: disable-msg=W0212
|
||||
# pylint: disable=W0212
|
||||
plain = request._decode(base64.b64decode(challenge))
|
||||
# pylint: enable-msg=W0212
|
||||
# pylint: enable=W0212
|
||||
user, password = plain.split(":")
|
||||
else:
|
||||
user = password = None
|
||||
@ -77,12 +77,12 @@ def _check(request, function):
|
||||
class HTTPServer(server.HTTPServer):
|
||||
"""HTTP server."""
|
||||
# Maybe a Pylint bug, ``__init__`` calls ``server.HTTPServer.__init__``
|
||||
# pylint: disable-msg=W0231
|
||||
# pylint: disable=W0231
|
||||
def __init__(self, address, handler):
|
||||
"""Create server."""
|
||||
server.HTTPServer.__init__(self, address, handler)
|
||||
self.acl = acl.load()
|
||||
# pylint: enable-msg=W0231
|
||||
# pylint: enable=W0231
|
||||
|
||||
|
||||
class HTTPSServer(HTTPServer):
|
||||
@ -90,9 +90,9 @@ class HTTPSServer(HTTPServer):
|
||||
def __init__(self, address, handler):
|
||||
"""Create server by wrapping HTTP socket in an SSL socket."""
|
||||
# Fails with Python 2.5, import if needed
|
||||
# pylint: disable-msg=F0401
|
||||
# pylint: disable=F0401
|
||||
import ssl
|
||||
# pylint: enable-msg=F0401
|
||||
# pylint: enable=F0401
|
||||
|
||||
HTTPServer.__init__(self, address, handler)
|
||||
self.socket = ssl.wrap_socket(
|
||||
@ -146,7 +146,7 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
|
||||
raise UnicodeDecodeError
|
||||
|
||||
# Naming methods ``do_*`` is OK here
|
||||
# pylint: disable-msg=C0103
|
||||
# pylint: disable=C0103
|
||||
|
||||
@check_rights
|
||||
def do_GET(self):
|
||||
@ -241,4 +241,4 @@ class CalendarHTTPHandler(server.BaseHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
self.wfile.write(answer)
|
||||
|
||||
# pylint: enable-msg=C0103
|
||||
# pylint: enable=C0103
|
||||
|
@ -30,12 +30,12 @@ Give a configparser-like interface to read and write configuration.
|
||||
import os
|
||||
import sys
|
||||
# Manage Python2/3 different modules
|
||||
# pylint: disable-msg=F0401
|
||||
# pylint: disable=F0401
|
||||
try:
|
||||
from configparser import RawConfigParser as ConfigParser
|
||||
except ImportError:
|
||||
from ConfigParser import RawConfigParser as ConfigParser
|
||||
# pylint: enable-msg=F0401
|
||||
# pylint: enable=F0401
|
||||
|
||||
|
||||
# Default configuration
|
||||
|
@ -35,11 +35,11 @@ FOLDER = os.path.expanduser(config.get("storage", "folder"))
|
||||
|
||||
|
||||
# This function overrides the builtin ``open`` function for this module
|
||||
# pylint: disable-msg=W0622
|
||||
# pylint: disable=W0622
|
||||
def open(path, mode="r"):
|
||||
"""Open file at ``path`` with ``mode``, automagically managing encoding."""
|
||||
return codecs.open(path, mode, config.get("encoding", "stock"))
|
||||
# pylint: enable-msg=W0622
|
||||
# pylint: enable=W0622
|
||||
|
||||
|
||||
def serialize(headers=(), items=()):
|
||||
@ -118,9 +118,9 @@ class Event(Item):
|
||||
class Todo(Item):
|
||||
"""Internal todo class."""
|
||||
# This is not a TODO!
|
||||
# pylint: disable-msg=W0511
|
||||
# pylint: disable=W0511
|
||||
tag = "VTODO"
|
||||
# pylint: enable-msg=W0511
|
||||
# pylint: enable=W0511
|
||||
|
||||
|
||||
class Timezone(Item):
|
||||
|
3
setup.py
3
setup.py
@ -43,6 +43,8 @@ from distutils.command.build_scripts import build_scripts
|
||||
import radicale
|
||||
|
||||
|
||||
# build_scripts is known to have a lot of public methods
|
||||
# pylint: disable=R0904
|
||||
class BuildScripts(build_scripts):
|
||||
"""Build the package."""
|
||||
def run(self):
|
||||
@ -52,6 +54,7 @@ class BuildScripts(build_scripts):
|
||||
for script in self.scripts:
|
||||
root, _ = os.path.splitext(script)
|
||||
self.copy_file(script, os.path.join(self.build_dir, root))
|
||||
# pylint: enable=R0904
|
||||
|
||||
|
||||
# When the version is updated, ``radicale.VERSION`` must be modified.
|
||||
|
Loading…
Reference in New Issue
Block a user