Fix pre-existing pylint violations

This commit is contained in:
Ned Batchelder
2015-03-23 12:36:35 -04:00
parent a84735057d
commit 99430113e3
4 changed files with 14 additions and 5 deletions

View File

@@ -2,6 +2,9 @@
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.
"""
# pylint: disable=protected-access
from __future__ import unicode_literals
from urlparse import urlparse
@@ -13,11 +16,13 @@ BOUNDARY = 'BoUnDaRyStRiNg'
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.
"""
patch_data = self._encode_data(data, content_type)
# pylint: disable=invalid-name
patch_data = self._encode_data(data or {}, content_type)
parsed = urlparse(path)
r = {
@@ -32,11 +37,11 @@ def request_factory_patch(self, path, data={}, content_type=MULTIPART_CONTENT, *
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.
"""
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:
response = self._handle_redirects(response, **extra)
return response

View File

@@ -1,3 +1,5 @@
"""Get log settings."""
import os
import platform
import sys

View File

@@ -1,3 +1,5 @@
"""Provides rooted_glob, for finding relative glob paths in another director."""
import glob2

View File

@@ -6,7 +6,7 @@ import shutil
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."""
the_dir = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
atexit.register(cleanup_tempdir, the_dir)