Commit 136644fa authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Fix error in utils and remove useless function

parent 96f993f6
......@@ -14,7 +14,7 @@ def update_material(src: Path, dst: Path):
def get_file_list(path: Path, relative: bool = True, ignore: list = None):
"""Return a list of file paths relative to path"""
ignored = {[IGNORED]} | {ignore}
ignored = set([IGNORED]) | {ignore}
def get_path(obj):
"""return a relative or absolute path"""
......@@ -33,7 +33,7 @@ def update_dict(current: dict, new: dict):
"""Update current multi-level dict with new dict"""
for k, v in new.items():
if k in current and type(v) is dict:
# Update current entry by descending in sub dict
# Update current entry by descending into sub dict
update_dict(current[k], v)
else:
# Add new entry or update with new value
......@@ -48,11 +48,3 @@ def zip_files(zip_file_name: Path, paths_to_zip: list, refpath: Path = None,
# Convert refpath/file in arcdir/file if asked
arcpath = arcdir / path.relative_to(refpath) if refpath else None
zf.write(path, arcname=arcpath)
def clean_file(file):
"""Remove file ignoring errors"""
try:
os.remove(file)
except OSError:
pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment