Skip to content

Commit 29b57a6

Browse files
dmdsiawyoung
authored andcommitted
allow levels==0 to work (#3)
output was not defined before the levels==0 section (I guess nobody tested it when it was added...)
1 parent bc333ec commit 29b57a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dropbox_folder_size.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# If you just want to know overall usage of account (i.e. levels = 0), we will run a separate query for it
1111
levels = 2
1212

13+
output = open('dropbox_folder_sizes.txt', 'w')
14+
1315
if (levels == 0):
1416
quota_info = client.account_info()['quota_info']
1517
usage = quota_info['shared'] / (1024.0 ** denomination)
@@ -49,8 +51,6 @@
4951
else:
5052
del foldersizes[path]
5153

52-
output = open('dropbox_folder_sizes.txt', 'w')
53-
5454
output.write('Below is a list of your largest Dropbox folders, ordered from largest to smallest. You chose a drill level of 2. Sizes are expressed as "%d", where 0 is in bytes, 1 is in KB, 2 is in MB, and 3 is in GB. \n' % denomination)
5555

5656
for folder in reversed(sorted(foldersizes.keys(), key=lambda x: foldersizes[x])):

0 commit comments

Comments
 (0)