# HG changeset patch # User Sylvain Thénault # Date 1287044156 -7200 # Node ID 47a284c0d012d75b32c6f9946e1ea9ef0d261c1b # Parent ee9a10b6620e58117e46625c22ccf72fa6faf5a7 fix some pylint detected errors diff -r ee9a10b6620e -r 47a284c0d012 dataimport.py --- a/dataimport.py Thu Oct 14 10:15:38 2010 +0200 +++ b/dataimport.py Thu Oct 14 10:15:56 2010 +0200 @@ -85,7 +85,7 @@ def count_lines(stream_or_filename): if isinstance(stream_or_filename, basestring): - f = open(filename) + f = open(stream_or_filename) else: f = stream_or_filename f.seek(0) @@ -98,8 +98,8 @@ skipfirst=False, withpb=True): """same as ucsvreader but a progress bar is displayed as we iter on rows""" if isinstance(stream_or_path, basestring): - if not osp.exists(filepath): - raise Exception("file doesn't exists: %s" % filepath) + if not osp.exists(stream_or_path): + raise Exception("file doesn't exists: %s" % stream_or_path) stream = open(stream_or_path) else: stream = stream_or_path @@ -421,7 +421,6 @@ ObjectStore.__init__(self) if session is None: sys.exit('please provide a session of run this script with cubicweb-ctl shell and pass cnx as session') - session = cnx if not hasattr(session, 'set_pool'): # connection cnx = session diff -r ee9a10b6620e -r 47a284c0d012 utils.py --- a/utils.py Thu Oct 14 10:15:38 2010 +0200 +++ b/utils.py Thu Oct 14 10:15:56 2010 +0200 @@ -186,7 +186,7 @@ return other[:] + ([self._item] * self._size) def __eq__(self, other): if isinstance(other, RepeatList): - return other._size == self.size and other._item == self.item + return other._size == self._size and other._item == self._item return self[:] == other def pop(self, i): self._size -= 1