diff options
author | Cristian García <cristian99garcia@gmail.com> | 2013-09-07 11:09:10 (GMT) |
---|---|---|
committer | Cristian García <cristian99garcia@gmail.com> | 2013-09-07 11:09:10 (GMT) |
commit | 09feb728b1a14b7bb362175b5fa26c444a59485e (patch) | |
tree | a62593b8148b6a659da0e9086558d8bf97ba4f76 | |
parent | 62f75268b04a10a0ce69bf917e57f689f5c79a41 (diff) |
Arreglando un pequenio bug, que causaba que cuando un archivo tiene un espacio, este no se habra
-rw-r--r-- | CristianEdit/CristianEdit.py | 1 | ||||
-rw-r--r-- | CristianEdit/Globales.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/CristianEdit/CristianEdit.py b/CristianEdit/CristianEdit.py index 28f4857..1e3d338 100644 --- a/CristianEdit/CristianEdit.py +++ b/CristianEdit/CristianEdit.py @@ -276,7 +276,6 @@ class CristianEdit(Gtk.Plug): if respuesta == Gtk.ResponseType.ACCEPT: for lugar in navegador.get_filenames(): if G.get_mime_type(lugar) and not lugar in direcciones: - self.abrir(direccion=lugar) navegador.destroy() diff --git a/CristianEdit/Globales.py b/CristianEdit/Globales.py index f51679c..7ec2ecb 100644 --- a/CristianEdit/Globales.py +++ b/CristianEdit/Globales.py @@ -67,7 +67,10 @@ def guardar_dato(cadena, dato, archivo): def get_mime_type(direccion, devolver=None): - tipo = commands.getoutput('file %s --mime-type' % direccion).split(' ')[1] + if ' ' in direccion: + direccion = direccion.replace(' ', '\ ') + + tipo = commands.getoutput('file %s --mime-type' % direccion).split(' ')[-1] if devolver: return tipo |