Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
eb234982
Commit
eb234982
authored
Sep 05, 2023
by
comfyanonymous
Browse files
Merge branch 'folder_paths_ignore_git' of
https://github.com/M1kep/ComfyUI
parents
bc1f6e21
3e00fa43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
folder_paths.py
folder_paths.py
+15
-8
No files found.
folder_paths.py
View file @
eb234982
...
@@ -121,18 +121,25 @@ def add_model_folder_path(folder_name, full_folder_path):
...
@@ -121,18 +121,25 @@ def add_model_folder_path(folder_name, full_folder_path):
def
get_folder_paths
(
folder_name
):
def
get_folder_paths
(
folder_name
):
return
folder_names_and_paths
[
folder_name
][
0
][:]
return
folder_names_and_paths
[
folder_name
][
0
][:]
def
recursive_search
(
directory
):
def
recursive_search
(
directory
,
excluded_dir_names
=
None
):
if
not
os
.
path
.
isdir
(
directory
):
if
not
os
.
path
.
isdir
(
directory
):
return
[],
{}
return
[],
{}
if
excluded_dir_names
is
None
:
excluded_dir_names
=
[]
result
=
[]
result
=
[]
dirs
=
{
directory
:
os
.
path
.
getmtime
(
directory
)}
dirs
=
{
directory
:
os
.
path
.
getmtime
(
directory
)}
for
root
,
subdir
,
file
in
os
.
walk
(
directory
,
followlinks
=
True
):
for
dirpath
,
subdirs
,
filenames
in
os
.
walk
(
directory
,
followlinks
=
True
,
topdown
=
True
):
for
filepath
in
file
:
print
(
"Checking directory: "
+
dirpath
)
#we os.path,join directory with a blank string to generate a path separator at the end.
subdirs
[:]
=
[
d
for
d
in
subdirs
if
d
not
in
excluded_dir_names
]
result
.
append
(
os
.
path
.
join
(
root
,
filepath
).
replace
(
os
.
path
.
join
(
directory
,
''
),
''
))
for
file_name
in
filenames
:
for
d
in
subdir
:
relative_path
=
os
.
path
.
relpath
(
os
.
path
.
join
(
dirpath
,
file_name
),
directory
)
path
=
os
.
path
.
join
(
root
,
d
)
result
.
append
(
relative_path
)
for
d
in
subdirs
:
path
=
os
.
path
.
join
(
dirpath
,
d
)
dirs
[
path
]
=
os
.
path
.
getmtime
(
path
)
dirs
[
path
]
=
os
.
path
.
getmtime
(
path
)
print
(
"Returning from recursive_search"
+
repr
(
result
))
return
result
,
dirs
return
result
,
dirs
def
filter_files_extensions
(
files
,
extensions
):
def
filter_files_extensions
(
files
,
extensions
):
...
@@ -159,7 +166,7 @@ def get_filename_list_(folder_name):
...
@@ -159,7 +166,7 @@ def get_filename_list_(folder_name):
folders
=
folder_names_and_paths
[
folder_name
]
folders
=
folder_names_and_paths
[
folder_name
]
output_folders
=
{}
output_folders
=
{}
for
x
in
folders
[
0
]:
for
x
in
folders
[
0
]:
files
,
folders_all
=
recursive_search
(
x
)
files
,
folders_all
=
recursive_search
(
x
,
excluded_dir_names
=
[
".git"
]
)
output_list
.
update
(
filter_files_extensions
(
files
,
folders
[
1
]))
output_list
.
update
(
filter_files_extensions
(
files
,
folders
[
1
]))
output_folders
=
{
**
output_folders
,
**
folders_all
}
output_folders
=
{
**
output_folders
,
**
folders_all
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment