Fix bug while reading yaml file from utils/g5505_utils.py
This commit is contained in:
@ -2,4 +2,5 @@ exclude_paths:
|
||||
containing :
|
||||
- .ipynb_checkpoints
|
||||
- .renku
|
||||
- .git
|
||||
- .git
|
||||
# - params
|
@ -308,17 +308,17 @@ def copy_directory_with_contraints(input_dir_path, output_dir_path,
|
||||
select_dir_keywords = [keyword.replace('/',os.sep) for keyword in select_dir_keywords]
|
||||
|
||||
try:
|
||||
with open(os.path.join(dimaPath, 'utils/exclude_path_keywords.yaml'), 'r') as stream:
|
||||
with open(os.path.join(dimaPath, 'dima/utils/exclude_path_keywords.yaml'), 'r') as stream:
|
||||
exclude_path_dict = yaml.safe_load(stream)
|
||||
if isinstance(exclude_path_dict, dict):
|
||||
exclude_path_keywords = exclude_path_dict.get('containing', [])
|
||||
exclude_path_keywords = exclude_path_dict.get('exclude_paths',{}).get('containing', [])
|
||||
if not all(isinstance(keyword, str) for keyword in exclude_path_keywords):
|
||||
exclude_path_keywords = []
|
||||
else:
|
||||
exclude_path_keywords = []
|
||||
except (FileNotFoundError, yaml.YAMLError) as e:
|
||||
print(f"Warning. Unable to load YAML file: {e}")
|
||||
exclude_path_keywords = []
|
||||
exclude_path_keywords = []
|
||||
|
||||
date = created_at('%Y_%m').replace(":", "-")
|
||||
log_dir='logs/'
|
||||
|
Reference in New Issue
Block a user