mirror of https://gitlab.com/bashrc2/epicyon
Check break after walk
parent
9cb863a185
commit
762a5bdb3e
|
@ -1009,6 +1009,8 @@ def load_cw_lists(base_dir: str, verbose: bool) -> {}:
|
|||
if not os.path.isdir(base_dir + '/cwlists'):
|
||||
return {}
|
||||
result = {}
|
||||
# NOTE: here we do want to allow recursive walk through
|
||||
# possible subdirectories
|
||||
for _, _, files in os.walk(base_dir + '/cwlists'):
|
||||
for fname in files:
|
||||
if not fname.endswith('.json'):
|
||||
|
|
|
@ -452,6 +452,7 @@ def _create_news_mirror(base_dir: str, domain: str,
|
|||
no_of_dirs = 0
|
||||
for _, dirs, _ in os.walk(mirror_dir):
|
||||
no_of_dirs = len(dirs)
|
||||
break
|
||||
|
||||
mirror_index_filename = base_dir + '/accounts/newsmirror.txt'
|
||||
|
||||
|
|
|
@ -1333,6 +1333,7 @@ def shares_catalog_endpoint(base_dir: str, http_prefix: str,
|
|||
"DFC:description": description
|
||||
}
|
||||
endpoint['DFC:supplies'].append(catalog_item)
|
||||
break
|
||||
|
||||
return endpoint
|
||||
|
||||
|
|
1
tests.py
1
tests.py
|
@ -5088,6 +5088,7 @@ def _test_thread_functions():
|
|||
threads_called_in_modules = []
|
||||
|
||||
# get the source for each module
|
||||
# Allow recursive walk
|
||||
for _, _, files in os.walk('.'):
|
||||
for source_file in files:
|
||||
if not source_file.endswith('.py'):
|
||||
|
|
1
theme.py
1
theme.py
|
@ -933,6 +933,7 @@ def update_default_themes_list(base_dir: str) -> None:
|
|||
def scan_themes_for_scripts(base_dir: str) -> bool:
|
||||
"""Scans the theme directory for any svg files containing scripts
|
||||
"""
|
||||
# allow recursive walk
|
||||
for subdir, _, files in os.walk(base_dir + '/theme'):
|
||||
for fname in files:
|
||||
if not fname.endswith('.svg'):
|
||||
|
|
2
utils.py
2
utils.py
|
@ -1559,7 +1559,7 @@ def clear_from_post_caches(base_dir: str, recent_posts_cache: {},
|
|||
to news will appear
|
||||
"""
|
||||
filename = '/postcache/' + post_id + '.html'
|
||||
for subdir, dirs, files in os.walk(base_dir + '/accounts'):
|
||||
for _, dirs, _ in os.walk(base_dir + '/accounts'):
|
||||
for acct in dirs:
|
||||
if '@' not in acct:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue