From: wrobell Date: Sat, 4 Oct 2003 00:25:56 +0000 (+0000) Subject: - load all types of python modules /not only *.py files/ X-Git-Tag: auto/ac/pylint-0_4_2-1~12 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=542723f81b4c7413256f55582c3d7c84123c044c;p=packages%2Fpylint.git - load all types of python modules /not only *.py files/ Changed files: pylint-checkers.patch -> 1.1 --- diff --git a/pylint-checkers.patch b/pylint-checkers.patch new file mode 100644 index 0000000..fc548fa --- /dev/null +++ b/pylint-checkers.patch @@ -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