Skip to content

Commit

Permalink
[#9] Replace spaces with dunders.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbcunc committed Mar 29, 2021
1 parent 4a3bbae commit 1192b1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions publish_netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def replace_spaces_in_names(path):
for root, dirs, files in walk:
for f in files:
if " " in f:
os.rename(os.path.join(root, f), os.path.join(root, f.replace(" ", "_")))
os.rename(os.path.join(root, f), os.path.join(root, f.replace(" ", "__")))
replaced += 1
for d in dirs:
if " " in d:
os.rename(os.path.join(root, d), os.path.join(root, d.replace(" ", "_")))
os.rename(os.path.join(root, d), os.path.join(root, d.replace(" ", "__")))
replaced += 1
if replaced:
logger.warning(f"Replaced {replaced} name{'s' if replaced != 1 else ''} " \
Expand Down

0 comments on commit 1192b1c

Please sign in to comment.