##// END OF EJS Templates
3ro segun diagrama...
ralonso -
r78:79
parent child
Show More
@@ -9,6 +9,7
9 9 import subprocess
10 10 import commands
11 11 import shutil
12 import functions2
12 13
13 14 #--------------------------------------------- Entero a cadena agregando ceros delante -------------------------------------------------
14 15
@@ -207,7 +208,7
207 208 for k in range(0, len(var_lines2) / 5):
208 209 var_lines=["\n"]
209 210 var_lines.append(" "+self.var_Elabel+" "+i2s(var_n)+"/"+i2s(self.var_Discs)+"\n")
210 var_lines.append("Year Doy Folder"+" "*6+"Set"+" "*9+"Time range\n")
211 var_lines.append("Year Doy Folder"+" "*9+"Set"+" "*11+"Time range\n")
211 212 var_lines.extend(var_lines2[(5*k):(5*(k+1))])
212 213 var_lines.append("\n")
213 214 var_labels.append(var_lines)
@@ -271,20 +272,22
271 272
272 273 def cmd_burn(self):
273 274 var_Rpath_iso=self.var_Rpath+"/iso"
274 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
275 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso"
275 276
276 277 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
277 278 var_dev_tmp = self.var_devices[var_index]
278 279
279 280 var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
280 281 return var_cmd
282
283 def cmd_check(self):
284 var_cmd = "echo 'function check'"
285 return var_cmd
281 286
282 287 def remove_iso(self):
283 288 var_Rpath_iso=self.var_Rpath+"/iso"
284 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
285
286 self.txtInfo.append("Deleting iso file: "+functions.i2s(self.var_disc_n)+".iso")
287
289 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso"
290 # shutil.rmtree(self.var_Rpath+'/'+var_dir, True)
288 291 if os.path.isfile(file_iso):
289 292 os.remove(file_iso)
290 293
@@ -298,6 +301,10
298 301 #Define cual es el siguiente disco a grabar y que paso seguir
299 302 def next_disc(self, error = False):
300 303 if self.var_copy_n == self.var_Copys:
304 #borrado del iso
305 self.txtInfo.append("Deleting iso file: "+i2s(self.var_disc_n)+".iso")
306 remove_iso(self)
307
301 308 self.var_disc_n += 1
302 309 self.var_copy_n = 1
303 310 self.var_step = 0
@@ -306,6 +313,9
306 313 self.var_copy_n += 1
307 314 self.var_step = 1
308 315
316 functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente
317 #crea el archivo burning.conf para el seguimiento de los discos grabados
318
309 319 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
310 320
311 321 self.txtInfo.append("NEXT DISC: "+str(self.var_disc_n)+" COPY: "+str(self.var_copy_n)
@@ -154,7 +154,7
154 154
155 155 def make_burning_conf(self):
156 156 var_file = open("burning.conf","w")
157 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
157 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n - 1 )
158 158 var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados
159 159 var_file.write(str(self.var_disc_n)+"\n") #1 Disco actual para grabar
160 160 var_file.write(str(self.var_copy_n)+"\n") #2 Numero de copia actual para grabar
@@ -32,8 +32,10
32 32
33 33 def setupUi2(self):
34 34
35 self.var_real = False
36
35 self.var_real_iso = True
36 self.var_real_burn = False
37 self.var_real_check = False
38 self.var_real_eject = False
37 39 # Reconocimiento de los dispositivos de grabacion
38 40 # functions2.detect_devices(self) #busca los dispositivos de grabacion
39 41 ####################################
@@ -81,8 +83,7
81 83 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
82 84 self.txtInfo.append("Burned discs: "+str(self.var_burned_discs))
83 85 self.btnStartburn.setText("Continue")
84
85
86 self.actionChange_Parameters.setEnabled(False)
86 87
87 88 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
88 89 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
@@ -117,6 +118,11
117 118 self.txtInfo.append("Changed parameters")
118 119 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
119 120 self.bool_first_iso = True
121 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
122 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
123 self.txtInfo.append("Nro Copys: "+str(self.var_Copys))
124 functions2.make_parameters_conf(self)
125 self.txtCopys.setValue(self.var_Copys) #Actualizo mananualmente el valor Copys
120 126
121 127
122 128
@@ -381,7 +387,7
381 387 return
382 388
383 389 if self.process_iso.exitCode() == 0:
384 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully")
390 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully\n")
385 391 self.var_step = 1
386 392 self.function_burn()
387 393
@@ -390,6 +396,7
390 396 +" , code "+QtCore.QString(self.process_iso.exitCode()))
391 397 self.txtInfo.append("Please check the data")
392 398 self.txtInfo.append("FATAL ERROR")
399
393 400 #----------------------------------------------------- Funciones del proceso de grabado ---------------------------------------------------------------
394 401
395 402 def readOuput_burn(self):
@@ -405,9 +412,6
405 412 if not(self.bool_state_burning):
406 413 return
407 414
408 functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente
409 #crea el archivo burning.conf para el seguimiento de los discos grabados
410
411 415 if self.process_burn.exitCode() == 0:
412 416 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
413 417 functions2.update_message(1, "COMPLETED", self)
@@ -494,7 +498,7
494 498 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
495 499 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n))
496 500
497 if self.var_real == True:
501 if self.var_real_iso == True:
498 502 var_cmd = functions.cmd_iso(self)
499 503 else:
500 504 self.txtInfo.append('**function_iso')
@@ -504,12 +508,17
504 508
505 509 def function_burn(self):
506 510 #Grabacion de los DVDs
511
507 512 if self.var_step == 1:
508 self.txtInfo.append("------Recording disc: "+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
513 self.txtInfo.append("------Recording disc: "+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
509 514 functions2.update_message(1, "BURNING", self)
510 515
511 if self.var_real == True:
516 if self.var_real_burn == True:
512 517 var_cmd = functions.cmd_burn(self)
518 #########################################
519 return######################################
520 ########################################
521
513 522 else:
514 523 self.txtInfo.append('**function_burn')
515 524 var_cmd="echo 'function_burn'"
@@ -519,10 +528,10
519 528 def function_check(self):
520 529 #Verificacion de los discos
521 530 if self.var_step == 2:
522 self.txtInfo.append("-----------checking disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
531 self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
523 532 functions2.update_message(2, "CHECKING", self)
524 533
525 if self.var_real == True:
534 if self.var_real_check == True:
526 535 var_cmd = functions.cmd_check(self)
527 536 else:
528 537 self.txtInfo.append('**function_check')
@@ -535,7 +544,7
535 544 self.txtInfo.append("Ejecting recording devices")
536 545 self.txtInfo.append("Please insert blank discs")
537 546
538 if self.var_real == True:
547 if self.var_real_eject == True:
539 548 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
540 549 else:
541 550 self.txtInfo.append("**functions2.eject_devices")
General Comments 0
You need to be logged in to leave comments. Login now