From 8eb8ffa373d1677a862446985abd099e65977d95 Mon Sep 17 00:00:00 2001 From: the_lucifer Date: Thu, 18 Oct 2018 21:06:48 +0530 Subject: [PATCH] Better filetype recognition --- GUI.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GUI.py b/GUI.py index 8312501..4eb0e6c 100644 --- a/GUI.py +++ b/GUI.py @@ -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):