Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Archivos.py
diff options
context:
space:
mode:
authorCristian García <cristian99garcia@gmail.com>2013-04-20 16:02:58 (GMT)
committer Cristian García <cristian99garcia@gmail.com>2013-04-20 16:02:58 (GMT)
commitb585ea6aa2ff41550385172c2ea3d3ed8cfb8bc3 (patch)
treebba135e0e3501d8ff3b2b7da5dbbe866680ffa77 /Archivos.py
parent1ce0fa553ad6e13ae5b91fc8c3a6bf13148c62cd (diff)
Emprolijando
Diffstat (limited to 'Archivos.py')
-rw-r--r--Archivos.py44
1 files changed, 5 insertions, 39 deletions
diff --git a/Archivos.py b/Archivos.py
index 7ee49d5..14af21a 100644
--- a/Archivos.py
+++ b/Archivos.py
@@ -27,51 +27,17 @@ share = os.path.join(local, 'share')
trash = os.path.join(share, 'Trash')
PAPELERA = os.path.join(trash, 'files')
-programas_instalados = []
-direcciones_prgramas = []
-aplicaciones = '/usr/share/applications'
-if os.path.exists(aplicaciones) and os.path.isdir(aplicaciones):
- lista = os.listdir(aplicaciones)
- for x in lista:
- direccion = aplicaciones + '/' + x
- if os.path.isfile(direccion):
- texto = open(direccion).read()
-
- if 'MimeType' in texto or 'mime-type' in texto:
- programas_instalados.append(texto)
- direcciones_prgramas.append(direccion)
def intentar_abrir(direccion):
- """Por ahora no hace nada"""
-
- """
- tipo = commands.getoutput('file %s --mime-type -b' % direccion)
- tipo = tipo.split('/')[0]
-
- aplicaciones_utiles = []
-
- for x in programas_instalados:
- if tipo in x:
- aplicaciones_utiles.append(x)
-
- texto = aplicaciones_utiles[0]
-
- direccion = False
- for linea in texto.splitlines():
- if 'exec' in linea:
- if 'exec=' in linea:
- direccion = linea.split('exec=')
-
- if direccion:
- commands.getoutput(direcciones_prgramas[numero] + ' ' + direccion)
- break
-
- """
+ """Abre el archivo con el programa predeterminado"""
if ' ' in direccion:
direccion = direccion.replace(' ', '\ ')
- commands.getoutput('gnome-open %s' % direccion)
+ comando = commands.getoutput('gnome-open %s' % direccion)
+
+ return comando
+
def crear_papelera():
"""Crea los directorios de la papelera"""