diff options
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | pylint.conf | 30 | ||||
-rwxr-xr-x | summain | 7 | ||||
-rw-r--r-- | summainlib.py | 9 |
4 files changed, 40 insertions, 7 deletions
@@ -27,6 +27,7 @@ check: rm -f .coverage cmdtest tests pep8 summain summainlib.py summainlib_tests.py + pylint --rcfile=pylint.conf summain summainlib.py summainlib_tests.py clean: python setup.py clean diff --git a/pylint.conf b/pylint.conf new file mode 100644 index 0000000..bae19df --- /dev/null +++ b/pylint.conf @@ -0,0 +1,30 @@ +[MASTER] +persistent=no + +[MESSAGES CONTROL] +disable= + attribute-defined-outside-init, + bad-builtin, + blacklisted-name, + cyclic-import, + invalid-name, + missing-docstring, + no-member, + no-self-use, + pointless-statement, + protected-access, + star-args, + too-few-public-methods, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-locals, + too-many-public-methods, + too-many-statements, + unused-argument + +[REPORTS] +reports=no + +[SIMILARITIES] +min-similarity-lines=999 @@ -19,7 +19,6 @@ import cliapp import csv import json import os -import sys import summainlib @@ -39,7 +38,7 @@ class OutputFormat(object): self.write_object(name, o) def write_object(self, name, o): - raise NotImplemented() + raise NotImplementedError() class Rfc822(OutputFormat): @@ -73,6 +72,7 @@ class CSV(OutputFormat): class GeneratorList(list): def __init__(self, gen): + list.__init__(self) self.gen = gen def __len__(self): @@ -89,6 +89,9 @@ class Json(OutputFormat): json.dump(gen, self.output, sort_keys=True, indent=1) self.output.write('\n') + def write_object(self, name, o): + pass + def dictify(self, name, o): keys = self.keys + self.checksums diff --git a/summainlib.py b/summainlib.py index 6466383..2579090 100644 --- a/summainlib.py +++ b/summainlib.py @@ -18,7 +18,6 @@ import base64 import grp import hashlib import hmac -import math import os import pwd import stat @@ -59,12 +58,12 @@ class NumberNormalizer(object): def __init__(self): self.reset() - def get(self, input_number, numbers, next): + def get(self, input_number, numbers, next_number): if input_number in numbers: - return numbers[input_number], next + return numbers[input_number], next_number else: - numbers[input_number] = next - return numbers[input_number], next + 1 + numbers[input_number] = next_number + return numbers[input_number], next_number + 1 def get_ino(self, ino): output, self.next_ino = self.get(ino, self.ino_numbers, self.next_ino) |