440 @param followsymlinks flag indicating whether symbolic links |
445 @param followsymlinks flag indicating whether symbolic links |
441 should be followed |
446 should be followed |
442 @type bool |
447 @type bool |
443 @param checkStop function to be called to check for a stop |
448 @param checkStop function to be called to check for a stop |
444 @type function |
449 @type function |
|
450 @param ignore list of entries to be ignored |
|
451 @type list of str |
445 @return list of all files and directories in the tree rooted |
452 @return list of all files and directories in the tree rooted |
446 at path. The names are expanded to start with path. |
453 at path. The names are expanded to start with path. |
447 @rtype list of strs |
454 @rtype list of strs |
448 """ |
455 """ |
449 patterns = pattern if isinstance(pattern, list) else [pattern] |
456 patterns = pattern if isinstance(pattern, list) else [pattern] |
450 files = [] if filesonly else [path] |
457 files = [] if filesonly else [path] |
|
458 ignoreList = [ |
|
459 ".svn", |
|
460 ".hg", |
|
461 ".git", |
|
462 ".ropeproject", |
|
463 ".eric7project", |
|
464 ".jedi", |
|
465 ] |
|
466 if ignore is not None: |
|
467 ignoreList.extend(ignore) |
|
468 |
451 try: |
469 try: |
452 entries = os.listdir(path) |
470 entries = os.listdir(path) |
453 for entry in entries: |
471 for entry in entries: |
454 if checkStop and checkStop(): |
472 if checkStop and checkStop(): |
455 break |
473 break |
456 |
474 |
457 if entry in [ |
475 if entry in ignoreList: |
458 ".svn", |
|
459 ".hg", |
|
460 ".git", |
|
461 ".ropeproject", |
|
462 ".eric7project", |
|
463 ".jedi", |
|
464 ]: |
|
465 continue |
476 continue |
466 |
477 |
467 fentry = os.path.join(path, entry) |
478 fentry = os.path.join(path, entry) |
468 if ( |
479 if ( |
469 pattern |
480 pattern |