summaryrefslogtreecommitdiff
path: root/fileutils.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2009-08-07 11:03:23 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2009-08-07 11:03:23 +0200
commita79438e016dadb93543eb73d23f153e43dcb836a (patch)
treed671c6a83de12b027a2b730732a5e5f8168f92a8 /fileutils.py
parent417ecf4be0c01159bd464d1264cae24f91bf023b (diff)
downloadlogilab-common-a79438e016dadb93543eb73d23f153e43dcb836a.tar.gz
remove deprecated code
Diffstat (limited to 'fileutils.py')
-rw-r--r--fileutils.py72
1 files changed, 0 insertions, 72 deletions
diff --git a/fileutils.py b/fileutils.py
index a2afbc5..177c604 100644
--- a/fileutils.py
+++ b/fileutils.py
@@ -394,75 +394,3 @@ def remove_dead_links(directory, verbose=0):
print 'remove dead link', src
remove(src)
walk(directory, _remove_dead_link, None)
-
-
-from warnings import warn
-
-def files_by_ext(directory, include_exts=None, exclude_exts=None,
- exclude_dirs=BASE_BLACKLIST):
- """Return a list of files in a directory matching (or not) some
- extensions: you should either give the `include_exts` argument (and
- only files ending with one of the listed extensions will be
- considered) or the `exclude_exts` argument (and only files not
- ending by one of the listed extensions will be considered).
- Subdirectories are processed recursivly.
-
- :type directory: str
- :param directory: directory where files should be searched
-
- :type include_exts: list or tuple or None
- :param include_exts: list of file extensions to consider
-
- :type exclude_exts: list or tuple or None
- :param exclude_exts: list of file extensions to ignore
-
- :type exclude_dirs: list or tuple or None
- :param exclude_dirs: list of directory where we should not recurse
-
- :rtype: list
- :return: the list of files matching input criteria
- """
- assert not (include_exts and exclude_exts)
- warn("files_by_ext is deprecated, use shellutils.find instead" ,
- DeprecationWarning, stacklevel=2)
- if include_exts:
- return find(directory, include_exts, blacklist=exclude_dirs)
- return find(directory, exclude_exts, exclude=True, blacklist=exclude_dirs)
-
-def include_files_by_ext(directory, include_exts, exclude_dirs=BASE_BLACKLIST):
- """Return a list of files in a directory matching some extensions.
-
- :type directory: str
- :param directory: directory where files should be searched
-
- :type include_exts: list or tuple or None
- :param include_exts: list of file extensions to consider
-
- :type exclude_dirs: list or tuple or None
- :param exclude_dirs: list of directory where we should not recurse
-
- :rtype: list
- :return: the list of files matching input criterias
- """
- warn("include_files_by_ext is deprecated, use shellutils.find instead" ,
- DeprecationWarning, stacklevel=2)
- return find(directory, include_exts, blacklist=exclude_dirs)
-
-def exclude_files_by_ext(directory, exclude_exts, exclude_dirs=BASE_BLACKLIST):
- """Return a list of files in a directory not matching some extensions.
-
- :type directory: str
- :param directory: directory where files should be searched
-
- :type exclude_exts: list or tuple or None
- :param exclude_exts: list of file extensions to ignore
-
- :type exclude_dirs: list or tuple or None
- :param exclude_dirs: list of directory where we should not recurse
-
- :rtype: list
- :return: the list of files matching input criterias
- """
- warn("exclude_files_by_ext is deprecated, use shellutils.find instead" ,
- DeprecationWarning, stacklevel=2)
- return find(directory, exclude_exts, exclude=True, blacklist=exclude_dirs)