diff options
author | Cristian García <cristian@cristian.(none)> | 2013-04-14 14:22:24 (GMT) |
---|---|---|
committer | Cristian García <cristian@cristian.(none)> | 2013-04-14 14:22:24 (GMT) |
commit | 8864887abc27e50b5b4955949ba3068461fccc01 (patch) | |
tree | c0f930fb6d43b963b213ee14a0f79efc8cf938c2 | |
parent | 8d99ccbc8d644bde3a7cd20a86162cf76eda47a1 (diff) |
Agregando para que se actualize la informacion en la parte inferior de la pantalla cuando se cambia el archivo o carpeta seleccionado
-rw-r--r-- | Archivos.py | 46 | ||||
-rw-r--r-- | Archivos.pyc | bin | 16335 -> 17703 bytes | |||
-rw-r--r-- | Widgets.py | 39 | ||||
-rw-r--r-- | Widgets.pyc | bin | 12223 -> 12469 bytes |
4 files changed, 62 insertions, 23 deletions
diff --git a/Archivos.py b/Archivos.py index 27fa096..7ee49d5 100644 --- a/Archivos.py +++ b/Archivos.py @@ -139,6 +139,52 @@ def get_tamanio(direccion): return string +def get_carpetas_del_usuario(): + + escritorio = '' + descargas = '' + plantillas = '' + publico = '' + documentos = '' + musica = '' + imagenes = '' + videos = '' + + archivo = os.path.expanduser('~/.config/user-dirs.dirs') + if os.path.exists(archivo): + texto = open(archivo).read() + + for linea in texto.splitlines(): + if 'DESKTOP' in linea: + escritorio = linea.split('XDG_DESKTOP_DIR="$HOME/')[1] + escritorio = os.path.join(os.path.expanduser('~'), escritorio) + + elif 'DOWNLOAD' in linea: + descargas = linea.split('XDG_DOWNLOAD_DIR="$HOME/')[1] + descargas = os.path.join(os.path.expanduser('~'), descargas) + + elif 'TEMPLATES' in linea: + plantillas = linea.split('XDG_TEMPLATES_DIR="$HOME/')[1] + plantillas = os.path.join(os.path.expanduser('~'), plantillas) + + elif 'PUBLICSHARE' in linea: + publico = linea.split('XDG_PUBLICSHARE_DIR="$HOME/')[1] + publico = os.path.join(os.path.expanduser('~'), publico) + + elif 'DOCUMENTS' in linea: + documentos = linea.split('XDG_DOCUMENTS_DIR="$HOME/')[1] + documentos = os.path.join(os.path.expanduser('~'), documentos) + + elif 'MUSIC' in linea: + musica = linea.split('XDG_MUSIC_DIR="$HOME/')[1] + musica = os.path.join(os.path.expanduser('~'), musica) + + elif 'VIDEOS' in linea: + videos = linea.split('XDG_VIDEOS_DIR="$HOME/')[1] + videos = os.path.join(os.path.expanduser('~'), videos) + + return escritorio, descargas, plantillas, publico, documentos, musica, imagenes, videos + def get_permisos(direccion): """Obtiene una dirección, y devuelve sí tiene permisos de lectura, escritura y ejecucución""" diff --git a/Archivos.pyc b/Archivos.pyc Binary files differindex f843a72..e4d6f3c 100644 --- a/Archivos.pyc +++ b/Archivos.pyc @@ -169,18 +169,23 @@ class Area(Gtk.IconView): def changed(self, *args): - pass - """ - if os.path.isfile(direccion): - tamanio = Archivos.get_tamanio(direccion) - string = ' - ' + tamanio + if self.get_selected_items(): - elif os.path.isdir(direccion) or os.path.ismount(direccion): - archivos = Archivos.get_tamanio(direccion) - string = ' - ' + archivos + direccion = self.padre.direccion + path = self.get_selected_items()[0] + iter = self.modelo.get_iter(path) + direccion = os.path.join(direccion, self.modelo.get_value(iter, 0)) + lectura, escritura, ejecucion = Archivos.get_permisos(direccion) + + if os.path.isfile(direccion): + tamanio = Archivos.get_tamanio(direccion) + string = ' - ' + tamanio - self.padre.b_estado.set_text('Se ha seleccionado: ', direccion, string) - """ + elif os.path.isdir(direccion) or os.path.ismount(direccion): + archivos = Archivos.get_tamanio(direccion) + string = ' - ' + archivos + + self.padre.b_estado.set_text('Se ha seleccionado: ', direccion, string) def agregar(self, nombre, direccion): """Agrega el icono de una carpeta o un archivo""" @@ -221,19 +226,7 @@ class Area(Gtk.IconView): iter = self.modelo.get_iter(path) direccion += self.modelo.get_value(iter, 0) - if boton == 1: - if os.path.isfile(direccion): - tamanio = Archivos.get_tamanio(direccion) - string = ' - ' + tamanio - - elif os.path.isdir(direccion) or os.path.ismount(direccion): - archivos = Archivos.get_tamanio(direccion) - string = ' - ' + archivos - - self.padre.b_estado.set_text('Se ha seleccionado: ', - direccion, string) - - elif boton == 3: + if boton == 3: self.crear_menu_emergente(boton, tiempo, path) return True diff --git a/Widgets.pyc b/Widgets.pyc Binary files differindex e75ec20..29d379c 100644 --- a/Widgets.pyc +++ b/Widgets.pyc |