#!/usr/bin/env python 

import os
import sys

folder = sys.argv[1]

dirs = os.listdir(folder) 

def getFolderSize(folder):
	total_size = os.path.getsize(folder)
	if os.path.isfile(folder): 
		return total_size
	for item in os.listdir(folder):
		itempath = os.path.join(folder, item)
		#print itempath
		if os.path.isfile(itempath):
			total_size += os.path.getsize(itempath)
		elif os.path.isdir(itempath):
			total_size += getFolderSize(itempath)
	return total_size

total = getFolderSize(folder)
print("Total: " + str(total / (1024.0*1024.0*1024.0)) + " GB")
for d in dirs: 
	s = float(getFolderSize(os.path.join(folder, d)))
	print(d + " - " + str(round((s/total) * 100, 2)) + "%")
