1
1
import shutil
2
2
import os
3
3
from time import sleep
4
- from fileExtensions import commonFileTypes
5
4
import customtkinter as ctk
5
+ from fileExtensions import commonFileTypes
6
6
from tkinter import filedialog
7
7
from tkinter import messagebox
8
8
9
+
9
10
ctk .set_appearance_mode ("dark" )
10
11
ctk .set_default_color_theme ("dark-blue" )
11
12
window = ctk .CTk ()
@@ -18,7 +19,7 @@ def createFolder(parent_dir):
18
19
global dir_list
19
20
dir_list = os .listdir (parent_dir )
20
21
for fileTypes in dir_list :
21
- fileExt = fileTypes .split ("." )[- 1 ]
22
+ fileExt = fileTypes .split ("." )[- 1 ]. lower ()
22
23
if (
23
24
fileExt .lower () in commonFileTypes
24
25
and os .path .exists (parent_dir + "/" + commonFileTypes [fileExt ]) == False
@@ -28,7 +29,7 @@ def createFolder(parent_dir):
28
29
29
30
def sortFiles (parent_dir ):
30
31
for fileTypes in dir_list :
31
- fileExt = fileTypes .split ("." )[- 1 ]
32
+ fileExt = fileTypes .split ("." )[- 1 ]. lower ()
32
33
if fileExt .lower () in commonFileTypes :
33
34
shutil .move (
34
35
f"{ parent_dir } /{ fileTypes } " ,
@@ -47,7 +48,7 @@ def sortButton():
47
48
else :
48
49
messagebox .showwarning (
49
50
"Something's wrong" ,
50
- "I can feel it. It was an error, you didn't specify a path. " ,
51
+ "I can feel it. It was an error, you didn't specify a path" ,
51
52
)
52
53
53
54
0 commit comments