Index: bk_manager/trunk/ui/MainWindow.py =================================================================== diff --git a/bk_manager/trunk/ui/MainWindow.py b/bk_manager/trunk/ui/MainWindow.py --- a/bk_manager/trunk/ui/MainWindow.py (revision 25) +++ b/bk_manager/trunk/ui/MainWindow.py (revision 26) @@ -11,22 +11,26 @@ from subprocess import * import sys import os -#import subprocess +import subprocess import commands class MainWindow(QMainWindow, Ui_MainWindow): """ Class documentation goes here. """ + def __init__(self, parent = None): QMainWindow.__init__(self, parent) self.setupUi(self) self.setupUi2() + #sys.stdout = obj + def setupUi2(self): - print 'hi' self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS') self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba1_jro_backup_manager') + self.txtElabel.setText('EW_DRIFTS') + @pyqtSignature("") def on_btnDpath_clicked(self): @@ -37,6 +41,7 @@ self.txtDpath.setText(var_Dpath) self.on_txtDpath_editingFinished() + @pyqtSignature("") def on_btnRpath_clicked(self): """ @@ -50,7 +55,7 @@ @pyqtSignature("") def on_txtDpath_editingFinished(self): - #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo) + #Usando el modulo "subprocess", eric4 pide seleccion del tipo de subproceso (padre o hijo) #por ello se prefiere usar el modulo "commands" #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE) #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE) @@ -72,7 +77,7 @@ output_p2=commands.getstatusoutput(var_cmd)[1] #INFO: Muestra los dias que se encontraron - self.txtInfo.setText(output_p2) + self.txtInfo.append(output_p2) #Se cargan las listas para seleccionar StartDay y StopDay self.var_list=[] @@ -89,7 +94,7 @@ self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) #INFO: Muestra cuantos dias se encontraron -# self.txtInfo.setText(str(self.lstStartDay.count())) + #self.txtInfo.setText(str(self.lstStartDay.count())) @pyqtSignature("") @@ -98,14 +103,15 @@ Slot documentation goes here. """ var_Rpath=self.txtRpath.text() + #Se verifica que la ruta exista y sea un directorio var_cmd="test -d "+str(var_Rpath) var_output=commands.getstatusoutput(var_cmd)[0] if var_output != 0: - self.txtInfo.setText("Ruta no valida, output_error:" + str(var_output)) + self.txtInfo.append("Ruta no valida, output_error:" + str(var_output)) return else: - self.txtInfo.setText("Ruta valida, sin error") + self.txtInfo.append("Ruta valida, sin error") @pyqtSignature("int") @@ -128,6 +134,7 @@ self.txtDtype.setText('') self.txtDtype.setReadOnly(False) + @pyqtSignature("") def on_txtDtype_editingFinished(self): """ @@ -135,44 +142,37 @@ """ self.on_txtDpath_editingFinished() - @pyqtSignature("int") + + @pyqtSignature("int") #CLOSED def on_lstStartDay_activated(self, index): """ - Slot documentation goes here. - """ - #self.txtInfo.setText(str(index)) + Cambia la lista de opciones en lstStopDay + """ var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() - self.lstStopDay.clear() for i in self.var_list[index:]: self.lstStopDay.addItem(i) self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) - #self.txtInfo.append(str(var_StopDay_index)) - #self.txtInfo.append(str(self.lstStopDay.count())) - - - @pyqtSignature("int") - def on_lstStopDay_activated(self, index): - """ - Slot documentation goes here. - """ - #self.txtInfo.setText(str(index)) + + + @pyqtSignature("int") #CLOSED + def on_lstStopDay_activated(self, index): + """ + Cambia la lista de opciones en lstStartDay + """ var_StartDay_index=self.lstStartDay.currentIndex() - var_end_index = self.lstStopDay.count() - index - self.lstStartDay.clear() for i in self.var_list[:len(self.var_list) - var_end_index + 1]: self.lstStartDay.addItem(i) self.lstStartDay.setCurrentIndex(var_StartDay_index) - #self.txtInfo.append(str(var_StartDay_index)) - #self.txtInfo.append(str(self.lstStartDay.count())) - - @pyqtSignature("int") + + + @pyqtSignature("int") #CLOSED def on_lstDcapacity_activated(self, index): """ Permite elegir el tamaƱo del disco @@ -192,6 +192,7 @@ else: self.txtDcapacity.setText('') self.txtDcapacity.setReadOnly(False) + @pyqtSignature("") def on_btnGbkp_clicked(self): @@ -242,7 +243,8 @@ #lista de archivos a grabar en archivos . #Ruta de los archivos a grabar - var_Rpath_ppath=var_Rpath=self.txtRpath.text()+"/ppath" + var_Rpath=self.txtRpath.text() + var_Rpath_ppath=var_Rpath+"/ppath" var_Dpath=self.txtDpath.text() var_n=0 @@ -287,3 +289,42 @@ var_n_files += len(var_files_list_2) self.txtInfo.append(str(var_n_files)) + self.tabParameters.setEnabled(False) + + + @pyqtSignature("") + def on_btnStartburn_clicked(self): + """ + Slot documentation goes here. + """ + var_Rpath=self.txtRpath.text() + var_Rpath_ppath=var_Rpath+"/ppath" + var_Rpath_iso=var_Rpath+"/iso" + + var_label=self.txtElabel.text() + + file_iso=var_Rpath_iso+'/2.iso' + file_dat=var_Rpath_ppath+'/EW_DRIFTS_1.dat' + + var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' + var_cmd += ' -A '+var_label+' -V '+var_label + var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso + self.txtInfo.append(var_cmd) + + #var_output=commands.getstatusoutput(str(var_cmd))[1] + #self.txtInfo.append(var_output) + + #os.system(str(var_cmd)) + p = subprocess.Popen(str(var_cmd), shell=True) + #os.waitpid(p.pid, 0) + self.txtInfo.append(str(p.pid)) + + #timer.time = 10 + #timer.init() + + @pyqtSignature("") + def on_btnRestart_clicked(self): + """ + Slot documentation goes here. + """ + self.tabParameters.setEnabled(True) Index: bk_manager/trunk/ui/Ui_MainWindow.py =================================================================== diff --git a/bk_manager/trunk/ui/Ui_MainWindow.py b/bk_manager/trunk/ui/Ui_MainWindow.py --- a/bk_manager/trunk/ui/Ui_MainWindow.py (revision 25) +++ b/bk_manager/trunk/ui/Ui_MainWindow.py (revision 26) @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file '/home/ricardoar/principal/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' # -# Created: Tue Apr 27 11:22:25 2010 +# Created: Tue Apr 27 17:26:12 2010 # by: PyQt4 UI code generator 4.7.2 # # WARNING! All changes made in this file will be lost!