Skip to content

Commit

Permalink
add calculate disk space
Browse files Browse the repository at this point in the history
  • Loading branch information
laszewsk committed Dec 23, 2023
1 parent 010dc67 commit 88a5377
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/cloudmesh/common/Shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,15 @@ def live(cls, command, cwd=None):
})
return data

@staticmethod
def calculate_disk_space(directory):
total_size = 0
for path, dirs, files in os.walk(directory):
for f in files:
fp = os.path.join(path, f)
total_size += os.path.getsize(fp)
return total_size

@classmethod
def get_python(cls):
"""returns the python and pip version
Expand Down

0 comments on commit 88a5377

Please sign in to comment.