Skip to content

Commit

Permalink
Better filetype recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
mmshivesh committed Oct 18, 2018
1 parent 576c146 commit 8eb8ffa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,18 @@ def changeLocation():
def parseFileType(contenttype, window, fileGUIRowNumber):
contentList = contenttype.split('/')
# print(contentList)
fileTypetk = tkinter.StringVar(window, value=contentList[-1])
fileTypetk = tkinter.StringVar(window, value=contentList[0])
contentTypeLabel = tkinter.Label(window, textvariable=fileTypetk)
contentTypeLabel.grid(row=fileGUIRowNumber, column=1, columnspan=1, sticky=tkinter.E+tkinter.W)
if contentList[0]=='application':
contentTypeLabel.config(foreground="red")
fileTypetk.set(contentList[-1])
elif contentList[0] == 'video':
contentTypeLabel.config(foreground="blue")
fileTypetk.set(contentList[0])
elif contentList[0] == 'music':
contentTypeLabel.config(foreground="green")
fileTypetk.set(contentList[-1])
return contentTypeLabel

def terminateThread(thread, f, contentTypeLabel, fileNameLabel, progressBar, cancelButton):
Expand Down

0 comments on commit 8eb8ffa

Please sign in to comment.