Skip to content

Commit 534c15d

Browse files
authored
Updated variable names
1 parent e2beedd commit 534c15d

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

Download_Sorter.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,43 @@
66
exeptions =['Download_Sorter.py']
77
for path in paths:
88
exeptions.append(path)
9-
109
for path in paths:
1110
if os.path.isdir(path)==False:
1211
os.mkdir(path)
1312

14-
vExtensions = ['.mp4','.MOV','.mpx','.mpeg','.flv','MP4','webm','mov']
15-
pExtensions = ['.jpeg','.jpg','.png','.PNG','.gif','.JPG','HEIC']
16-
cExtensions = ['.zip','.rar','.7z','.tgz','.gz','bz2']
17-
coExtensions = ['.cs','.py']
18-
eExtensions = ['.exe','.msi']
19-
dExtensions = ['.pdf','.docx','.doc','.rtf','.txt','RTF']
20-
prExtensions = ['.pptx','.ppsx','.ppt']
21-
aExtensions = ['.mp3','.flv','ogg']
22-
sExtensions = ['xlsx','xlsm','xlsb','xltx','xls']
13+
videoExtentions = ['.mp4','.MOV','.mpx','.mpeg','.flv','MP4','webm','mov']
14+
photoExtentions = ['.jpeg','.jpg','.png','.PNG','.gif','.JPG','HEIC','.webp']
15+
coppressedExtentions = ['.zip','.rar','.7z','.tgz','.gz','.bz2']
16+
codexeExtentions = ['.cs','.py','.html','.css']
17+
exeExtentions = ['.exe','.msi']
18+
docsExtentions = ['.pdf','.docx','.doc','.rtf','.txt','RTF']
19+
presentationExtentions = ['.pptx','.ppsx','.ppt']
20+
audioExtentions = ['.mp3','.flv','ogg']
21+
spreadsheetExtentions = ['xlsx','xlsm','xlsb','xltx','xls']
2322
everything = [x for x in os.listdir() if x not in exeptions]
2423
print(everything)
2524

2625
for file in everything:
27-
if any(c in file for c in vExtensions):
26+
if any(c in file for c in videoExtentions):
2827
fType = 'Videos'
29-
elif any(c in file for c in pExtensions):
28+
elif any(c in file for c in photoExtentions):
3029
fType = 'Photos'
31-
elif any(c in file for c in eExtensions):
30+
elif any(c in file for c in exeExtentions):
3231
fType = 'Executables'
33-
elif any(c in file for c in cExtensions):
32+
elif any(c in file for c in coppressedExtentions):
3433
fType = 'Compressed'
35-
elif any(c in file for c in dExtensions):
34+
elif any(c in file for c in docsExtentions):
3635
fType = 'Documents'
37-
elif any(c in file for c in prExtensions):
36+
elif any(c in file for c in presentationExtentions):
3837
fType = 'Presentations'
39-
elif any(c in file for c in aExtensions):
38+
elif any(c in file for c in audioExtentions):
4039
fType = 'Audio'
41-
elif any(c in file for c in coExtensions):
40+
elif any(c in file for c in codexeExtentions):
4241
fType = 'Code'
43-
elif any(c in file for c in sExtensions):
42+
elif any(c in file for c in spreadsheetExtentions):
4443
fType = 'Spreadsheets'
4544
else:
4645
fType = 'Other'
4746
print('moving - '+file+' - into '+fType)
48-
os.rename(file,fType+'/'+file)
47+
os.rename(file,f'{fType}/{file}')
4948
time.sleep(15)

0 commit comments

Comments
 (0)