]> git.pld-linux.org Git - packages/pylint.git/commitdiff
- load all types of python modules /not only *.py files/
authorwrobell <wrobell@pld-linux.org>
Sat, 4 Oct 2003 00:25:56 +0000 (00:25 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pylint-checkers.patch -> 1.1

pylint-checkers.patch [new file with mode: 0644]

diff --git a/pylint-checkers.patch b/pylint-checkers.patch
new file mode 100644 (file)
index 0000000..fc548fa
--- /dev/null
@@ -0,0 +1,30 @@
+diff -Nur logilab-pylint-0.2.0.orig/checkers/__init__.py logilab-pylint-0.2.0/checkers/__init__.py
+--- logilab-pylint-0.2.0.orig/checkers/__init__.py     Fri Sep 12 18:20:39 2003
++++ logilab-pylint-0.2.0/checkers/__init__.py  Sat Oct  4 02:17:34 2003
+@@ -119,14 +119,22 @@
+     
+ def initialize(linter):
+     """ initialize linter with checkers in this package """
+-    from os import listdir
++    import os
++    import sets
+     g = globals()
+-    for file in listdir(__path__[0]):
+-        if file[-3:] == '.py' and file != '__init__.py':
++    imported = sets.Set()  # imported checkers
++    for file in os.listdir(__path__[0]):
++        (basename, extension) = os.path.splitext(file)
++
++        # allow to import all types of python modules
++        if extension in ('.so', '.py', '.pyc', '.pyo', '') \
++                    and basename != '__init__' \
++                    and basename not in imported:
+             try:
+-                ns = __import__(file[:-3], g, g, None)
++                ns = __import__(basename, g, g, None)
+                 if hasattr(ns, 'register'):
+                     ns.register(linter)
++                imported.add(basename)
+             except ImportError:
+                 import sys
+                 print >> sys.stderr, "Problem importing module: %s" % file
This page took 0.233698 seconds and 4 git commands to generate.