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