eric7/Utilities/__init__.py

branch
eric7
changeset 8845
3d3c1b812fe4
parent 8553
10d31e5ce9e5
child 8881
54e42bc2437a
--- a/eric7/Utilities/__init__.py	Mon Dec 20 22:06:09 2021 +0100
+++ b/eric7/Utilities/__init__.py	Tue Dec 21 12:14:24 2021 +0100
@@ -1129,14 +1129,22 @@
     Function returning a list of all files and directories.
     
     @param path root of the tree to check
+    @type str
     @param filesonly flag indicating that only files are wanted
-    @param pattern a filename pattern to check against
+    @type bool
+    @param pattern a filename pattern or list of filename patterns to check
+        against
+    @type str or list of str
     @param followsymlinks flag indicating whether symbolic links
-            should be followed
+        should be followed
+    @type bool
     @param checkStop function to be called to check for a stop
+    @type function
     @return list of all files and directories in the tree rooted
         at path. The names are expanded to start with path.
+    @rtype list of strs
     """
+    patterns = pattern if isinstance(pattern, list) else [pattern]
     files = [] if filesonly else [path]
     try:
         entries = os.listdir(path)
@@ -1148,14 +1156,15 @@
                          '.hg',
                          '.git',
                          '.ropeproject',
-                         '.eric7project']:
+                         '.eric7project',
+                         '.jedi']:
                 continue
             
             fentry = os.path.join(path, entry)
             if (
                 pattern and
                 not os.path.isdir(fentry) and
-                not fnmatch.fnmatch(entry, pattern)
+                not any(fnmatch.fnmatch(entry, p) for p in patterns)
             ):
                 # entry doesn't fit the given pattern
                 continue

eric ide

mercurial