@@ -1,344 +1,366 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | """ |
|
3 | """ | |
4 | Module implementing MainWindow. |
|
4 | Module implementing MainWindow. | |
5 | """ |
|
5 | """ | |
6 |
|
6 | |||
7 | from PyQt4.QtGui import QMainWindow |
|
7 | from PyQt4.QtGui import QMainWindow | |
8 | from PyQt4.QtCore import pyqtSignature |
|
8 | from PyQt4.QtCore import pyqtSignature | |
9 | from PyQt4 import QtCore |
|
9 | from PyQt4 import QtCore | |
10 | from Ui_MainWindow import Ui_MainWindow |
|
10 | from Ui_MainWindow import Ui_MainWindow | |
11 | from PyQt4 import QtGui |
|
11 | from PyQt4 import QtGui | |
12 | from subprocess import * |
|
12 | from subprocess import * | |
13 | import sys |
|
13 | import sys | |
14 | import os |
|
14 | import os | |
15 | #import subprocess |
|
15 | #import subprocess | |
16 | import commands |
|
16 | import commands | |
17 | from functions import functions |
|
17 | from functions import functions | |
18 | from functions import functions2 |
|
18 | from functions import functions2 | |
19 |
|
19 | |||
20 | class MainWindow(QMainWindow, Ui_MainWindow): |
|
20 | class MainWindow(QMainWindow, Ui_MainWindow): | |
21 | """ |
|
21 | """ | |
22 | Class documentation goes here. |
|
22 | Class documentation goes here. | |
23 | """ |
|
23 | """ | |
24 |
|
24 | |||
25 | def __init__(self, parent = None): |
|
25 | def __init__(self, parent = None): | |
26 | QMainWindow.__init__(self, parent) |
|
26 | QMainWindow.__init__(self, parent) | |
27 | self.setupUi(self) |
|
27 | self.setupUi(self) | |
28 | self.setupUi2() |
|
28 | self.setupUi2() | |
29 | #sys.stdout = self #redirige salida estandar |
|
29 | #sys.stdout = self #redirige salida estandar | |
30 |
|
30 | |||
31 | def setupUi2(self): |
|
31 | def setupUi2(self): | |
32 |
|
32 | |||
33 | functions2.detect_devices(self) #busca los dispositivos de grabacion |
|
33 | functions2.detect_devices(self) #busca los dispositivos de grabacion | |
34 |
|
34 | |||
35 | self.var_n_discs=0 |
|
35 | self.var_n_discs=0 | |
|
36 | self.var_disc=0 | |||
36 | self.var_list=[] |
|
37 | self.var_list=[] | |
37 | self.var_sublist=[] |
|
38 | self.var_sublist=[] | |
|
39 | self.bool_iso = False | |||
|
40 | self.bool_burn = False | |||
38 |
|
41 | |||
39 | #Revisa si existe el archivo de confirguracion |
|
42 | #Revisa si existe el archivo de confirguracion | |
40 | if os.path.isfile("parameters.conf"): |
|
43 | if os.path.isfile("parameters.conf"): | |
41 | self.txtInfo.append("Archivo de configuracion encontrado") |
|
44 | self.txtInfo.append("Archivo de configuracion encontrado") | |
42 | functions2.get_parameters_conf(self) |
|
45 | functions2.get_parameters_conf(self) | |
43 | self.txtInfo.append("El proyecto creara "+str(self.var_n_discs)+" DVDs") |
|
46 | self.txtInfo.append("El proyecto creara "+str(self.var_n_discs)+" DVDs") | |
44 | else: |
|
47 | else: | |
45 | self.txtInfo.append("Elija los parametros de configuracion") |
|
48 | self.txtInfo.append("Elija los parametros de configuracion") | |
46 | functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas |
|
49 | functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas | |
47 |
|
50 | |||
48 | functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados |
|
51 | functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados | |
49 |
|
52 | |||
50 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) |
|
53 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) | |
51 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) |
|
54 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) | |
52 | functions.load_days(self) |
|
55 | functions.load_days(self) | |
53 |
|
56 | |||
54 | self.var_process = QtCore.QProcess() |
|
57 | self.var_process = QtCore.QProcess() | |
55 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput) |
|
58 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput) | |
56 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError) |
|
59 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError) | |
57 | self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished) |
|
60 | self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished) | |
58 |
|
61 | |||
59 |
|
62 | |||
60 | def write(self, txt): |
|
63 | def write(self, txt): | |
61 | self.txtInfo.append(str(txt)) |
|
64 | self.txtInfo.append(str(txt)) | |
62 |
|
65 | |||
63 |
|
66 | |||
64 | #----------------------------------------------------- Funciones del proceso --------------------------------------------------------------- |
|
67 | #----------------------------------------------------- Funciones del proceso --------------------------------------------------------------- | |
65 |
|
68 | |||
66 | def readOuput(self): |
|
69 | def readOuput(self): | |
67 | self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) |
|
70 | self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) | |
68 |
|
71 | |||
69 | def readError(self): |
|
72 | def readError(self): | |
70 | self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) |
|
73 | self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) | |
71 |
|
74 | |||
72 | def finished(self): |
|
75 | def finished(self): | |
73 | self.txtInfo.append("proceso terminado finished() "+QtCore.QString(self.var_process.exitCode())) |
|
76 | self.txtInfo.append("proceso terminado finished() "+QtCore.QString(self.var_process.exitCode())) | |
|
77 | if self.var_disc <= self.var_n_discs: | |||
|
78 | self.burning() | |||
74 |
|
79 | |||
75 |
|
80 | |||
76 | #----------------------------------------------------- Obtencion de las ruta de los datos --------------------------------------------------------------- |
|
81 | #----------------------------------------------------- Obtencion de las ruta de los datos --------------------------------------------------------------- | |
77 |
|
82 | |||
78 | @pyqtSignature("") |
|
83 | @pyqtSignature("") | |
79 | def on_btnDpath_clicked(self): |
|
84 | def on_btnDpath_clicked(self): | |
80 | """ |
|
85 | """ | |
81 | Permite seleccionar graficamente el direcorio de los datos a grabar |
|
86 | Permite seleccionar graficamente el direcorio de los datos a grabar | |
82 | """ |
|
87 | """ | |
83 | self.var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) |
|
88 | self.var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) | |
84 | self.txtDpath.setText(self.var_Dpath) |
|
89 | self.txtDpath.setText(self.var_Dpath) | |
85 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) |
|
90 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) | |
86 | functions.load_days(self) |
|
91 | functions.load_days(self) | |
87 |
|
92 | |||
88 |
|
93 | |||
89 | @pyqtSignature("") |
|
94 | @pyqtSignature("") | |
90 | def on_txtDpath_editingFinished(self): |
|
95 | def on_txtDpath_editingFinished(self): | |
91 | """ |
|
96 | """ | |
92 | Carga la ruta editada y verifica que sea correcta y carga la lista de dias |
|
97 | Carga la ruta editada y verifica que sea correcta y carga la lista de dias | |
93 | """ |
|
98 | """ | |
94 | self.var_Dpath=self.txtDpath.text() #Se carga la variable con la ruta recien editada |
|
99 | self.var_Dpath=self.txtDpath.text() #Se carga la variable con la ruta recien editada | |
95 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) |
|
100 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) | |
96 | functions.load_days(self) |
|
101 | functions.load_days(self) | |
97 |
|
102 | |||
98 |
|
103 | |||
99 | #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- |
|
104 | #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- | |
100 |
|
105 | |||
101 | @pyqtSignature("") |
|
106 | @pyqtSignature("") | |
102 | def on_btnRpath_clicked(self): |
|
107 | def on_btnRpath_clicked(self): | |
103 | """ |
|
108 | """ | |
104 | Permite seleccionar graficamente el direcorio del proyecto |
|
109 | Permite seleccionar graficamente el direcorio del proyecto | |
105 | """ |
|
110 | """ | |
106 | self.var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) |
|
111 | self.var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) | |
107 | self.txtRpath.setText(self.var_Rpath) |
|
112 | self.txtRpath.setText(self.var_Rpath) | |
108 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) |
|
113 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) | |
109 |
|
114 | |||
110 |
|
115 | |||
111 | @pyqtSignature("") |
|
116 | @pyqtSignature("") | |
112 | def on_txtRpath_editingFinished(self): |
|
117 | def on_txtRpath_editingFinished(self): | |
113 | """ |
|
118 | """ | |
114 | Valida la ruta del proyecto |
|
119 | Valida la ruta del proyecto | |
115 | """ |
|
120 | """ | |
116 | self.var_Rpath=self.txtRpath.text() #Se carga la variable con la ruta recien editada |
|
121 | self.var_Rpath=self.txtRpath.text() #Se carga la variable con la ruta recien editada | |
117 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) |
|
122 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) | |
118 |
|
123 | |||
119 |
|
124 | |||
120 | #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- |
|
125 | #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- | |
121 |
|
126 | |||
122 | @pyqtSignature("int") |
|
127 | @pyqtSignature("int") | |
123 | def on_lstDtype_activated(self, index): |
|
128 | def on_lstDtype_activated(self, index): | |
124 | """ |
|
129 | """ | |
125 | Permite elegir entre los tipos de archivos |
|
130 | Permite elegir entre los tipos de archivos | |
126 | """ |
|
131 | """ | |
127 | self.txtDtype.setReadOnly(True) |
|
132 | self.txtDtype.setReadOnly(True) | |
128 | if index == 0: |
|
133 | if index == 0: | |
129 | self.var_Dtype ='r' |
|
134 | self.var_Dtype ='r' | |
130 | elif index == 1: |
|
135 | elif index == 1: | |
131 | self.var_Dtype ='pdata' |
|
136 | self.var_Dtype ='pdata' | |
132 | elif index == 2: |
|
137 | elif index == 2: | |
133 | self.var_Dtype ='sswma' |
|
138 | self.var_Dtype ='sswma' | |
134 | else : |
|
139 | else : | |
135 | self.var_Dtype ='' |
|
140 | self.var_Dtype ='' | |
136 | self.txtDtype.setReadOnly(False) |
|
141 | self.txtDtype.setReadOnly(False) | |
137 |
|
142 | |||
138 | self.txtDtype.setText(self.var_Dtype) |
|
143 | self.txtDtype.setText(self.var_Dtype) | |
139 | functions.load_days(self) #llamada a funcion |
|
144 | functions.load_days(self) #llamada a funcion | |
140 |
|
145 | |||
141 | @pyqtSignature("") |
|
146 | @pyqtSignature("") | |
142 | def on_txtDtype_editingFinished(self): |
|
147 | def on_txtDtype_editingFinished(self): | |
143 | self.var_Dtype=self.txtDtype.text() |
|
148 | self.var_Dtype=self.txtDtype.text() | |
144 | functions.load_days(self) #llamada a funcion |
|
149 | functions.load_days(self) #llamada a funcion | |
145 |
|
150 | |||
146 |
|
151 | |||
147 | #----------------------------------------------------- Etiqueta --------------------------------------------------------------- |
|
152 | #----------------------------------------------------- Etiqueta --------------------------------------------------------------- | |
148 |
|
153 | |||
149 | @pyqtSignature("") |
|
154 | @pyqtSignature("") | |
150 | def on_txtElabel_editingFinished(self): |
|
155 | def on_txtElabel_editingFinished(self): | |
151 | self.var_Elabel = self.txtElabel.text() |
|
156 | self.var_Elabel = self.txtElabel.text() | |
152 |
|
157 | |||
153 | #----------------------------------------------------- Numero de copias --------------------------------------------------------------- |
|
158 | #----------------------------------------------------- Numero de copias --------------------------------------------------------------- | |
154 | @pyqtSignature("") |
|
159 | @pyqtSignature("") | |
155 | def on_txtCopys_editingFinished(self): |
|
160 | def on_txtCopys_editingFinished(self): | |
156 | self.var_Copys = self.txtCopys.value() |
|
161 | self.var_Copys = self.txtCopys.value() | |
157 |
|
162 | |||
158 | #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- |
|
163 | #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- | |
159 |
|
164 | |||
160 | @pyqtSignature("int") #CLOSED |
|
165 | @pyqtSignature("int") #CLOSED | |
161 | def on_lstStartDay_activated(self, index): |
|
166 | def on_lstStartDay_activated(self, index): | |
162 | """ |
|
167 | """ | |
163 | Cambia la lista de opciones en lstStopDay |
|
168 | Cambia la lista de opciones en lstStopDay | |
164 | """ |
|
169 | """ | |
165 | var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() |
|
170 | var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() | |
166 | self.lstStopDay.clear() |
|
171 | self.lstStopDay.clear() | |
167 |
|
172 | |||
168 | for i in self.var_list[index:]: |
|
173 | for i in self.var_list[index:]: | |
169 | self.lstStopDay.addItem(i) |
|
174 | self.lstStopDay.addItem(i) | |
170 |
|
175 | |||
171 | self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) |
|
176 | self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) | |
172 |
|
177 | |||
173 | functions.get_sub_list(self) |
|
178 | functions.get_sub_list(self) | |
174 |
|
179 | |||
175 |
|
180 | |||
176 | @pyqtSignature("int") #CLOSED |
|
181 | @pyqtSignature("int") #CLOSED | |
177 | def on_lstStopDay_activated(self, index): |
|
182 | def on_lstStopDay_activated(self, index): | |
178 | """ |
|
183 | """ | |
179 | Cambia la lista de opciones en lstStartDay |
|
184 | Cambia la lista de opciones en lstStartDay | |
180 | """ |
|
185 | """ | |
181 | var_StartDay_index=self.lstStartDay.currentIndex() |
|
186 | var_StartDay_index=self.lstStartDay.currentIndex() | |
182 | var_end_index = self.lstStopDay.count() - index |
|
187 | var_end_index = self.lstStopDay.count() - index | |
183 | self.lstStartDay.clear() |
|
188 | self.lstStartDay.clear() | |
184 |
|
189 | |||
185 | for i in self.var_list[:len(self.var_list) - var_end_index + 1]: |
|
190 | for i in self.var_list[:len(self.var_list) - var_end_index + 1]: | |
186 | self.lstStartDay.addItem(i) |
|
191 | self.lstStartDay.addItem(i) | |
187 |
|
192 | |||
188 | self.lstStartDay.setCurrentIndex(var_StartDay_index) |
|
193 | self.lstStartDay.setCurrentIndex(var_StartDay_index) | |
189 |
|
194 | |||
190 | functions.get_sub_list(self) |
|
195 | functions.get_sub_list(self) | |
191 |
|
196 | |||
192 |
|
197 | |||
193 | #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- |
|
198 | #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- | |
194 |
|
199 | |||
195 | @pyqtSignature("") |
|
200 | @pyqtSignature("") | |
196 | def on_txtDcapacity_editingFinished(self): |
|
201 | def on_txtDcapacity_editingFinished(self): | |
197 | self.var_Dcapacity = self.txtDcapacity.value() |
|
202 | self.var_Dcapacity = self.txtDcapacity.value() | |
198 |
|
203 | |||
199 |
|
204 | |||
200 | @pyqtSignature("int") #CLOSED |
|
205 | @pyqtSignature("int") #CLOSED | |
201 | def on_lstDcapacity_activated(self, index): |
|
206 | def on_lstDcapacity_activated(self, index): | |
202 | """ |
|
207 | """ | |
203 | Permite elegir el tamaΓ±o del disco |
|
208 | Permite elegir el tamaΓ±o del disco | |
204 | """ |
|
209 | """ | |
205 | if index == 0: |
|
210 | if index == 0: | |
206 | var_size=25.0 |
|
211 | var_size=25.0 | |
207 | elif index == 1: |
|
212 | elif index == 1: | |
208 | var_size=8.5 |
|
213 | var_size=8.5 | |
209 | elif index == 2: |
|
214 | elif index == 2: | |
210 | var_size=4.7 |
|
215 | var_size=4.7 | |
211 | elif index == 3: |
|
216 | elif index == 3: | |
212 | var_size=0.7 |
|
217 | var_size=0.7 | |
213 |
|
218 | |||
214 | if index != 4: |
|
219 | if index != 4: | |
215 | self.txtDcapacity.setValue(var_size*10**9/1024**2) |
|
220 | self.txtDcapacity.setValue(var_size*10**9/1024**2) | |
216 | self.txtDcapacity.setReadOnly(True) |
|
221 | self.txtDcapacity.setReadOnly(True) | |
217 | else: |
|
222 | else: | |
218 | self.txtDcapacity.setValue(100.0) |
|
223 | self.txtDcapacity.setValue(100.0) | |
219 | self.txtDcapacity.setReadOnly(False) |
|
224 | self.txtDcapacity.setReadOnly(False) | |
220 |
|
225 | |||
221 | self.var_Dcapacity = self.txtDcapacity.value() |
|
226 | self.var_Dcapacity = self.txtDcapacity.value() | |
222 |
|
227 | |||
223 |
|
228 | |||
224 | #============================================================================== |
|
229 | #============================================================================== | |
225 | # Botones para la generacion de los archivos de configuracion y el proceso de grabacion |
|
230 | # Botones para la generacion de los archivos de configuracion y el proceso de grabacion | |
226 | #============================================================================== |
|
231 | #============================================================================== | |
227 |
|
232 | |||
228 | #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- |
|
233 | #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- | |
229 |
|
234 | |||
230 | @pyqtSignature("") |
|
235 | @pyqtSignature("") | |
231 | def on_btnGbkp_clicked(self): |
|
236 | def on_btnGbkp_clicked(self): | |
232 | """ |
|
237 | """ | |
233 | Generacion de archivos de configuracion usando los parametros |
|
238 | Generacion de archivos de configuracion usando los parametros | |
234 | """ |
|
239 | """ | |
235 |
|
240 | |||
236 | if functions.validate_parameters(self) == False: |
|
241 | if functions.validate_parameters(self) == False: | |
237 | return |
|
242 | return | |
238 |
|
243 | |||
239 | #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente |
|
244 | #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente | |
240 | list_dirs=['gpath','iso','ppath'] |
|
245 | list_dirs=['gpath','iso','ppath'] | |
241 | bool_make_dirs = functions.make_dirs(list_dirs, self) |
|
246 | bool_make_dirs = functions.make_dirs(list_dirs, self) | |
242 | if bool_make_dirs == False: |
|
247 | if bool_make_dirs == False: | |
243 | return |
|
248 | return | |
244 |
|
249 | |||
245 | var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar |
|
250 | var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar | |
246 | self.var_n_discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat |
|
251 | self.var_n_discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat | |
247 | functions.make_files_print(self) # Se crean los archivos .print |
|
252 | functions.make_files_print(self) # Se crean los archivos .print | |
248 | functions2.make_parameters_conf(self) # se crea el archivo parameters.conf |
|
253 | functions2.make_parameters_conf(self) # se crea el archivo parameters.conf | |
249 |
|
254 | |||
250 | #Se bloquean los parametros de configuracion |
|
255 | #Se bloquean los parametros de configuracion | |
251 | functions2.enabled_items1(True, self) |
|
256 | functions2.enabled_items1(True, self) | |
252 |
|
257 | |||
253 |
|
258 | |||
254 | #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- |
|
259 | #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- | |
255 |
|
260 | |||
256 | @pyqtSignature("") |
|
261 | @pyqtSignature("") | |
257 | def on_btnRestart_clicked(self): |
|
262 | def on_btnRestart_clicked(self): | |
258 | """ |
|
263 | """ | |
259 | Permite que se puedan cambiar los parametros |
|
264 | Permite que se puedan cambiar los parametros | |
260 | """ |
|
265 | """ | |
261 | functions2.enabled_items1(False, self) |
|
266 | functions2.enabled_items1(False, self) | |
262 | os.remove("parameters.conf") |
|
267 | os.remove("parameters.conf") | |
263 |
|
268 | |||
264 |
|
269 | |||
265 | #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- |
|
270 | #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- | |
266 |
|
271 | |||
267 | @pyqtSignature("") |
|
272 | @pyqtSignature("") | |
268 | def on_btnStartburn_clicked(self): |
|
273 | def on_btnStartburn_clicked(self): | |
269 | """ |
|
274 | """ | |
270 | Se inicia el proceso de grabacion |
|
275 | Se inicia el proceso de grabacion | |
271 | """ |
|
276 | """ | |
272 | functions2.enabled_items2(True, self) |
|
277 | functions2.enabled_items2(True, self) | |
273 |
|
278 | |||
274 | sys.stdout = self |
|
279 | sys.stdout = self | |
275 | #sys.stderr = self |
|
280 | # #sys.stderr = self | |
276 | print "stdout_!!!" |
|
281 | # print "stdout_!!!" | |
277 |
|
282 | |||
278 |
|
283 | self.var_devices=[] | ||
279 |
|
284 | if self.chkDevA.isChecked(): | ||
280 | #Inicializando variables |
|
285 | self.var_devices.append(self.txtDeviceA.text()) | |
|
286 | if self.chkDevB.isChecked(): | |||
|
287 | self.var_devices.append(self.txtDeviceB.text()) | |||
|
288 | if self.chkDevC.isChecked(): | |||
|
289 | self.var_devices.append(self.txtDeviceC.text()) | |||
|
290 | if self.chkDevD.isChecked(): | |||
|
291 | self.var_devices.append(self.txtDeviceD.text()) | |||
|
292 | ||||
|
293 | if len(self.var_devices) ==0: | |||
|
294 | return | |||
|
295 | ||||
|
296 | for dev in self.var_devices: | |||
|
297 | self.txtInfo.append("dispositivo :"+dev) | |||
|
298 | ||||
|
299 | self.var_disc = 1 | |||
|
300 | self.burning() | |||
|
301 | ||||
|
302 | def burning(self): | |||
|
303 | ||||
281 | var_Rpath_ppath=self.var_Rpath+"/ppath" |
|
304 | var_Rpath_ppath=self.var_Rpath+"/ppath" | |
282 | var_Rpath_iso=self.var_Rpath+"/iso" |
|
305 | var_Rpath_iso=self.var_Rpath+"/iso" | |
283 |
|
306 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc)+".iso" | ||
284 | var_n=1 |
|
307 | ||
285 | file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso" |
|
308 | if not(self.bool_iso): | |
286 | file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat" |
|
309 | self.bool_iso = True | |
287 |
|
310 | self.bool_burn = False | ||
288 | var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' |
|
311 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc)+".iso" | |
289 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel |
|
312 | file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(self.var_disc)+".dat" | |
290 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso |
|
313 | var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' | |
291 |
|
314 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel | ||
292 | self.var_process.start(var_cmd) |
|
315 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso | |
293 | self.txtInfo.append("ejecutandose") |
|
316 | ||
294 |
|
317 | elif not(self.bool_burn): | ||
295 |
|
318 | self.bool_iso = False | ||
296 | # # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps |
|
319 | self.bool_burn = True | |
297 | # for var_n in range(1, self.var_n_discs+1): |
|
320 | var_dev_tmp=self.var_devices[ (self.var_disc-1) % len(self.var_devices) ] | |
298 | # self.txtInfo.append(str(var_n)) |
|
321 | var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso | |
299 | # file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso" |
|
322 | self.var_disc += 1 | |
300 | # file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat" |
|
323 | ||
301 | # |
|
324 | self.var_process.start('ls') | |
302 | # var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' |
|
325 | self.txtInfo.append(var_cmd) | |
303 | # var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel |
|
326 | ||
304 | # var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso |
|
327 | # self.txtInfo.append("creando iso") | |
305 |
# |
|
328 | # self.var_process.start(var_cmd) | |
306 | # |
|
|||
307 |
|
329 | |||
308 |
|
330 | |||
309 | #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- |
|
331 | #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- | |
310 |
|
332 | |||
311 | @pyqtSignature("") |
|
333 | @pyqtSignature("") | |
312 | def on_btnStopburn_clicked(self): |
|
334 | def on_btnStopburn_clicked(self): | |
313 | """ |
|
335 | """ | |
314 | Slot documentation goes here. |
|
336 | Slot documentation goes here. | |
315 | """ |
|
337 | """ | |
316 | self.var_process.terminate() #Termina el proceso, si puede |
|
338 | self.var_process.terminate() #Termina el proceso, si puede | |
317 | functions2.enabled_items2(False, self) |
|
339 | functions2.enabled_items2(False, self) | |
318 |
|
340 | |||
319 |
|
341 | |||
320 | #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- |
|
342 | #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- | |
321 |
|
343 | |||
322 | @pyqtSignature("") |
|
344 | @pyqtSignature("") | |
323 | def on_btnTdevA_clicked(self): |
|
345 | def on_btnTdevA_clicked(self): | |
324 | var_dev = str(self.txtDeviceA.text()) |
|
346 | var_dev = str(self.txtDeviceA.text()) | |
325 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
347 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |
326 | commands.getstatusoutput(var_cmd) |
|
348 | commands.getstatusoutput(var_cmd) | |
327 |
|
349 | |||
328 | @pyqtSignature("") |
|
350 | @pyqtSignature("") | |
329 | def on_btnTdevB_clicked(self): |
|
351 | def on_btnTdevB_clicked(self): | |
330 | var_dev = str(self.txtDeviceB.text()) |
|
352 | var_dev = str(self.txtDeviceB.text()) | |
331 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
353 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |
332 | commands.getstatusoutput(var_cmd) |
|
354 | commands.getstatusoutput(var_cmd) | |
333 |
|
355 | |||
334 | @pyqtSignature("") |
|
356 | @pyqtSignature("") | |
335 | def on_btnTdevC_clicked(self): |
|
357 | def on_btnTdevC_clicked(self): | |
336 | var_dev = str(self.txtDeviceC.text()) |
|
358 | var_dev = str(self.txtDeviceC.text()) | |
337 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
359 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |
338 | commands.getstatusoutput(var_cmd) |
|
360 | commands.getstatusoutput(var_cmd) | |
339 |
|
361 | |||
340 | @pyqtSignature("") |
|
362 | @pyqtSignature("") | |
341 | def on_btnTdevD_clicked(self): |
|
363 | def on_btnTdevD_clicked(self): | |
342 | var_dev = str(self.txtDeviceD.text()) |
|
364 | var_dev = str(self.txtDeviceD.text()) | |
343 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
365 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev | |
344 | commands.getstatusoutput(var_cmd) |
|
366 | commands.getstatusoutput(var_cmd) |
General Comments 0
You need to be logged in to leave comments.
Login now