##// END OF EJS Templates
#error function corregido
ralonso -
r81:82
parent child
Show More
@@ -1,634 +1,642
1 1 # -*- coding: utf-8 -*- No newline at end of file
2 2 No newline at end of file
3 3 """ No newline at end of file
4 4 Module implementing MainWindow. No newline at end of file
5 5 """ No newline at end of file
6 6 No newline at end of file
7 7 from PyQt4.QtGui import QMainWindow No newline at end of file
8 8 from PyQt4.QtCore import pyqtSignature No newline at end of file
9 9 from PyQt4 import QtCore No newline at end of file
10 10 from Ui_MainWindow import Ui_MainWindow No newline at end of file
11 11 from Ui_Parameters import Ui_Parameters No newline at end of file
12 12 from Ui_About import Ui_About No newline at end of file
13 13 from PyQt4 import QtGui No newline at end of file
14 14 from subprocess import * No newline at end of file
15 15 import sys No newline at end of file
16 16 import os No newline at end of file
17 17 #import subprocess No newline at end of file
18 18 import time No newline at end of file
19 19 import commands No newline at end of file
20 20 from functions import functions No newline at end of file
21 21 from functions import functions2 No newline at end of file
22 22 No newline at end of file
23 23 class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file
24 24 """ No newline at end of file
25 25 Class documentation goes here. No newline at end of file
26 26 """ No newline at end of file
27 27 No newline at end of file
28 28 def __init__(self, parent = None): No newline at end of file
29 29 QMainWindow.__init__(self, parent) No newline at end of file
30 30 self.setupUi(self) No newline at end of file
31 31 self.setupUi2() No newline at end of file
32 32 No newline at end of file
33 33 def setupUi2(self): No newline at end of file
34 34
35 No newline at end of file
35 No newline at end of file
No newline at end of file
36
No newline at end of file
37 if self.allTrue == True: No newline at end of file
36 38 self.var_real_principal = True
39 No newline at end of file
37 No newline at end of file
No newline at end of file
40 self.var_real_iso = True
No newline at end of file
41 self.var_real_burn = True
No newline at end of file
42 self.var_real_check = True
No newline at end of file
43 self.var_real_eject = True
No newline at end of file
44 self.var_real_show_cmd = True
No newline at end of file
45
No newline at end of file
46 else:
No newline at end of file
47 self.var_real_principal = True No newline at end of file
38 48 self.var_real_detect_devices = False No newline at end of file
39 49 No newline at end of file
40 50 self.var_real_iso = True No newline at end of file
41 51 self.var_real_burn = False No newline at end of file
42 52 self.var_real_check = False No newline at end of file
43 53 self.var_real_eject = False No newline at end of file
44 54 No newline at end of file
45 55 self.var_real_show_cmd = True No newline at end of file
46 56 No newline at end of file
47 57 if self.var_real_detect_devices == True: No newline at end of file
48 58 # Reconocimiento de los dispositivos de grabacion No newline at end of file
49 59 functions2.detect_devices(self) No newline at end of file
50 60 else: No newline at end of file
51 61 functions2.set_devices_test(self) No newline at end of file
52 62 No newline at end of file
53 63 #Inicialiazacion de variables No newline at end of file
54 64 self.var_Discs = 0 #Numero de discos del proyecto No newline at end of file
55 65 self.var_Copys = 0 #Numero de copias No newline at end of file
56 66 self.var_disc_n = 0 # disco actual No newline at end of file
57 67 self.var_copy_n = 0 # copia actual No newline at end of file
58 68 self.var_burned_discs = 0 #numero de discos ya grabados No newline at end of file
59 69 No newline at end of file
60 70 self.bool_first_iso = False No newline at end of file
61 71 self.var_step = 0 # numero de paso en el proceso No newline at end of file
62 72 self.bool_state_burning = False #si es True se puede grabar No newline at end of file
63 73 self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco No newline at end of file
64 74 No newline at end of file
65 75 self.var_list=[] # Lista de DOYs No newline at end of file
66 76 self.var_sublist=[] # Sub-lista de DOYs seleccionados No newline at end of file
67 77 self.var_devices=[] #Lista de dispositivos seleccionados No newline at end of file
68 78 No newline at end of file
69 79 #Revisa si existe el archivo de confirguracion y lo carga No newline at end of file
70 80 if os.path.isfile("parameters.conf"): No newline at end of file
71 81 functions2.get_parameters_conf(self) No newline at end of file
72 82 self.bool_first_iso = True No newline at end of file
73 83 self.txtInfo.append("Parameters were loaded from configuration file") No newline at end of file
74 84 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
75 85 No newline at end of file
76 86 elif self.var_real_principal == False: No newline at end of file
77 87 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas No newline at end of file
78 88 No newline at end of file
79 89 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados No newline at end of file
80 90 No newline at end of file
81 91 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
82 92 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
83 93 functions.load_days(self) No newline at end of file
84 94 No newline at end of file
85 95 if os.path.isfile("parameters.conf"): No newline at end of file
86 96 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion No newline at end of file
87 97 No newline at end of file
88 98 if os.path.isfile("burning.conf"): No newline at end of file
89 99 functions2.get_burning_conf(self) No newline at end of file
90 100 self.txtInfo.append("Current disc: "+str(self.var_disc_n)) No newline at end of file
91 101 self.txtInfo.append("Current copy: "+str(self.var_copy_n)) No newline at end of file
92 102 self.txtInfo.append("Burned discs: "+str(self.var_burned_discs)) No newline at end of file
93 103 self.btnStartburn.setText("Continue") No newline at end of file
94 104 self.actionChange_Parameters.setEnabled(False) No newline at end of file
95 105 No newline at end of file
96 106 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) No newline at end of file
97 107 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) No newline at end of file
98 108 No newline at end of file
99 109 self.process_iso = QtCore.QProcess() No newline at end of file
100 110 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_iso) No newline at end of file
101 111 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardError()'), self.readError_iso) No newline at end of file
102 112 self.connect(self.process_iso, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_iso) No newline at end of file
103 113 No newline at end of file
104 114 self.process_burn = QtCore.QProcess() No newline at end of file
105 115 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_burn) No newline at end of file
106 116 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardError()'), self.readError_burn) No newline at end of file
107 117 self.connect(self.process_burn, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_burn) No newline at end of file
108 118 No newline at end of file
109 119 self.process_check = QtCore.QProcess() No newline at end of file
110 120 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check) No newline at end of file
111 121 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) No newline at end of file
112 122 self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) No newline at end of file
113 123 No newline at end of file
114 124 No newline at end of file
115 125 def changeParameters(self): No newline at end of file
116 126 dlg=QtGui.QDialog() No newline at end of file
117 127 dlgui=Ui_Parameters() No newline at end of file
118 128 dlgui.setupUi(dlg) No newline at end of file
119 129 if (dlg.exec_() == QtGui.QDialog.Accepted): No newline at end of file
120 130 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value(): No newline at end of file
121 131 self.txtInfo.append("Wrong parameters") No newline at end of file
122 132 else: No newline at end of file
123 133 self.var_Copys = dlgui.txtNcopys.value() No newline at end of file
124 134 self.var_disc_n = dlgui.txtDisc.value() No newline at end of file
125 135 self.var_copy_n = dlgui.txtCopy.value() No newline at end of file
126 136 self.txtInfo.append("Changed parameters") No newline at end of file
127 137 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 ) No newline at end of file
128 138 self.bool_first_iso = True No newline at end of file
129 139 self.txtInfo.append("Current disc: "+str(self.var_disc_n)) No newline at end of file
130 140 self.txtInfo.append("Current copy: "+str(self.var_copy_n)) No newline at end of file
131 141 self.txtInfo.append("Nro Copys: "+str(self.var_Copys)) No newline at end of file
132 142 functions2.make_parameters_conf(self) No newline at end of file
133 143 self.txtCopys.setValue(self.var_Copys) #Actualizo mananualmente el valor Copys No newline at end of file
134 144 No newline at end of file
135 145 No newline at end of file
136 146 No newline at end of file
137 147 def about(self): No newline at end of file
138 148 dlg_about=QtGui.QDialog() No newline at end of file
139 149 dlgui_about=Ui_About() No newline at end of file
140 150 dlgui_about.setupUi(dlg_about) No newline at end of file
141 151 dlg_about.exec_() No newline at end of file
142 152 No newline at end of file
143 153 No newline at end of file
144 154 #============================================================================== No newline at end of file
145 155 # Manejo de los eventos No newline at end of file
146 156 #============================================================================== No newline at end of file
147 157 No newline at end of file
148 158 #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- No newline at end of file
149 159 No newline at end of file
150 160 @pyqtSignature("") No newline at end of file
151 161 def on_btnDpath_clicked(self): No newline at end of file
152 162 """ No newline at end of file
153 163 Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file
154 164 """ No newline at end of file
155 165 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
156 166 self.txtDpath.setText(self.var_Dpath) No newline at end of file
157 167 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
158 168 functions.load_days(self) No newline at end of file
159 169 No newline at end of file
160 170 No newline at end of file
161 171 @pyqtSignature("") No newline at end of file
162 172 def on_txtDpath_editingFinished(self): No newline at end of file
163 173 """ No newline at end of file
164 174 Carga la ruta editada y verifica que sea correcta y carga la lista de dias No newline at end of file
165 175 """ No newline at end of file
166 176 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
167 177 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
168 178 functions.load_days(self) No newline at end of file
169 179 No newline at end of file
170 180 No newline at end of file
171 181 #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- No newline at end of file
172 182 No newline at end of file
173 183 @pyqtSignature("") No newline at end of file
174 184 def on_btnRpath_clicked(self): No newline at end of file
175 185 """ No newline at end of file
176 186 Permite seleccionar graficamente el direcorio del proyecto No newline at end of file
177 187 """ No newline at end of file
178 188 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
179 189 self.txtRpath.setText(self.var_Rpath) No newline at end of file
180 190 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
181 191 No newline at end of file
182 192 No newline at end of file
183 193 @pyqtSignature("") No newline at end of file
184 194 def on_txtRpath_editingFinished(self): No newline at end of file
185 195 """ No newline at end of file
186 196 Valida la ruta del proyecto No newline at end of file
187 197 """ No newline at end of file
188 198 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
189 199 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
190 200 No newline at end of file
191 201 No newline at end of file
192 202 #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- No newline at end of file
193 203 No newline at end of file
194 204 @pyqtSignature("int") No newline at end of file
195 205 def on_lstDtype_activated(self, index): No newline at end of file
196 206 """ No newline at end of file
197 207 Permite elegir entre los tipos de archivos No newline at end of file
198 208 """ No newline at end of file
199 209 self.txtDtype.setReadOnly(True) No newline at end of file
200 210 if index == 0: No newline at end of file
201 211 self.var_Dtype ='r' No newline at end of file
202 212 elif index == 1: No newline at end of file
203 213 self.var_Dtype ='pdata' No newline at end of file
204 214 elif index == 2: No newline at end of file
205 215 self.var_Dtype ='sswma' No newline at end of file
206 216 else : No newline at end of file
207 217 self.var_Dtype ='' No newline at end of file
208 218 self.txtDtype.setReadOnly(False) No newline at end of file
209 219 No newline at end of file
210 220 self.txtDtype.setText(self.var_Dtype) No newline at end of file
211 221 functions.load_days(self) #llamada a funcion No newline at end of file
212 222 No newline at end of file
213 223 @pyqtSignature("") No newline at end of file
214 224 def on_txtDtype_editingFinished(self): No newline at end of file
215 225 self.var_Dtype=str(self.txtDtype.text()) No newline at end of file
216 226 functions.load_days(self) #llamada a funcion No newline at end of file
217 227 No newline at end of file
218 228 No newline at end of file
219 229 #----------------------------------------------------- Etiqueta --------------------------------------------------------------- No newline at end of file
220 230 No newline at end of file
221 231 @pyqtSignature("") No newline at end of file
222 232 def on_txtElabel_editingFinished(self): No newline at end of file
223 233 self.var_Elabel = str(self.txtElabel.text()) No newline at end of file
224 234 No newline at end of file
225 235 #----------------------------------------------------- Numero de copias --------------------------------------------------------------- No newline at end of file
226 236 @pyqtSignature("") No newline at end of file
227 237 def on_txtCopys_editingFinished(self): No newline at end of file
228 238 self.var_Copys = self.txtCopys.value() No newline at end of file
229 239 No newline at end of file
230 240 #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- No newline at end of file
231 241 No newline at end of file
232 242 @pyqtSignature("int") #CLOSED No newline at end of file
233 243 def on_lstStartDay_activated(self, index): No newline at end of file
234 244 """ No newline at end of file
235 245 Cambia la lista de opciones en lstStopDay No newline at end of file
236 246 """ No newline at end of file
237 247 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file
238 248 self.lstStopDay.clear() No newline at end of file
239 249 No newline at end of file
240 250 for i in self.var_list[index:]: No newline at end of file
241 251 self.lstStopDay.addItem(i) No newline at end of file
242 252 No newline at end of file
243 253 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file
244 254 No newline at end of file
245 255 functions.get_sub_list(self) No newline at end of file
246 256 No newline at end of file
247 257 No newline at end of file
248 258 @pyqtSignature("int") #CLOSED No newline at end of file
249 259 def on_lstStopDay_activated(self, index): No newline at end of file
250 260 """ No newline at end of file
251 261 Cambia la lista de opciones en lstStartDay No newline at end of file
252 262 """ No newline at end of file
253 263 var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file
254 264 var_end_index = self.lstStopDay.count() - index No newline at end of file
255 265 self.lstStartDay.clear() No newline at end of file
256 266 No newline at end of file
257 267 for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file
258 268 self.lstStartDay.addItem(i) No newline at end of file
259 269 No newline at end of file
260 270 self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file
261 271 No newline at end of file
262 272 functions.get_sub_list(self) No newline at end of file
263 273 No newline at end of file
264 274 No newline at end of file
265 275 #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- No newline at end of file
266 276 No newline at end of file
267 277 @pyqtSignature("") No newline at end of file
268 278 def on_txtDcapacity_editingFinished(self): No newline at end of file
269 279 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
270 280 No newline at end of file
271 281 No newline at end of file
272 282 @pyqtSignature("int") #CLOSED No newline at end of file
273 283 def on_lstDcapacity_activated(self, index): No newline at end of file
274 284 """ No newline at end of file
275 285 Permite elegir el tamaΓ±o del disco No newline at end of file
276 286 """ No newline at end of file
277 287 if index == 0: No newline at end of file
278 288 var_size=25.0 No newline at end of file
279 289 elif index == 1: No newline at end of file
280 290 var_size=8.5 No newline at end of file
281 291 elif index == 2: No newline at end of file
282 292 var_size=4.7 No newline at end of file
283 293 elif index == 3: No newline at end of file
284 294 var_size=0.7 No newline at end of file
285 295 No newline at end of file
286 296 if index != 4: No newline at end of file
287 297 self.txtDcapacity.setValue(var_size*10**9/1024**2) No newline at end of file
288 298 self.txtDcapacity.setReadOnly(True) No newline at end of file
289 299 else: No newline at end of file
290 300 self.txtDcapacity.setValue(100.0) No newline at end of file
291 301 self.txtDcapacity.setReadOnly(False) No newline at end of file
292 302 No newline at end of file
293 303 self.var_lstDcapacity = self.lstDcapacity.currentIndex() No newline at end of file
294 304 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
295 305 No newline at end of file
296 306 #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- No newline at end of file
297 307 No newline at end of file
298 308 @pyqtSignature("") No newline at end of file
299 309 def on_btnTdevA_clicked(self): No newline at end of file
300 310 var_dev = str(self.txtDeviceA.text()) No newline at end of file
301 311 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
302 312 commands.getstatusoutput(var_cmd) No newline at end of file
303 313 No newline at end of file
304 314 @pyqtSignature("") No newline at end of file
305 315 def on_btnTdevB_clicked(self): No newline at end of file
306 316 var_dev = str(self.txtDeviceB.text()) No newline at end of file
307 317 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
308 318 commands.getstatusoutput(var_cmd) No newline at end of file
309 319 No newline at end of file
310 320 @pyqtSignature("") No newline at end of file
311 321 def on_btnTdevC_clicked(self): No newline at end of file
312 322 var_dev = str(self.txtDeviceC.text()) No newline at end of file
313 323 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
314 324 commands.getstatusoutput(var_cmd) No newline at end of file
315 325 No newline at end of file
316 326 @pyqtSignature("") No newline at end of file
317 327 def on_btnTdevD_clicked(self): No newline at end of file
318 328 var_dev = str(self.txtDeviceD.text()) No newline at end of file
319 329 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
320 330 commands.getstatusoutput(var_cmd) No newline at end of file
321 331 No newline at end of file
322 332 No newline at end of file
323 333 #============================================================================== No newline at end of file
324 334 # Botones para la generacion de los archivos de configuracion No newline at end of file
325 335 #============================================================================== No newline at end of file
326 336 No newline at end of file
327 337 #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- No newline at end of file
328 338 No newline at end of file
329 339 @pyqtSignature("") No newline at end of file
330 340 def on_btnGbkp_clicked(self): No newline at end of file
331 341 """ No newline at end of file
332 342 Generacion de archivos de configuracion usando los parametros No newline at end of file
333 343 """ No newline at end of file
334 344 No newline at end of file
335 345 if functions.validate_parameters(self) == False: No newline at end of file
336 346 return No newline at end of file
337 347 No newline at end of file
338 348 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file
339 349 list_dirs=['gpath','iso','ppath', 'tmpdata'] No newline at end of file
340 350 bool_make_dirs = functions.make_dirs(list_dirs, self) No newline at end of file
341 351 if bool_make_dirs == False: No newline at end of file
342 352 return No newline at end of file
343 353 No newline at end of file
344 354 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar No newline at end of file
345 355 No newline at end of file
346 356 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat No newline at end of file
347 357 No newline at end of file
348 358 functions.make_files_print(self) # Se crean los archivos .print No newline at end of file
349 359 No newline at end of file
350 360 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf No newline at end of file
351 361 No newline at end of file
352 362 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
353 363 No newline at end of file
354 364 #Se bloquean los parametros de configuracion No newline at end of file
355 365 functions2.enabled_items1(True, self) No newline at end of file
356 366 self.var_disc_n = 1 No newline at end of file
357 367 self.var_copy_n = 1 No newline at end of file
358 368 self.bool_first_iso = True No newline at end of file
359 369 self.var_burned_discs = 0 #numero de discos grabados No newline at end of file
360 370 No newline at end of file
361 371 No newline at end of file
362 372 #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- No newline at end of file
363 373 No newline at end of file
364 374 @pyqtSignature("") No newline at end of file
365 375 def on_btnRestart_clicked(self): No newline at end of file
366 376 """ No newline at end of file
367 377 Permite que se puedan cambiar los parametros No newline at end of file
368 378 """ No newline at end of file
369 379 if os.path.isfile("parameters.conf"): No newline at end of file
370 380 os.remove("parameters.conf") No newline at end of file
371 381 if os.path.isfile("burning.conf"): No newline at end of file
372 382 os.remove("burning.conf") No newline at end of file
373 383 No newline at end of file
374 384 functions2.enabled_items1(False, self) No newline at end of file
375 385 self.btnStartburn.setText("Start Burn") No newline at end of file
376 386 self.txtInfo.clear() No newline at end of file
377 387 No newline at end of file
378 388 No newline at end of file
379 389 No newline at end of file
380 390 #============================================================================== No newline at end of file
381 391 # Acciones de los procesos No newline at end of file
382 392 #============================================================================== No newline at end of file
383 393 No newline at end of file
384 394 #------------------------------------------------ Funciones del proceso de creacion del iso ------------------------------------------------------ No newline at end of file
385 395 No newline at end of file
386 396 def readOuput_iso(self): No newline at end of file
387 397 self.txtProgress.setText("stdout iso: " + QtCore.QString(self.process_iso.readAllStandardOutput())) No newline at end of file
388 398 No newline at end of file
389 399 def readError_iso(self): No newline at end of file
390 400 self.txtProgress.setText("stderr iso: " + QtCore.QString(self.process_iso.readAllStandardError())) No newline at end of file
391 401 No newline at end of file
392 402 def finished_iso(self): No newline at end of file
393 403 self.txtProgress.clear() No newline at end of file
394 404 No newline at end of file
395 405 if not(self.bool_state_burning): No newline at end of file
396 406 return No newline at end of file
397 407 No newline at end of file
398 408 if self.process_iso.exitCode() == 0: No newline at end of file
399 409 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully\n") No newline at end of file
400 410 self.var_step = 1 No newline at end of file
401 411 self.function_burn() No newline at end of file
402 412 No newline at end of file
403 413 else:
414 No newline at end of file
404 self.txtInfo.append("#####Error creating iso file "+function.i2s(self.var_disc_n) No newline at end of file
405 415 +" , code "+QtCore.QString(self.process_iso.exitCode())) No newline at end of file
406 416 self.txtInfo.append("Please check the data") No newline at end of file
407 417 self.txtInfo.append("FATAL ERROR") No newline at end of file
408 418 No newline at end of file
409 419 #----------------------------------------------------- Funciones del proceso de grabado --------------------------------------------------------------- No newline at end of file
410 420 No newline at end of file
411 421 def readOuput_burn(self): No newline at end of file
412 422 self.txtProgress.setText("stdout burn: " + QtCore.QString(self.process_burn.readAllStandardOutput())) No newline at end of file
413 423 No newline at end of file
414 424 def readError_burn(self): No newline at end of file
415 425 self.txtProgress.setText("stderr burn: " + QtCore.QString(self.process_burn.readAllStandardError())) No newline at end of file
416 426 No newline at end of file
417 427 def finished_burn(self): No newline at end of file
418 428 self.txtProgress.clear() No newline at end of file
419 429 No newline at end of file
420 430 #Si se paro el proceso manualmente se termina No newline at end of file
421 431 if not(self.bool_state_burning): No newline at end of file
422 432 return No newline at end of file
423 433 No newline at end of file
424 434 if self.process_burn.exitCode() == 0: No newline at end of file
425 435 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n)) No newline at end of file
426 436 functions2.update_message(1, "COMPLETED", self) No newline at end of file
427 437 self.var_step = 2 No newline at end of file
428 438 self.function_check() No newline at end of file
429 439 No newline at end of file
430 440 else:
441 No newline at end of file
431 self.txtInfo.append("#######Error recording, disc: "+function.i2s(self.var_disc_n)+" copy: "
No newline at end of file
442 No newline at end of file
432 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode())) No newline at end of file
433 443 functions2.update_message(1, "ERROR", self) No newline at end of file
434 444 No newline at end of file
435 445 functions.is_last_disc_and_copy(self) No newline at end of file
436 446 No newline at end of file
437 447 No newline at end of file
438 448 #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- No newline at end of file
439 449 No newline at end of file
440 450 def readOuput_check(self): No newline at end of file
441 451 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_check.readAllStandardOutput())) No newline at end of file
442 452 No newline at end of file
443 453 def readError_check(self): No newline at end of file
444 454 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_check.readAllStandardError())) No newline at end of file
445 455 No newline at end of file
446 456 def finished_check(self): No newline at end of file
447 457 self.txtProgress.clear() No newline at end of file
448 458 No newline at end of file
449 459 if not(self.bool_state_burning): No newline at end of file
450 460 return No newline at end of file
451 461 No newline at end of file
452 462 if self.process_check.exitCode() == 0: No newline at end of file
453 463 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n)) No newline at end of file
454 464 functions2.update_message(2, "CHECKED", self) No newline at end of file
455 465 No newline at end of file
456 466 else:
467 No newline at end of file
457 self.txtInfo.append("#######Error checking, disc: "+function.i2s(self.var_disc_n)+" copy: "
No newline at end of file
468 No newline at end of file
458 +function.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode())) No newline at end of file
459 469 functions2.update_message(2, "ERROR", self) No newline at end of file
460 470 No newline at end of file
461 471 functions.is_last_disc_and_copy(self) No newline at end of file
462 472 No newline at end of file
463 473 No newline at end of file
464 474 No newline at end of file
465 475 #============================================================================== No newline at end of file
466 476 # Botones para el proceso de grabacion No newline at end of file
467 477 #============================================================================== No newline at end of file
468 478 No newline at end of file
469 479 #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- No newline at end of file
470 480 No newline at end of file
471 481 @pyqtSignature("") No newline at end of file
472 482 def on_btnStartburn_clicked(self): No newline at end of file
473 483 """ No newline at end of file
474 484 Se inicia el proceso de grabacion No newline at end of file
475 485 """ No newline at end of file
476 486 #Verifica que exista algun dispositivo de grabacion seleccionado No newline at end of file
477 487 if not(functions2.selected_devices(self)): No newline at end of file
478 488 self.txtInfo.append("There is no recording device selected") No newline at end of file
479 489 return No newline at end of file
480 490 No newline at end of file
481 491 # #Lista los dispositivos de grabacion a usar No newline at end of file
482 492 # for dev in self.var_devices: No newline at end of file
483 493 # self.txtInfo.append("recording device :"+dev) No newline at end of file
484 494 No newline at end of file
485 495 self.bool_state_burning = True No newline at end of file
486 496 functions2.enabled_items2(True, self) No newline at end of file
487 497 No newline at end of file
488 498 if self.bool_first_iso == True: No newline at end of file
489 499 self.txtInfo.append("BUTTON: on_btnStartburn_clicked") No newline at end of file
490 500 self.var_step = 4 No newline at end of file
491 501 self.function_eject() No newline at end of file
492 502 return No newline at end of file
493 503 No newline at end of file
494 504 if self.var_step == 0: No newline at end of file
495 505 self.function_iso() No newline at end of file
496 506 return No newline at end of file
497 507 No newline at end of file
498 508 if self.var_step == 1: No newline at end of file
499 509 self.function_burn() No newline at end of file
500 510 return No newline at end of file
501 511 No newline at end of file
502 512 #----------------------------------------------------- Funcion para el grabado --------------------------------------------------------------- No newline at end of file
503 513 No newline at end of file
504 514 def function_iso(self): No newline at end of file
505 515 #Creacion del archivo.iso para la grabacion No newline at end of file
506 516 if self.var_step == 0: No newline at end of file
507 517 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########") No newline at end of file
508 518 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n)) No newline at end of file
509 519 No newline at end of file
510 520 var_cmd = functions.cmd_iso(self) No newline at end of file
511 521 No newline at end of file
512 522 if self.var_real_show_cmd == True: No newline at end of file
513 523 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
514 524 No newline at end of file
515 525 if self.var_real_iso == False: No newline at end of file
516 526 self.txtInfo.append('**function_iso') No newline at end of file
517 527 var_cmd="echo 'function_iso'" No newline at end of file
518 528 No newline at end of file
519 529 self.process_iso.start(var_cmd) No newline at end of file
520 530 No newline at end of file
521 531 def function_burn(self): No newline at end of file
522 532 #Grabacion de los DVDs No newline at end of file
523 533 No newline at end of file
524 534 if self.var_step == 1: No newline at end of file
525 535 self.txtInfo.append("------Recording disc: "+str(self.var_disc_n)+", copy:"+str(self.var_copy_n)) No newline at end of file
526 536 functions2.update_message(1, "BURNING", self) No newline at end of file
527 537 No newline at end of file
528 538 var_cmd = functions.cmd_burn(self) No newline at end of file
529 539 No newline at end of file
530 540 if self.var_real_show_cmd == True: No newline at end of file
531 541 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
532 542 No newline at end of file
533 543 if self.var_real_burn == False: No newline at end of file
534 544 self.txtInfo.append('**function_burn') No newline at end of file
535 545 var_cmd="echo 'function_burn'" No newline at end of file
536 546 No newline at end of file
537 547 self.process_burn.start(var_cmd) No newline at end of file
538 548 No newline at end of file
539 549 def function_check(self): No newline at end of file
540 550 #Verificacion de los discos No newline at end of file
541 551 if self.var_step == 2: No newline at end of file
542 552 self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n)) No newline at end of file
543 553 functions2.update_message(2, "CHECKING", self) No newline at end of file
544 554 No newline at end of file
545 555 var_cmd = functions.cmd_check(self) No newline at end of file
546 556 No newline at end of file
547 557 if self.var_real_show_cmd == True: No newline at end of file
548 558 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
549 559 No newline at end of file
550 560 if self.var_real_check == False: No newline at end of file
551 561 self.txtInfo.append('**function_check') No newline at end of file
552 562 var_cmd="echo 'function_check'" No newline at end of file
553 563 No newline at end of file
554 564 self.process_check.start(var_cmd) No newline at end of file
555 565 No newline at end of file
556 566 #OK No newline at end of file
557 567 def function_eject(self): No newline at end of file
558 568 self.txtInfo.append("Ejecting recording devices") No newline at end of file
559 569 self.txtInfo.append("Please insert blank discs") No newline at end of file
560 570 No newline at end of file
561 571 if self.var_real_eject == True: No newline at end of file
562 572 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion No newline at end of file
563 573 else: No newline at end of file
564 574 self.txtInfo.append("**functions2.eject_devices") No newline at end of file
565 575 No newline at end of file
566 576 self.btnStartburn.setText("Continue") No newline at end of file
567 577 self.btnStartburn.setEnabled(True) No newline at end of file
568 578 No newline at end of file
569 579 if self.bool_first_iso == True: No newline at end of file
570 580 self.bool_first_iso = False No newline at end of file
571 581 self.var_step = 0 No newline at end of file
572 582 No newline at end of file
573 583 elif self.var_copy_n == 1: No newline at end of file
574 584 self.var_step = 0 No newline at end of file
575 585 No newline at end of file
576 586 else: No newline at end of file
577 587 self.var_step = 1 No newline at end of file
578 588 No newline at end of file
579 589 def function_final(self): No newline at end of file
580 590 self.txtInfo.append("Recording process is complete") No newline at end of file
581 591 if os.path.isfile("parameters.conf"): No newline at end of file
582 592 os.remove("parameters.conf") No newline at end of file
583 593 if os.path.isfile("burning.conf"): No newline at end of file
584 594 os.remove("burning.conf") No newline at end of file
585 595 No newline at end of file
586 596 No newline at end of file
587 597 No newline at end of file
588 598 #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- No newline at end of file
589 599 No newline at end of file
590 600 @pyqtSignature("") No newline at end of file
591 601 def on_btnStopburn_clicked(self): No newline at end of file
592 602 """ No newline at end of file
593 603 Slot documentation goes here. No newline at end of file
594 604 """ No newline at end of file
595 605 self.bool_state_burning = False No newline at end of file
596 606 No newline at end of file
597 607 if self.var_step == 0: No newline at end of file
598 608 self.process_iso.terminate() #Termina el proceso, si puede No newline at end of file
599 609 # self.process_iso.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona No newline at end of file
600 610 elif self.var_step == 1: No newline at end of file
601 611 self.process_burn.terminate() No newline at end of file
602 612 elif self.var_step == 2: No newline at end of file
603 613 self.process_check.terminate() No newline at end of file
604 614 No newline at end of file
605 615 self.txtInfo.append("Stopped recording") No newline at end of file
606 616 functions2.enabled_items2(False, self) No newline at end of file
607 617 self.bool_first_iso = True No newline at end of file
608 618 No newline at end of file
609 619 No newline at end of file
610 620 No newline at end of file
611 621 #============================================================================== No newline at end of file
612 622 # Proceso verificacion manual No newline at end of file
613 623 #============================================================================== No newline at end of file
614 624 No newline at end of file
615 625 No newline at end of file
616 626 #----------------------------------------------------- Proceso de verificaion manual --------------------------------------------------------------- No newline at end of file
617 627 No newline at end of file
618 628 No newline at end of file
619 629 @pyqtSignature("") No newline at end of file
620 630 def on_btnTDpath_clicked(self): No newline at end of file
621 631 """ No newline at end of file
622 632 Slot documentation goes here. No newline at end of file
623 633 """ No newline at end of file
624 634 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
625 635 self.txtTDpath.setText(self.var_TDpath) No newline at end of file
626 636 self.statusTDpath = functions.dir_exists(self.var_TDpath, self) No newline at end of file
627 637 No newline at end of file
628 638 No newline at end of file
629 639 @pyqtSignature("") No newline at end of file
630 640 def on_btnCHstart_clicked(self): No newline at end of file
631 641 """ No newline at end of file
632 642 Slot documentation goes here. No newline at end of file
633 643 """ No newline at end of file
634 644 pass No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now