A little pylint cleanup

This commit is contained in:
Garrett Holmstrom
2015-07-15 16:55:34 -07:00
parent 8d0707ce6c
commit 54d443d346
3 changed files with 7 additions and 11 deletions

View File

@@ -22,6 +22,7 @@ import hashlib
import hmac
import os
import re
import tempfile
import time
import warnings
@@ -76,8 +77,8 @@ class HmacKeyAuth(BaseAuth):
else:
self.log.warn(
'failed to parse credential expiration time '
'\'{0}\'; proceeding without validation'.format(
self.args['credential_expiration']))
'\'{0}\'; proceeding without validation'
.format(self.args['credential_expiration']))
if expiration and expiration < datetime.datetime.utcnow():
raise AuthError('credentials have expired')

View File

@@ -12,7 +12,6 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import argparse
import operator
import sys
@@ -34,15 +33,12 @@ class TabifyingMixin(object):
help='show empty values as "(nil)"')]
def tabify(self, fields, include=None):
'''
"""
Join a list of strings with tabs. Nonzero items that Python considers
false are printed as-is if they appear in the include list, replaced
with '(nil)' if the user specifies --show-empty-fields at the command
line, and omitted otherwise.
'''
def allowable(item):
return bool(item) or item is 0 or item in (include or [])
"""
if self.args['show_empty_fields']:
fstr = '(nil)'
else:
@@ -97,8 +93,8 @@ else:
def add_row(self, row):
if len(row) != len(self.field_names):
raise ValueError('row has incorrect number of values '
'({0} given, {1} expected)'
.format(len(row), len(field_names)))
'({0} given, {1} expected)'
.format(len(row), len(self.field_names)))
self._rows.append(_filter_row_values(row, self.__empty))
@property

View File

@@ -13,7 +13,6 @@
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import requestbuilder
import warnings
def add_default_routes(arglike_obj, default_routes):