|
@@
-39,6
+39,7
|
|
39
|
self.var_Copys = 0 #Numero de copias
|
|
39
|
self.var_Copys = 0 #Numero de copias
|
|
40
|
self.var_disc_n = 0
|
|
40
|
self.var_disc_n = 0
|
|
41
|
self.var_copy_n = 0
|
|
41
|
self.var_copy_n = 0
|
|
|
|
|
42
|
self.var_burned_discs = 0
|
|
42
|
|
|
43
|
|
|
43
|
self.var_list=[]
|
|
44
|
self.var_list=[]
|
|
44
|
self.var_sublist=[]
|
|
45
|
self.var_sublist=[]
|
|
@@
-52,8
+53,8
|
|
52
|
|
|
53
|
|
|
53
|
#Revisa si existe el archivo de confirguracion
|
|
54
|
#Revisa si existe el archivo de confirguracion
|
|
54
|
if os.path.isfile("parameters.conf"):
|
|
55
|
if os.path.isfile("parameters.conf"):
|
|
|
|
|
56
|
functions2.get_parameters_conf(self)
|
|
55
|
self.txtInfo.append("Parameters were loaded from configuration file")
|
|
57
|
self.txtInfo.append("Parameters were loaded from configuration file")
|
|
56
|
functions2.get_parameters_conf(self)
|
|
|
|
|
57
|
self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
|
|
58
|
self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
|
|
58
|
|
|
59
|
|
|
59
|
else:
|
|
60
|
else:
|
|
@@
-68,7
+69,18
|
|
68
|
|
|
69
|
|
|
69
|
if os.path.isfile("parameters.conf"):
|
|
70
|
if os.path.isfile("parameters.conf"):
|
|
70
|
functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion
|
|
71
|
functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion
|
|
71
|
|
|
72
|
|
|
|
|
|
73
|
if os.path.isfile("burning.conf"):
|
|
|
|
|
74
|
functions2.get_burning_conf(self)
|
|
|
|
|
75
|
self.txtInfo.append("Current disc: "+str(self.var_disc_n))
|
|
|
|
|
76
|
self.txtInfo.append("Current copy: "+str(self.var_copy_n))
|
|
|
|
|
77
|
self.btnStartburn.setText("Continue")
|
|
|
|
|
78
|
|
|
|
|
|
79
|
self.txtDeviceA.setText("/dev/scd0")
|
|
|
|
|
80
|
self.txtDeviceB.setText("/dev/scd1")
|
|
|
|
|
81
|
self.txtDeviceC.setText("/dev/scd2")
|
|
|
|
|
82
|
self.txtDeviceD.setText("/dev/scd3")
|
|
|
|
|
83
|
|
|
72
|
self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
|
|
84
|
self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
|
|
73
|
self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
|
|
85
|
self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
|
|
74
|
|
|
86
|
|
|
@@
-111,11
+123,22
|
|
111
|
self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
|
|
123
|
self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
|
|
112
|
|
|
124
|
|
|
113
|
def readError(self):
|
|
125
|
def readError(self):
|
|
114
|
self.txtInfo.setText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
|
|
126
|
self.txtInfo.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
|
|
115
|
|
|
127
|
|
|
116
|
def finished(self):
|
|
128
|
def finished(self):
|
|
117
|
self.txtInfo.append("proceso terminado finished() "+QtCore.QString(self.var_process.exitCode())+"\n")
|
|
129
|
self.txtInfo.insertPlainText("process completed"+QtCore.QString(self.var_process.exitCode())+"\n")
|
|
118
|
if self.var_disc_n <= self.var_Discs and self.bool_state_burning:
|
|
130
|
|
|
|
|
|
131
|
|
|
|
|
|
132
|
if self.var_process.exitCode() != 0:
|
|
|
|
|
133
|
self.txtInfo.append("ERROR")
|
|
|
|
|
134
|
|
|
|
|
|
135
|
if self.bool_state_burning:
|
|
|
|
|
136
|
if self.var_step == 0:
|
|
|
|
|
137
|
self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada
|
|
|
|
|
138
|
|
|
|
|
|
139
|
elif self.var_step == 1:
|
|
|
|
|
140
|
self.var_copy_n += 1
|
|
|
|
|
141
|
|
|
119
|
self.burning()
|
|
142
|
self.burning()
|
|
120
|
|
|
143
|
|
|
121
|
|
|
144
|
|
|
@@
-128,7
+151,7
|
|
128
|
self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError()))
|
|
151
|
self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError()))
|
|
129
|
|
|
152
|
|
|
130
|
def finished_check(self):
|
|
153
|
def finished_check(self):
|
|
131
|
self.txtInfo.append("proceso terminado finished() check"+QtCore.QString(self.var_process_check.exitCode())+"\n")
|
|
154
|
self.txtInfo.append("check process completed "+QtCore.QString(self.var_process_check.exitCode())+"\n")
|
|
132
|
|
|
155
|
|
|
133
|
|
|
156
|
|
|
134
|
#----------------------------------------------------- Obtencion de la ruta de los datos ---------------------------------------------------------------
|
|
157
|
#----------------------------------------------------- Obtencion de la ruta de los datos ---------------------------------------------------------------
|
|
@@
-323,8
+346,14
|
|
323
|
"""
|
|
346
|
"""
|
|
324
|
Permite que se puedan cambiar los parametros
|
|
347
|
Permite que se puedan cambiar los parametros
|
|
325
|
"""
|
|
348
|
"""
|
|
|
|
|
349
|
if os.path.isfile("parameters.conf"):
|
|
|
|
|
350
|
os.remove("parameters.conf")
|
|
|
|
|
351
|
if os.path.isfile("burning.conf"):
|
|
|
|
|
352
|
os.remove("burning.conf")
|
|
|
|
|
353
|
|
|
326
|
functions2.enabled_items1(False, self)
|
|
354
|
functions2.enabled_items1(False, self)
|
|
327
|
os.remove("parameters.conf")
|
|
355
|
self.btnStartburn.setText("Start Burn")
|
|
|
|
|
356
|
|
|
328
|
|
|
357
|
|
|
329
|
|
|
358
|
|
|
330
|
#----------------------------------------------------- Iniciar proceso de grabacion ---------------------------------------------------------------
|
|
359
|
#----------------------------------------------------- Iniciar proceso de grabacion ---------------------------------------------------------------
|
|
@@
-334,74
+363,82
|
|
334
|
"""
|
|
363
|
"""
|
|
335
|
Se inicia el proceso de grabacion
|
|
364
|
Se inicia el proceso de grabacion
|
|
336
|
"""
|
|
365
|
"""
|
|
337
|
|
|
366
|
self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
|
|
|
|
|
367
|
#Verifica que exista algun dispositivo de grabacion seleccionado
|
|
|
|
|
368
|
if not(functions2.selected_devices(self)):
|
|
|
|
|
369
|
self.txtInfo.append("There is no recording device selected")
|
|
|
|
|
370
|
return
|
|
|
|
|
371
|
|
|
|
|
|
372
|
# #Lista los dispositivos de grabacion a usar
|
|
|
|
|
373
|
# for dev in self.var_devices:
|
|
|
|
|
374
|
# self.txtInfo.append("recording device :"+dev)
|
|
|
|
|
375
|
|
|
|
|
|
376
|
#Si se ingresaron los DVDs en blanco
|
|
338
|
if self.blank_discs == True:
|
|
377
|
if self.blank_discs == True:
|
|
339
|
self.btnStartburn.setEnabled(False)
|
|
378
|
self.btnStartburn.setEnabled(False)
|
|
340
|
self.burning()
|
|
379
|
self.burning()
|
|
341
|
return
|
|
380
|
return
|
|
342
|
|
|
381
|
|
|
343
|
#Verifica que exista algun dispositivo de grabacion seleccionado
|
|
382
|
#Si se cargo los parametros de burning.conf
|
|
344
|
if not(functions2.selected_devices(self)):
|
|
383
|
if self.var_burned_discs != 0:
|
|
345
|
self.txtInfo.append("There is no recording device selected")
|
|
384
|
self.txtInfo.append("BURNED DISC: "+str(self.var_burned_discs))
|
|
|
|
|
385
|
self.var_step = 0
|
|
|
|
|
386
|
self.bool_state_burning = True
|
|
|
|
|
387
|
self.blank_discs = False
|
|
|
|
|
388
|
functions2.enabled_items2(True, self)
|
|
|
|
|
389
|
self.burning()
|
|
346
|
return
|
|
390
|
return
|
|
347
|
|
|
|
|
|
348
|
#Lista los dispositivos de grabacion a usar
|
|
|
|
|
349
|
for dev in self.var_devices:
|
|
|
|
|
350
|
self.txtInfo.append("recording device :"+dev)
|
|
|
|
|
351
|
|
|
391
|
|
|
352
|
#Asigna las variables con los valores iniciales
|
|
392
|
#Asigna las variables con los valores iniciales
|
|
353
|
self.var_disc_n = 0 # numero de disco actual para grabacion
|
|
393
|
self.var_disc_n = 1 # numero de disco actual para grabacion
|
|
354
|
self.var_copy_n = 0
|
|
394
|
self.var_copy_n = 1
|
|
|
|
|
395
|
self.var_burned_discs = 0 #numero de discos grabados
|
|
355
|
self.var_step = 0
|
|
396
|
self.var_step = 0
|
|
356
|
self.bool_state_burning = True
|
|
397
|
self.bool_state_burning = True
|
|
357
|
self.blank_discs = False
|
|
398
|
self.blank_discs = False
|
|
358
|
|
|
|
|
|
359
|
functions2.enabled_items2(True, self)
|
|
399
|
functions2.enabled_items2(True, self)
|
|
360
|
self.burning()
|
|
400
|
self.burning()
|
|
361
|
|
|
401
|
|
|
|
|
|
402
|
|
|
362
|
def burning(self):
|
|
403
|
def burning(self):
|
|
363
|
|
|
404
|
|
|
364
|
var_Rpath_ppath=self.var_Rpath+"/ppath"
|
|
405
|
var_Rpath_ppath=self.var_Rpath+"/ppath"
|
|
365
|
var_Rpath_iso=self.var_Rpath+"/iso"
|
|
406
|
var_Rpath_iso=self.var_Rpath+"/iso"
|
|
|
|
|
407
|
|
|
|
|
|
408
|
#Si ya se grabaron todas las copias del disco
|
|
|
|
|
409
|
if self.var_copy_n > self.var_Copys:
|
|
|
|
|
410
|
#borra la imagen.iso del numero de disco anterior
|
|
|
|
|
411
|
file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
|
|
|
|
|
412
|
self.txtInfo.append("Deleting iso file")
|
|
|
|
|
413
|
# os.remove(file_iso)
|
|
|
|
|
414
|
self.var_copy_n = 1
|
|
|
|
|
415
|
self.var_disc_n += 1 # aumenta numero de disco actual para grabacion
|
|
|
|
|
416
|
self.var_step = 0
|
|
|
|
|
417
|
|
|
|
|
|
418
|
#Si ya se grabaron todos los discos
|
|
|
|
|
419
|
if self.var_disc_n > self.var_Discs:
|
|
|
|
|
420
|
self.bool_state_burning = False
|
|
|
|
|
421
|
self.txtInfo.append("Recording process is complete")
|
|
|
|
|
422
|
functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
|
|
|
|
|
423
|
return
|
|
|
|
|
424
|
|
|
|
|
|
425
|
self.txtInfo.append("\n"+str(self.var_disc_n)+" "+str(self.var_copy_n)+" "+str(self.var_step))
|
|
366
|
|
|
426
|
|
|
367
|
#Creacion del archivo.iso para la grabacion
|
|
427
|
#Creacion del archivo.iso para la grabacion
|
|
368
|
if self.var_step == 0:
|
|
428
|
if self.var_step == 0:
|
|
369
|
#borra la imagen.iso del numero de disco anterior
|
|
429
|
self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
|
|
370
|
if self.var_disc_n > 0:
|
|
430
|
self.txtInfo.append("---------Creating iso file number: "+str(self.var_disc_n))
|
|
371
|
file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
|
|
431
|
var_cmd = functions.cmd_iso(self)
|
|
372
|
# os.remove(file_iso)
|
|
|
|
|
373
|
|
|
|
|
|
374
|
self.var_disc_n += 1 # aumenta numero de disco actual para grabacion
|
|
|
|
|
375
|
self.var_copy_n = 0 # Resetea el numero actual de la copia
|
|
|
|
|
376
|
|
|
|
|
|
377
|
#Si ya se grabaron todos los discos
|
|
|
|
|
378
|
if self.var_disc_n > self.var_Discs:
|
|
|
|
|
379
|
self.bool_state_burning = False
|
|
|
|
|
380
|
self.txtInfo.append("Recording process is complete")
|
|
|
|
|
381
|
# functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
|
|
|
|
|
382
|
|
|
|
|
|
383
|
return
|
|
|
|
|
384
|
|
|
|
|
|
385
|
self.txtInfo.append("########## DISCO NUMERO: "+str(self.var_disc_n)+"##########")
|
|
|
|
|
386
|
self.txtInfo.append("--------Creando el iso del disco numero: "+str(self.var_disc_n))
|
|
|
|
|
387
|
|
|
|
|
|
388
|
#comando para la creacion del archivo.iso
|
|
|
|
|
389
|
file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(self.var_disc_n)+".dat"
|
|
|
|
|
390
|
file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
|
|
|
|
|
391
|
var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
|
|
|
|
|
392
|
var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel
|
|
|
|
|
393
|
var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
|
|
|
|
|
394
|
self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada
|
|
|
|
|
395
|
|
|
432
|
|
|
396
|
#Grabacion de los DVDs
|
|
433
|
#Grabacion de los DVDs
|
|
397
|
elif self.var_step == 1:
|
|
434
|
elif self.var_step == 1:
|
|
398
|
self.var_copy_n += 1 # numero de copia actual
|
|
435
|
|
|
399
|
var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) ) % len(self.var_devices)
|
|
436
|
functions2.make_burning_conf(self)
|
|
|
|
|
437
|
|
|
|
|
|
438
|
var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
|
|
400
|
|
|
439
|
|
|
401
|
if var_index == 0 and self.blank_discs == False:
|
|
440
|
if var_index == 0 and self.blank_discs == False:
|
|
402
|
self.txtInfo.append("EXPULSANDO BANDEJAS")
|
|
441
|
functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
|
|
403
|
self.var_copy_n -= 1 #El numero de copia se regresa al estado anterior
|
|
|
|
|
404
|
# functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
|
|
|
|
|
405
|
self.blank_discs = True
|
|
442
|
self.blank_discs = True
|
|
406
|
self.btnStartburn.setText("Continue")
|
|
443
|
self.btnStartburn.setText("Continue")
|
|
407
|
self.btnStartburn.setEnabled(True)
|
|
444
|
self.btnStartburn.setEnabled(True)
|
|
@@
-410,16
+447,13
|
|
410
|
self.blank_discs = False
|
|
447
|
self.blank_discs = False
|
|
411
|
|
|
448
|
|
|
412
|
self.txtInfo.append("Grabando la copia numero: "+str(self.var_copy_n))
|
|
449
|
self.txtInfo.append("Grabando la copia numero: "+str(self.var_copy_n))
|
|
413
|
#Si esta es la ultima copia se pasara al siguiente disco en la siguiente llamada a la funcion
|
|
|
|
|
414
|
if self.var_copy_n == self.var_Copys:
|
|
|
|
|
415
|
self.var_step = 0
|
|
|
|
|
416
|
|
|
450
|
|
|
417
|
var_dev_tmp = self.var_devices[var_index]
|
|
451
|
var_dev_tmp = self.var_devices[var_index]
|
|
418
|
file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
|
|
452
|
file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
|
|
419
|
var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
|
|
453
|
var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
|
|
420
|
|
|
454
|
|
|
421
|
self.var_process.start('ls')
|
|
455
|
self.var_process.start('echo "comando"')
|
|
422
|
self.txtInfo.append("CMD: "+var_cmd)
|
|
456
|
# self.txtInfo.append("CMD: "+var_cmd)
|
|
423
|
|
|
457
|
|
|
424
|
# self.txtInfo.append("creando iso")
|
|
458
|
# self.txtInfo.append("creando iso")
|
|
425
|
# self.var_process.start(var_cmd)
|
|
459
|
# self.var_process.start(var_cmd)
|
|
@@
-437,7
+471,6
|
|
437
|
# self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona
|
|
471
|
# self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona
|
|
438
|
self.txtInfo.append("Stopped recording")
|
|
472
|
self.txtInfo.append("Stopped recording")
|
|
439
|
functions2.enabled_items2(False, self)
|
|
473
|
functions2.enabled_items2(False, self)
|
|
440
|
self.btnStartburn.setText("Start Burn")
|
|
|
|
|
441
|
|
|
474
|
|
|
442
|
|
|
475
|
|
|
443
|
#----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
|
|
476
|
#----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
|
|
@@
-481,4
+514,4
|
|
481
|
"""
|
|
514
|
"""
|
|
482
|
Slot documentation goes here.
|
|
515
|
Slot documentation goes here.
|
|
483
|
"""
|
|
516
|
"""
|
|
484
|
pass
|
|
517
|
pass
|