refactor: Skip deactivated files in directory_reader.py
The code changes in `directory_reader.py` introduce a check to skip files that are located in the `deactivated` folder. This improves the efficiency of the directory reading process by excluding unnecessary files.
This commit is contained in:
parent
d4080b81f9
commit
4d7cee23d8
1 changed files with 4 additions and 0 deletions
|
|
@ -129,6 +129,10 @@ class DirectoryReader:
|
||||||
file_list = []
|
file_list = []
|
||||||
safe_path_obj = Path(safe_path)
|
safe_path_obj = Path(safe_path)
|
||||||
for file_path in safe_path_obj.rglob("*.py"):
|
for file_path in safe_path_obj.rglob("*.py"):
|
||||||
|
# Check if the file is in the folder `deactivated` and if so, skip it
|
||||||
|
if "deactivated" in file_path.parent.name:
|
||||||
|
continue
|
||||||
|
|
||||||
# The other condtion is that it should be
|
# The other condtion is that it should be
|
||||||
# in the safe_path/[folder]/[file].py format
|
# in the safe_path/[folder]/[file].py format
|
||||||
# any folders below [folder] will be ignored
|
# any folders below [folder] will be ignored
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue