@@ -94,20 +94,35 | |||
|
94 | 94 | #------------------------------------------------- Crea directorios en la ruta indicada ----------------------------------------------------------- |
|
95 | 95 | |
|
96 | 96 | def make_dirs(list_dirs, self): |
|
97 | """ | |
|
98 | ||
|
99 | """ | |
|
100 | ||
|
97 | ||
|
101 | 98 | for var_dir in list_dirs: |
|
102 | 99 | shutil.rmtree(self.var_Rpath+'/'+var_dir, True) |
|
103 |
var_output=commands.getstatusoutput("mkdir -p "+self.var_Rpath+'/'+var_dir) |
|
|
104 | if var_output != 0: | |
|
105 | self.txtInfo.append("Error creating directory: "+var_dir+", output_error:" + str(var_output)) | |
|
100 | var_output=commands.getstatusoutput("mkdir -p "+self.var_Rpath+'/'+var_dir) | |
|
101 | if var_output[0] != 0: | |
|
102 | self.txtInfo.append("Error creating directory: "+var_dir+", output_error:" + str(var_output[0])) | |
|
106 | 103 | return False |
|
107 | 104 | self.txtInfo.append('Directories created correctly') |
|
108 | 105 | return True |
|
109 | 106 | |
|
110 | ||
|
107 | def remove_dir(var_dir, self): | |
|
108 | var_output = commands.getstatusoutput('chmod -R 777 '+var_dir) | |
|
109 | if var_output[0] != 0: | |
|
110 | self.txtInfo.append("Error changing permissions: "+var_dir+", output_error:" + str(var_output[0])) | |
|
111 | return False | |
|
112 | ||
|
113 | var_output = commands.getstatusoutput('rm -rf '+var_dir) | |
|
114 | if var_output[0] != 0: | |
|
115 | self.txtInfo.append("Error deleting directory: "+var_dir+", output_error:" + str(var_output[0])) | |
|
116 | return False | |
|
117 | return True | |
|
118 | ||
|
119 | def make_dir(var_dir, self): | |
|
120 | var_output = commands.getstatusoutput('mkdir '+var_dir) | |
|
121 | if var_output[0] != 0: | |
|
122 | self.txtInfo.append("Error deleting directory: "+var_dir+", output_error:" + str(var_output[0])) | |
|
123 | return False | |
|
124 | return True | |
|
125 | ||
|
111 | 126 | #-------------------------------------------- Busca los archivos con los parametros de busqueda --------------------------------------- |
|
112 | 127 | |
|
113 | 128 | def list_files(self): |
@@ -281,9 +296,18 | |||
|
281 | 296 | var_cmd = "growisofs -dvd-compat -Z "+var_dev_tmp+"="+ file_iso |
|
282 | 297 | return var_cmd |
|
283 | 298 | |
|
284 | def cmd_check(self): | |
|
285 | var_cmd = "echo 'function check'" | |
|
286 | return var_cmd | |
|
299 | ||
|
300 | def cmd_check(dev_sr, self): | |
|
301 | ||
|
302 | var_Rpath_tmpdata=self.var_Rpath+"/tmpdata" | |
|
303 | ||
|
304 | var_output=commands.getstatusoutput('df -hT | grep '+dev_sr) | |
|
305 | if var_output[0] != 0: | |
|
306 | return "FATAL ERROR" | |
|
307 | else: | |
|
308 | var_cmd = "cp -rfv "+var_output[1] .split()[-1]+"/ "+var_Rpath_tmpdata+"/" | |
|
309 | return var_cmd | |
|
310 | ||
|
287 | 311 | |
|
288 | 312 | def remove_iso(self): |
|
289 | 313 | var_Rpath_iso=self.var_Rpath+"/iso" |
@@ -56,6 +56,31 | |||
|
56 | 56 | var_cmd = 'eject ' + var_dev |
|
57 | 57 | commands.getstatusoutput(var_cmd) |
|
58 | 58 | |
|
59 | #Expulsa el dispositivo de grabacion actual | |
|
60 | def eject_one_device(self): | |
|
61 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) | |
|
62 | var_dev = self.var_devices[var_index] | |
|
63 | var_cmd = 'eject ' + var_dev | |
|
64 | commands.getstatusoutput(var_cmd) | |
|
65 | ||
|
66 | def eject_t_one_device(self): | |
|
67 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) | |
|
68 | var_dev = self.var_devices[var_index] | |
|
69 | var_cmd = 'eject -t ' + var_dev | |
|
70 | commands.getstatusoutput(var_cmd) | |
|
71 | ||
|
72 | def get_dev_sr(self): | |
|
73 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) | |
|
74 | var_dev = self.var_devices[var_index] | |
|
75 | var_output=commands.getstatusoutput('ls -lh '+var_dev) | |
|
76 | if var_output[0] != 0: | |
|
77 | return "FATAL ERROR" | |
|
78 | else: | |
|
79 | var_dev_sr = "/dev/"+var_output[1] .split()[-1] | |
|
80 | return var_dev_sr | |
|
81 | ||
|
82 | ||
|
83 | ||
|
59 | 84 | #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- |
|
60 | 85 | |
|
61 | 86 | def selected_devices(self): |
@@ -187,14 +212,17 | |||
|
187 | 212 | self.btnStartburn.setEnabled(not(var_bool)) |
|
188 | 213 | self.btnStopburn.setEnabled(var_bool) |
|
189 | 214 | self.chkCheck.setEnabled(not(var_bool)) |
|
215 | self.chkCheck.setChecked(False) | |
|
216 | ||
|
190 | 217 | self.actionChange_Parameters.setEnabled(False) |
|
218 | ||
|
191 | 219 | |
|
192 | 220 | |
|
193 | 221 | |
|
194 | 222 | |
|
195 | 223 | #---------------------------------------------- Actualiza estado en los labels ------------------------------------------------------- |
|
196 | 224 | |
|
197 | def update_message(type, message, self, index=0): | |
|
225 | def update_message(type, message, self, index=0, ): | |
|
198 | 226 | if index == 0: |
|
199 | 227 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices) |
|
200 | 228 | else: |
@@ -32,10 +32,9 | |||
|
32 | 32 | |
|
33 | 33 | def setupUi2(self): |
|
34 | 34 | |
|
35 | self.txtInfo.append("cambio") | |
|
36 | ||
|
37 | ||
|
38 | self.allTrue = True | |
|
35 | self.txtInfo.append("cambio 1") | |
|
36 | ||
|
37 | self.allTrue = False | |
|
39 | 38 | |
|
40 | 39 | if self.allTrue == True: |
|
41 | 40 | self.var_real_principal = True |
@@ -47,11 +46,11 | |||
|
47 | 46 | self.var_real_show_cmd = True |
|
48 | 47 | |
|
49 | 48 | else: |
|
50 |
self.var_real_principal = |
|
|
49 | self.var_real_principal = False | |
|
51 | 50 | self.var_real_detect_devices = False |
|
52 |
self.var_real_iso = |
|
|
51 | self.var_real_iso = False | |
|
53 | 52 | self.var_real_burn = False |
|
54 |
self.var_real_check = |
|
|
53 | self.var_real_check = True | |
|
55 | 54 | self.var_real_eject = False |
|
56 | 55 | self.var_real_show_cmd = True |
|
57 | 56 | |
@@ -459,7 +458,7 | |||
|
459 | 458 | |
|
460 | 459 | if not(self.bool_state_burning): |
|
461 | 460 | return |
|
462 | ||
|
461 | ||
|
463 | 462 | if self.process_check.exitCode() == 0: |
|
464 | 463 | self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n)) |
|
465 | 464 | functions2.update_message(2, "CHECKED", self) |
@@ -468,7 +467,22 | |||
|
468 | 467 | self.txtInfo.append("#######Error checking, disc: "+functions.i2s(self.var_disc_n)+" copy: " |
|
469 | 468 | +functions.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode())) |
|
470 | 469 | functions2.update_message(2, "ERROR", self) |
|
471 | ||
|
470 | ||
|
471 | #borrar el contenido de tmpdata | |
|
472 | var_tmpdata=self.var_Rpath+"/tmpdata" | |
|
473 | ||
|
474 | bool_return = functions.remove_dir(var_tmpdata, self) | |
|
475 | if not(bool_return): | |
|
476 | self.txtInfo.append("Error deleting directory: "+var_tmpdata) | |
|
477 | self.bool_state_burning = False | |
|
478 | return | |
|
479 | ||
|
480 | bool_return = functions.make_dir(var_tmpdata, self) | |
|
481 | if not(bool_return): | |
|
482 | self.txtInfo.append("Error creating directory:"+ var_tmpdata) | |
|
483 | self.bool_state_burning = False | |
|
484 | return | |
|
485 | ||
|
472 | 486 | functions.is_last_disc_and_copy(self) |
|
473 | 487 | |
|
474 | 488 | |
@@ -551,9 +565,16 | |||
|
551 | 565 | #Verificacion de los discos |
|
552 | 566 | if self.var_step == 2: |
|
553 | 567 | self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n)) |
|
568 | ||
|
569 | functions2.eject_one_device(self) | |
|
570 | functions2.eject_t_one_device(self) | |
|
571 | self.txtInfo.append("Waiting ...") | |
|
572 | time .sleep(20) | |
|
573 | ||
|
554 | 574 | functions2.update_message(2, "CHECKING", self) |
|
555 | ||
|
556 |
|
|
|
575 | ||
|
576 | dev_sr = functions2.get_dev_sr(self) | |
|
577 | var_cmd = functions.cmd_check(dev_sr, self) | |
|
557 | 578 | |
|
558 | 579 | if self.var_real_show_cmd == True: |
|
559 | 580 | self.txtInfo.append("CMD: "+var_cmd) |
General Comments 0
You need to be logged in to leave comments.
Login now