max folder size

This commit is contained in:
ingvar1995
2016-10-02 20:19:39 +03:00
parent 862d6a170e
commit 3ea8c049c5
5 changed files with 34 additions and 7 deletions

View File

@@ -10,6 +10,15 @@ def curr_directory():
return os.path.dirname(os.path.realpath(__file__))
def folder_size(path):
size = 0
for f in os.listdir(path):
f = unicode(f)
if os.path.isfile(os.path.join(path, f)):
size += os.path.getsize(os.path.join(path, f))
return size
class Singleton(object):
def __new__(cls, *args, **kwargs):