# SVN changeset patch # User ralonso # Date 2010-05-19 17:28:04.950774 # Revision 63 crea .iso, expulsa unidades y graba #Falta descomentar : #expulsion DVDs #ejecucion de las ordenes Index: bk_manager/trunk/functions/functions2.py =================================================================== diff --git a/bk_manager/trunk/functions/functions2.py b/bk_manager/trunk/functions/functions2.py --- a/bk_manager/trunk/functions/functions2.py (revision 62) +++ b/bk_manager/trunk/functions/functions2.py (revision 63) @@ -49,6 +49,12 @@ self.chkDevD.setChecked(False) self.chkDevD.setEnabled(False) +#----------------------------------- expulsa los dispositivos de grabacion -------------------------------------------- + +def eject_devices(self): + for var_dev in self.var_devices: + var_cmd = 'eject ' + var_dev + commands.getstatusoutput(var_cmd) #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- 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 62) +++ b/bk_manager/trunk/ui/MainWindow.py (revision 63) @@ -44,6 +44,7 @@ self.var_step = 0 self.bool_state_burning = False + self.blank_discs = False #Revisa si existe el archivo de confirguracion @@ -263,7 +264,8 @@ self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat functions.make_files_print(self) # Se crean los archivos .print functions2.make_parameters_conf(self) # se crea el archivo parameters.conf - + self.txtInfo.append("Numero de archivos .iso a grabar: "+str(self.var_Discs)) + self.txtInfo.append("Numero de DVDs totales a grabar: "+str(self.var_Discs * self.var_Copys)) #Se bloquean los parametros de configuracion functions2.enabled_items1(True, self) @@ -287,6 +289,11 @@ """ Se inicia el proceso de grabacion """ + + if self.blank_discs == True: + self.btnStartburn.setEnabled(False) + self.burning() + return #Verifica que exista algun dispositivo de grabacion seleccionado if not(functions2.selected_devices(self)): @@ -302,6 +309,7 @@ self.var_copy_n = 0 self.var_step = 0 self.bool_state_burning = True + self.blank_discs = False functions2.enabled_items2(True, self) self.burning() @@ -313,14 +321,20 @@ #Creacion del archivo.iso para la grabacion if self.var_step == 0: - - self.var_disc_n += 1 # numero de disco actual para grabacion - self.var_copy_n = 0 + #borra la imagen.iso del numero de disco anterior + if self.var_disc_n > 0: + file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" +# os.remove(file_iso) + + self.var_disc_n += 1 # aumenta numero de disco actual para grabacion + self.var_copy_n = 0 # Resetea el numero actual de la copia #Si ya se grabaron todos los discos if self.var_disc_n > self.var_Discs: self.bool_state_burning = False self.txtInfo.append("GRABACION TERMINADA") +# functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion + return self.txtInfo.append("########## DISCO NUMERO: "+str(self.var_disc_n)+"##########") @@ -337,24 +351,30 @@ #Grabacion de los DVDs elif self.var_step == 1: self.var_copy_n += 1 # numero de copia actual + var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) ) % len(self.var_devices) + + if var_index == 0 and self.blank_discs == False: + self.txtInfo.append("EXPULSANDO BANDEJAS") + self.var_copy_n -= 1 #El numero de copia se regresa al estado anterior +# functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion + self.blank_discs = True + self.btnStartburn.setText("Continue") + self.btnStartburn.setEnabled(True) + return + + self.blank_discs = False + self.txtInfo.append("Grabando la copia numero: "+str(self.var_copy_n)) - #Si esta es la ultima copia se pasara al siguiente disco en la siguiente llamada a la funcion if self.var_copy_n == self.var_Copys: self.var_step = 0 - var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) ) % len(self.var_devices) - - if var_index == 0: - self.txtInfo.append("EXPULSANDO BANDEJAS") - var_dev_tmp = self.var_devices[var_index] file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso - self.var_process.start('ls') - self.txtInfo.append(var_cmd) + self.txtInfo.append("CMD: "+var_cmd) # self.txtInfo.append("creando iso") # self.var_process.start(var_cmd) @@ -370,10 +390,10 @@ self.bool_state_burning = False self.var_process.terminate() #Termina el proceso, si puede # self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona - self.txtInfo.append("SE DETUVO LA GRABACION MANUALMENTE") - functions2.enabled_items2(False, self) - + functions2.enabled_items2(False, self) + self.btnStartburn.setText("Start Burn") + #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- Index: bk_manager/trunk/ui/MainWindow.ui =================================================================== diff --git a/bk_manager/trunk/ui/MainWindow.ui b/bk_manager/trunk/ui/MainWindow.ui --- a/bk_manager/trunk/ui/MainWindow.ui (revision 62) +++ b/bk_manager/trunk/ui/MainWindow.ui (revision 63) @@ -836,7 +836,7 @@ 0 0 809 - 21 + 25 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 62) +++ b/bk_manager/trunk/ui/Ui_MainWindow.py (revision 63) @@ -2,8 +2,8 @@ # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' # -# Created: Wed May 19 01:44:24 2010 -# by: PyQt4 UI code generator 4.7.2 +# Created: Wed May 19 11:22:43 2010 +# by: PyQt4 UI code generator 4.6 # # WARNING! All changes made in this file will be lost! @@ -234,7 +234,6 @@ self.verticalLayout_19 = QtGui.QVBoxLayout() self.verticalLayout_19.setObjectName("verticalLayout_19") self.label_2 = QtGui.QLabel(self.tabDconfig) - self.label_2.setText("") self.label_2.setObjectName("label_2") self.verticalLayout_19.addWidget(self.label_2) self.lblDevice = QtGui.QLabel(self.tabDconfig) @@ -247,7 +246,6 @@ self.lblBmode.setObjectName("lblBmode") self.verticalLayout_19.addWidget(self.lblBmode) self.label = QtGui.QLabel(self.tabDconfig) - self.label.setText("") self.label.setObjectName("label") self.verticalLayout_19.addWidget(self.label) self.gridLayout.addLayout(self.verticalLayout_19, 0, 4, 1, 1) @@ -453,7 +451,7 @@ self.verticalLayout.addLayout(self.horizontalLayout_2) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 809, 21)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 809, 25)) self.menubar.setObjectName("menubar") self.menuParameters = QtGui.QMenu(self.menubar) self.menuParameters.setObjectName("menuParameters")