Skip to content

Commit

Permalink
Merge pull request #10 from hydroshare/develop
Browse files Browse the repository at this point in the history
[#9] Replace spaces with dunders.
  • Loading branch information
cbcunc authored Mar 29, 2021
2 parents ffc628e + 1192b1c commit 4efd205
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 4efd205

Please sign in to comment.