Utilities/MimeTypes.py

changeset 4101
68c26f72c0d1
parent 4097
ad2a6bd965d9
child 4631
5c1a96925da4
diff -r 59a1b3356009 -r 68c26f72c0d1 Utilities/MimeTypes.py
--- a/Utilities/MimeTypes.py	Sat Feb 07 12:43:00 2015 +0100
+++ b/Utilities/MimeTypes.py	Sun Feb 08 13:09:00 2015 +0100
@@ -28,3 +28,13 @@
         return True
     else:
         return False
+
+
+def mimeType(filename):
+    """
+    Function to get the mime type of a file.
+    
+    @param filename name of the file to be checked (string)
+    @return mime type of the file (string)
+    """
+    return mimetypes.guess_type(filename)[0]

eric ide

mercurial