diff options
-rw-r--r-- | compat.py | 8 | ||||
-rw-r--r-- | hg.py | 2 | ||||
-rw-r--r-- | logging_ext.py | 4 | ||||
-rw-r--r-- | pytest.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | testlib.py | 14 | ||||
-rw-r--r-- | tree.py | 3 | ||||
-rw-r--r-- | ureports/nodes.py | 2 |
8 files changed, 17 insertions, 20 deletions
@@ -1,4 +1,4 @@ -# pylint: disable-msg=E0601,W0622,W0611 +# pylint: disable=E0601,W0622,W0611 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # @@ -18,12 +18,10 @@ # with logilab-common. If not, see <http://www.gnu.org/licenses/>. """Wrappers around some builtins introduced in python 2.3, 2.4 and 2.5, making them available in for earlier versions of python. - - - - """ + from __future__ import generators + __docformat__ = "restructuredtext en" import os @@ -19,6 +19,8 @@ __docformat__ = "restructuredtext en" +import os +import sys import os.path as osp try: diff --git a/logging_ext.py b/logging_ext.py index 972f844..087e08c 100644 --- a/logging_ext.py +++ b/logging_ext.py @@ -134,7 +134,7 @@ def get_threshold(debug=False, logthreshold=None): def get_formatter(logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT): isatty = hasattr(sys.__stdout__, 'isatty') and sys.__stdout__.isatty() - if debug and isatty and sys.platform != 'win32': + if isatty and sys.platform != 'win32': fmt = ColorFormatter(logformat, logdateformat) def col_fact(record): if 'XXX' in record.message: @@ -150,7 +150,7 @@ def init_log(debug=False, syslog=False, logthreshold=None, logfile=None, logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT, fmt=None, rotation_parameters=None, handler=None): """init the log service""" - logger = getLogger() + logger = logging.getLogger() if handler is None: handler = get_handler(debug, syslog, logfile, rotation_parameters) # only addHandler and removeHandler method while I would like a setHandler @@ -502,7 +502,7 @@ class DjangoTester(PyTester): """walks through current working directory, finds something which can be considered as a testdir and runs every test there """ - for dirname, dirs, _ in os.walk(os.getcwd()): + for dirname, dirs, files in os.walk(os.getcwd()): for skipped in ('CVS', '.svn', '.hg'): if skipped in dirs: dirs.remove(skipped) @@ -1,5 +1,5 @@ #!/usr/bin/env python -# pylint: disable-msg=W0404,W0622,W0704,W0613,W0152 +# pylint: disable=W0404,W0622,W0704,W0613 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # @@ -40,7 +40,7 @@ If no non-option arguments are present, prefixes used are 'test', __docformat__ = "restructuredtext en" # modified copy of some functions from test/regrtest.py from PyXml # disable camel case warning -# pylint: disable-msg=C0103 +# pylint: disable=C0103 import sys import os, os.path as osp @@ -77,7 +77,7 @@ except ImportError: pass test_support = TestSupport() -# pylint: disable-msg=W0622 +# pylint: disable=W0622 from logilab.common.compat import set, enumerate, any, sorted, InheritableSet # pylint: enable-msg=W0622 from logilab.common.modutils import load_module_from_name @@ -1038,7 +1038,7 @@ class TestCase(unittest.TestCase): @classproperty @cached - def datadir(cls): # pylint: disable-msg=E0213 + def datadir(cls): # pylint: disable=E0213 """helper attribute holding the standard test's data directory NOTE: this is a logilab's standard @@ -1473,10 +1473,10 @@ succeeded test into", osp.join(os.getcwd(),FILE_RESTART) except ExpatError, ex: if msg is None: if hasattr(data, 'readlines'): #file like object - stream.seek(0) - lines = stream.readlines() + data.seek(0) + lines = data.readlines() else: - lines =data.splitlines(True) + lines = data.splitlines(True) nb_lines = len(lines) context_lines = [] @@ -1808,7 +1808,7 @@ class DocTest(TestCase): """ skipped = () def __call__(self, result=None, runcondition=None, options=None):\ - # pylint: disable-msg=W0613 + # pylint: disable=W0613 try: finder = DocTestFinder(skipped=self.skipped) if sys.version_info >= (2, 4): @@ -205,9 +205,6 @@ class Node(object): else: return [self] - def __iter__(self): - return iter(self.children) - def flatten(self, _list=None): """ return a list with all the nodes descendant from this node diff --git a/ureports/nodes.py b/ureports/nodes.py index 3631aaa..0492f66 100644 --- a/ureports/nodes.py +++ b/ureports/nodes.py @@ -116,7 +116,7 @@ class Image(BaseComponent): * title : the image's optional title """ def __init__(self, filename, stream, title=None, **kwargs): - super(Link, self).__init__(**kwargs) + super(Image, self).__init__(**kwargs) assert filename assert stream self.filename = filename |