Commit 99430113 by Ned Batchelder

Fix pre-existing pylint violations

parent a8473505
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
This file includes the monkey-patch for requests' PATCH method, as we are using This file includes the monkey-patch for requests' PATCH method, as we are using
older version of django that does not contains the PATCH method in its test client. older version of django that does not contains the PATCH method in its test client.
""" """
# pylint: disable=protected-access
from __future__ import unicode_literals from __future__ import unicode_literals
from urlparse import urlparse from urlparse import urlparse
...@@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg' ...@@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg'
MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY MULTIPART_CONTENT = 'multipart/form-data; boundary=%s' % BOUNDARY
def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, **extra): def request_factory_patch(self, path, data=None, content_type=MULTIPART_CONTENT, **extra):
""" """
Construct a PATCH request. Construct a PATCH request.
""" """
patch_data = self._encode_data(data, content_type) # pylint: disable=invalid-name
patch_data = self._encode_data(data or {}, content_type)
parsed = urlparse(path) parsed = urlparse(path)
r = { r = {
...@@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, * ...@@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, *
return self.request(**r) return self.request(**r)
def client_patch(self, path, data={}, content_type=MULTIPART_CONTENT, follow=False, **extra): def client_patch(self, path, data=None, content_type=MULTIPART_CONTENT, follow=False, **extra):
""" """
Send a resource to the server using PATCH. Send a resource to the server using PATCH.
""" """
response = super(Client, self).patch(path, data=data, content_type=content_type, **extra) response = super(Client, self).patch(path, data=data or {}, content_type=content_type, **extra)
if follow: if follow:
response = self._handle_redirects(response, **extra) response = self._handle_redirects(response, **extra)
return response return response
......
"""Get log settings."""
import os import os
import platform import platform
import sys import sys
......
"""Provides rooted_glob, for finding relative glob paths in another director."""
import glob2 import glob2
......
...@@ -6,7 +6,7 @@ import shutil ...@@ -6,7 +6,7 @@ import shutil
import tempfile import tempfile
def mkdtemp_clean(suffix="", prefix="tmp", dir=None): def mkdtemp_clean(suffix="", prefix="tmp", dir=None): # pylint: disable=redefined-builtin
"""Just like mkdtemp, but the directory will be deleted when the process ends.""" """Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir) the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
atexit.register(cleanup_tempdir, the_dir) atexit.register(cleanup_tempdir, the_dir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment