diff options
author | Cristian Garcia <cristian99garcia@gmail.com> | 2013-05-24 18:10:42 (GMT) |
---|---|---|
committer | Cristian Garcia <cristian99garcia@gmail.com> | 2013-05-24 18:10:42 (GMT) |
commit | f9c75f9e1fc130d8f23574b6e95027d25096c1d6 (patch) | |
tree | 00118800e3c638dbbdd17f19286bc4da0794ac0a /CristianEdit/Globales.py | |
parent | 800de54000652158959b8055fe034a22edb2a554 (diff) |
Arreglando bugs
Diffstat (limited to 'CristianEdit/Globales.py')
-rw-r--r-- | CristianEdit/Globales.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CristianEdit/Globales.py b/CristianEdit/Globales.py index c56f66f..edef445 100644 --- a/CristianEdit/Globales.py +++ b/CristianEdit/Globales.py @@ -5,6 +5,7 @@ # Cristian GarcĂa <cristian99garcia@gmail.com> import os +import commands from gi.repository import Gtk from gi.repository import GtkSource @@ -67,3 +68,12 @@ def guardar_dato(cadena, dato, archivo): else: archivo.set('datos', cadena, '') + +def get_mime_type(direccion): + + tipo = commands.getoutput('file %s --mime-type' % direccion).split(' ') + if 'x-empty' in tipo or 'text' in tipo: + return True + + return None + |