summaryrefslogtreecommitdiff
path: root/modutils.py
diff options
context:
space:
mode:
authorSylvain <syt@logilab.fr>2006-11-10 09:26:16 +0100
committerSylvain <syt@logilab.fr>2006-11-10 09:26:16 +0100
commit81fd4b08bd05f2553752e297d4768a76033d1b24 (patch)
tree918f153b48d5a882a5b9899e3ec388e25d6132f6 /modutils.py
parent000db8e14c6899c1a3afa785e4666521eabd3171 (diff)
downloadlogilab-common-81fd4b08bd05f2553752e297d4768a76033d1b24.tar.gz
new shellutils function + cleanup
Diffstat (limited to 'modutils.py')
-rw-r--r--modutils.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/modutils.py b/modutils.py
index fadba5b..c5260e3 100644
--- a/modutils.py
+++ b/modutils.py
@@ -39,6 +39,8 @@ import os
from os.path import walk, splitext, join, abspath, isdir, dirname, exists
from imp import find_module, load_module, C_BUILTIN, PY_COMPILED, PKG_DIRECTORY
+from logilab.common import STD_BLACKLIST
+
if sys.platform.startswith('win'):
PY_SOURCE_EXTS = ('py', 'pyw')
PY_COMPILED_EXTS = ('dll', 'pyd')
@@ -259,7 +261,7 @@ def get_module_part(dotted_name, context_file=None):
-def get_modules(package, src_directory, blacklist=('CVS', '.svn', 'debian')):
+def get_modules(package, src_directory, blacklist=STD_BLACKLIST):
"""given a package directory return a list of all available python
modules in the package and its subpackages
@@ -272,8 +274,8 @@ def get_modules(package, src_directory, blacklist=('CVS', '.svn', 'debian')):
:type blacklist: list or tuple
:param blacklist:
- optional list of files or directory to ignore, default to 'CVS',
- '.svn' and 'debian'
+ optional list of files or directory to ignore, default to
+ the value of `logilab.common.STD_BLACKLIST`
:rtype: list
:return:
@@ -309,7 +311,7 @@ def get_modules(package, src_directory, blacklist=('CVS', '.svn', 'debian')):
-def get_module_files(src_directory, blacklist=('CVS', '.svn', 'debian')):
+def get_module_files(src_directory, blacklist=('CVS', '.svn', '.hg', 'debian')):
"""given a package directory return a list of all available python
module's files in the package and its subpackages