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