##// END OF EJS Templates
falta verificacion
ralonso -
r73:74
parent child
Show More
@@ -1,192 +1,242
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 from subprocess import * No newline at end of file
4 from subprocess import *
5 import sys No newline at end of file
5 import sys
6 import os No newline at end of file
6 import os
7 import subprocess No newline at end of file
7 import subprocess
8 import commands No newline at end of file
8 import commands
9 No newline at end of file
9
10 #----------------------------------------------------- Deteccion de los dispositivos de grabacion --------------------------------------------------------------- No newline at end of file
10 #----------------------------------------------------- Deteccion de los dispositivos de grabacion ---------------------------------------------------------------
11 No newline at end of file
11
12 def detect_devices(self): No newline at end of file
12 def detect_devices(self):
13 """ No newline at end of file
13 """
14 Deteccion de los dispositvos de grabacion No newline at end of file
14 Deteccion de los dispositvos de grabacion
15 """ No newline at end of file
15 """
16 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ? No newline at end of file
16 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ?
17 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'" No newline at end of file
17 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'"
18 No newline at end of file
18
19 var_output = commands.getstatusoutput(var_cmd) No newline at end of file
19 var_output = commands.getstatusoutput(var_cmd)
20 if var_output[0] != 0: No newline at end of file
20 if var_output[0] != 0:
21 self.txtInfo.append("No recording devices") No newline at end of file
21 self.txtInfo.append("No recording devices")
22 else: No newline at end of file
22 else:
23 # self.txtInfo.append("dispositivos encontrados") No newline at end of file
23 # self.txtInfo.append("dispositivos encontrados")
24 var_devices = var_output[1].split('\n') No newline at end of file
24 var_devices = var_output[1].split('\n')
25 No newline at end of file
25
26 var_tmp=[] No newline at end of file
26 var_tmp=[]
27 for i in range(0, 4): No newline at end of file
27 for i in range(0, 4):
28 if i < len(var_devices): No newline at end of file
28 if i < len(var_devices):
29 var_len = len(var_devices[i]) No newline at end of file
29 var_len = len(var_devices[i])
30 var_tmp.append(var_devices[i][1:var_len - 1]) No newline at end of file
30 var_tmp.append(var_devices[i][1:var_len - 1])
31 else: No newline at end of file
31 else:
32 var_tmp.append('') No newline at end of file
32 var_tmp.append('')
33 No newline at end of file
33
34 #Se escriben los dispostivos correspodientes, si existen No newline at end of file
34 #Se escriben los dispostivos correspodientes, si existen
35 self.txtDeviceA.setText(str(var_tmp[0])) No newline at end of file
35 self.txtDeviceA.setText(str(var_tmp[0]))
36 self.txtDeviceB.setText(str(var_tmp[1])) No newline at end of file
36 self.txtDeviceB.setText(str(var_tmp[1]))
37 self.txtDeviceC.setText(str(var_tmp[2])) No newline at end of file
37 self.txtDeviceC.setText(str(var_tmp[2]))
38 self.txtDeviceD.setText(str(var_tmp[3])) No newline at end of file
38 self.txtDeviceD.setText(str(var_tmp[3]))
39 #Se desactivan los que no existen No newline at end of file
39 #Se desactivan los que no existen
40 if len(var_tmp[0]) == 0 : No newline at end of file
40 if len(var_tmp[0]) == 0 :
41 self.chkDevA.setChecked(False) No newline at end of file
41 self.chkDevA.setChecked(False)
42 self.chkDevA.setEnabled(False) No newline at end of file
42 self.chkDevA.setEnabled(False)
43 if len(var_tmp[1]) == 0 : No newline at end of file
43 if len(var_tmp[1]) == 0 :
44 self.chkDevB.setChecked(False) No newline at end of file
44 self.chkDevB.setChecked(False)
45 self.chkDevB.setEnabled(False) No newline at end of file
45 self.chkDevB.setEnabled(False)
46 if len(var_tmp[2]) == 0 : No newline at end of file
46 if len(var_tmp[2]) == 0 :
47 self.chkDevC.setChecked(False) No newline at end of file
47 self.chkDevC.setChecked(False)
48 self.chkDevC.setEnabled(False) No newline at end of file
48 self.chkDevC.setEnabled(False)
49 if len(var_tmp[3]) == 0 : No newline at end of file
49 if len(var_tmp[3]) == 0 :
50 self.chkDevD.setChecked(False) No newline at end of file
50 self.chkDevD.setChecked(False)
51 self.chkDevD.setEnabled(False) No newline at end of file
51 self.chkDevD.setEnabled(False)
52 No newline at end of file
52
53 #----------------------------------- expulsa los dispositivos de grabacion -------------------------------------------- No newline at end of file
53 #----------------------------------- expulsa los dispositivos de grabacion --------------------------------------------
54 No newline at end of file
54
55 def eject_devices(self): No newline at end of file
55 def eject_devices(self):
56 self.txtInfo.append("Ejecting recording devices") No newline at end of file
56 self.txtInfo.append("Ejecting recording devices")
57 return No newline at end of file
57 return
58 for var_dev in self.var_devices: No newline at end of file
58 for var_dev in self.var_devices:
59 var_cmd = 'eject ' + var_dev No newline at end of file
59 var_cmd = 'eject ' + var_dev
60 commands.getstatusoutput(var_cmd) No newline at end of file
60 commands.getstatusoutput(var_cmd)
61 No newline at end of file
61
62 #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- No newline at end of file
62 #----------------------------------- listado de los dispositivos de grabacion seleccionados --------------------------------------------
63 No newline at end of file
63
64 def selected_devices(self): No newline at end of file
64 def selected_devices(self):
65 self.var_devices=[] No newline at end of file
65 self.var_devices=[]
66 if self.chkDevA.isChecked(): No newline at end of file
66 if self.chkDevA.isChecked():
67 self.var_devices.append(str(self.txtDeviceA.text())) No newline at end of file
67 self.var_devices.append(str(self.txtDeviceA.text()))
68 if self.chkDevB.isChecked(): No newline at end of file
68 if self.chkDevB.isChecked():
69 self.var_devices.append(str(self.txtDeviceB.text())) No newline at end of file
69 self.var_devices.append(str(self.txtDeviceB.text()))
70 if self.chkDevC.isChecked(): No newline at end of file
70 if self.chkDevC.isChecked():
71 self.var_devices.append(str(self.txtDeviceC.text())) No newline at end of file
71 self.var_devices.append(str(self.txtDeviceC.text()))
72 if self.chkDevD.isChecked(): No newline at end of file
72 if self.chkDevD.isChecked():
73 self.var_devices.append(str(self.txtDeviceD.text())) No newline at end of file
73 self.var_devices.append(str(self.txtDeviceD.text()))
74 No newline at end of file
74
75 if len(self.var_devices) == 0: No newline at end of file
75 if len(self.var_devices) == 0:
76 return False No newline at end of file
76 return False
77 else: No newline at end of file
77 else:
78 return True No newline at end of file
78 return True
79 No newline at end of file
79
80 No newline at end of file
80
81 #----------------------------------------------------- Inicializacion para pruebas--------------------------------------------------------------- No newline at end of file
81 #----------------------------------------------------- Inicializacion para pruebas---------------------------------------------------------------
82 No newline at end of file
82
83 def set_parameters_test(self): No newline at end of file
83 def set_parameters_test(self):
84 """ No newline at end of file
84 """
85 Se usa para inicializar ciertos parametros para pruebas No newline at end of file
85 Se usa para inicializar ciertos parametros para pruebas
86 """ No newline at end of file
86 """
87 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS') No newline at end of file
87 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS')
88 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager') No newline at end of file
88 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager')
89 self.txtElabel.setText('EW_DRIFTS_pruebas') No newline at end of file
89 self.txtElabel.setText('EW_DRIFTS_pruebas')
90 self.lstDcapacity.setCurrentIndex(4) No newline at end of file
90 self.lstDcapacity.setCurrentIndex(4)
91 self.txtDcapacity.setValue(100.0) No newline at end of file
91 self.txtDcapacity.setValue(100.0)
92 self.txtDcapacity.setReadOnly(False) No newline at end of file
92 self.txtDcapacity.setReadOnly(False)
93 self.txtDeviceA.setText("/dev/scd0") No newline at end of file
93 self.txtDeviceA.setText("/dev/scd0")
94 self.txtDeviceB.setText("/dev/scd1") No newline at end of file
94 self.txtDeviceB.setText("/dev/scd1")
95 self.txtDeviceC.setText("/dev/scd2") No newline at end of file
95 self.txtDeviceC.setText("/dev/scd2")
96 self.txtDeviceD.setText("/dev/scd3") No newline at end of file
96 self.txtDeviceD.setText("/dev/scd3")
97 No newline at end of file
97
98 No newline at end of file
98
99 No newline at end of file
99
100 #----------------------------------------------------- crea parameters.conf --------------------------------------------------------------- No newline at end of file
100 #----------------------------------------------------- crea parameters.conf ---------------------------------------------------------------
101 No newline at end of file
101
102 def make_parameters_conf(self): No newline at end of file
102 def make_parameters_conf(self):
103 var_file = open("parameters.conf","w") No newline at end of file
103 var_file = open("parameters.conf","w")
104 var_file.write(self.var_Dpath+"\n") #0 Ruta de los datos No newline at end of file
104 var_file.write(self.var_Dpath+"\n") #0 Ruta de los datos
105 var_file.write(self.var_Rpath+"\n") #1 Ruta del proyecto No newline at end of file
105 var_file.write(self.var_Rpath+"\n") #1 Ruta del proyecto
106 var_file.write(str(self.var_lstDtype)+"\n") #2 opcion Data Type No newline at end of file
106 var_file.write(str(self.var_lstDtype)+"\n") #2 opcion Data Type
107 var_file.write(self.var_Dtype+"\n") #3 extension Data Type No newline at end of file
107 var_file.write(self.var_Dtype+"\n") #3 extension Data Type
108 var_file.write(self.var_Elabel+"\n") #4 etiqueta No newline at end of file
108 var_file.write(self.var_Elabel+"\n") #4 etiqueta
109 var_file.write(str(self.var_Copys)+"\n") #5 Numero de copias No newline at end of file
109 var_file.write(str(self.var_Copys)+"\n") #5 Numero de copias
110 var_file.write(str(self.var_lstDcapacity)+"\n") #6 opcion Device Capacity No newline at end of file
110 var_file.write(str(self.var_lstDcapacity)+"\n") #6 opcion Device Capacity
111 var_file.write(str(self.var_Dcapacity)+"\n") #7 tamaΓ±o Device Capacity No newline at end of file
111 var_file.write(str(self.var_Dcapacity)+"\n") #7 tamaΓ±o Device Capacity
112 var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar No newline at end of file
112 var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar
113 # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial No newline at end of file
113 # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial
114 # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final No newline at end of file
114 # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final
115 No newline at end of file
115
116 var_file.close() No newline at end of file
116 var_file.close()
117 No newline at end of file
117
118 #----------------------------------------------------- carga parameters.conf --------------------------------------------------------------- No newline at end of file
118 #----------------------------------------------------- carga parameters.conf ---------------------------------------------------------------
119 No newline at end of file
119
120 def get_parameters_conf(self): No newline at end of file
120 def get_parameters_conf(self):
121 var_file = open("parameters.conf","r") No newline at end of file
121 var_file = open("parameters.conf","r")
122 lines = var_file.readlines() No newline at end of file
122 lines = var_file.readlines()
123 self.txtDpath.setText(lines[0][:-1]) #0 No newline at end of file
123 self.txtDpath.setText(lines[0][:-1]) #0
124 self.txtRpath.setText(lines[1][:-1]) #1 No newline at end of file
124 self.txtRpath.setText(lines[1][:-1]) #1
125 self.lstDtype.setCurrentIndex(int(lines[2])) #2 No newline at end of file
125 self.lstDtype.setCurrentIndex(int(lines[2])) #2
126 self.txtDtype.setText(lines[3][:-1]) #3 No newline at end of file
126 self.txtDtype.setText(lines[3][:-1]) #3
127 self.txtElabel.setText(lines[4][:-1]) #4 No newline at end of file
127 self.txtElabel.setText(lines[4][:-1]) #4
128 self.txtCopys.setValue(int(lines[5][:-1])) #5 No newline at end of file
128 self.txtCopys.setValue(int(lines[5][:-1])) #5
129 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6 No newline at end of file
129 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6
130 self.txtDcapacity.setValue(float(lines[7])) #7 No newline at end of file
130 self.txtDcapacity.setValue(float(lines[7])) #7
131 self.var_Discs = int(lines[8]) #8 No newline at end of file
131 self.var_Discs = int(lines[8]) #8
132 # var_StartDay = int(lines[6]) #9 No newline at end of file
132 # var_StartDay = int(lines[6]) #9
133 # var_StopDay = int(lines[7]) #10 No newline at end of file
133 # var_StopDay = int(lines[7]) #10
134 ################################ No newline at end of file
134 ################################
135 self.var_Copys = self.txtCopys.value() #5 No newline at end of file
135 self.var_Copys = self.txtCopys.value() #5
136 ################################ No newline at end of file
136 ################################
137 No newline at end of file
137
138 var_file.close() No newline at end of file
138 var_file.close()
139 No newline at end of file
139
140 No newline at end of file
140
141 No newline at end of file
141
142 #-------------------------- actualiza el valor de las variables con los parametros seleccionados ----------------------------- No newline at end of file
142 #-------------------------- actualiza el valor de las variables con los parametros seleccionados -----------------------------
143 No newline at end of file
143
144 def set_vars(self): No newline at end of file
144 def set_vars(self):
145 self.var_Dpath = str(self.txtDpath.text()) #0 No newline at end of file
145 self.var_Dpath = str(self.txtDpath.text()) #0
146 self.var_Rpath = str(self.txtRpath.text()) #1 No newline at end of file
146 self.var_Rpath = str(self.txtRpath.text()) #1
147 self.var_lstDtype = self.lstDtype.currentIndex() #2 No newline at end of file
147 self.var_lstDtype = self.lstDtype.currentIndex() #2
148 self.var_Dtype = str(self.txtDtype.text()) #3 No newline at end of file
148 self.var_Dtype = str(self.txtDtype.text()) #3
149 self.var_Elabel = str(self.txtElabel.text()) #4 No newline at end of file
149 self.var_Elabel = str(self.txtElabel.text()) #4
150 self.var_Copys = self.txtCopys.value() #5 No newline at end of file
150 self.var_Copys = self.txtCopys.value() #5
151 self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6 No newline at end of file
151 self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6
152 self.var_Dcapacity = self.txtDcapacity.value() #7 No newline at end of file
152 self.var_Dcapacity = self.txtDcapacity.value() #7
153 self.var_Discs = self.var_Discs #8 No newline at end of file
153 self.var_Discs = self.var_Discs #8
154 No newline at end of file
154
155 No newline at end of file
155
156 #-------------------------- crea burning.conf ----------------------------- No newline at end of file
156 #-------------------------- crea burning.conf -----------------------------
157 No newline at end of file
157
158 def make_burning_conf(self): No newline at end of file
158 def make_burning_conf(self):
159 var_file = open("burning.conf","w") No newline at end of file
159 var_file = open("burning.conf","w")
160 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 ) No newline at end of file
160 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
161 var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados No newline at end of file
161 var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados
162 var_file.write(str(self.var_disc_n)+"\n") #1 Disco actual para grabar No newline at end of file
162 var_file.write(str(self.var_disc_n)+"\n") #1 Disco actual para grabar
163 var_file.write(str(self.var_copy_n)+"\n") #2 Numero de copia actual para grabar No newline at end of file
163 var_file.write(str(self.var_copy_n)+"\n") #2 Numero de copia actual para grabar
164 var_file.close() No newline at end of file
164 var_file.close()
165 No newline at end of file
165
166 #----------------------------------------------------- carga burning.conf --------------------------------------------------------------- No newline at end of file
166 #----------------------------------------------------- carga burning.conf ---------------------------------------------------------------
167 No newline at end of file
167
168 def get_burning_conf(self): No newline at end of file
168 def get_burning_conf(self):
169 var_file = open("burning.conf","r") No newline at end of file
169 var_file = open("burning.conf","r")
170 lines = var_file.readlines() No newline at end of file
170 lines = var_file.readlines()
171 self.var_burned_discs = int(lines[0]) #0 No newline at end of file
171 self.var_burned_discs = int(lines[0]) #0
172 self.var_disc_n = int(lines[1]) No newline at end of file
172 self.var_disc_n = int(lines[1])
173 self.var_copy_n = int(lines[2]) No newline at end of file
173 self.var_copy_n = int(lines[2])
174 var_file.close() No newline at end of file
174 var_file.close()
175 No newline at end of file
175
176 #---------------------------------------------- Habilitacion y deshabilitacion de items ------------------------------------------------------- No newline at end of file
176 #---------------------------------------------- Habilitacion y deshabilitacion de items -------------------------------------------------------
177 No newline at end of file
177
178 def enabled_items1(var_bool, self): No newline at end of file
178 def enabled_items1(var_bool, self):
179 self.tabParameters.setEnabled(not(var_bool)) No newline at end of file
179 self.tabParameters.setEnabled(not(var_bool))
180 self.lstDcapacity.setEnabled(not(var_bool)) No newline at end of file
180 self.lstDcapacity.setEnabled(not(var_bool))
181 self.txtDcapacity.setEnabled(not(var_bool)) No newline at end of file
181 self.txtDcapacity.setEnabled(not(var_bool))
182 self.actionChange_Parameters.setEnabled(var_bool) No newline at end of file
182 self.actionChange_Parameters.setEnabled(var_bool)
183 self.btnGbkp.setEnabled(not(var_bool)) No newline at end of file
183 self.btnGbkp.setEnabled(not(var_bool))
184 self.btnRestart.setEnabled(var_bool) No newline at end of file
184 self.btnRestart.setEnabled(var_bool)
185 self.btnStartburn.setEnabled(var_bool) No newline at end of file
185 self.btnStartburn.setEnabled(var_bool)
186 No newline at end of file
186
187 No newline at end of file
187
188 def enabled_items2(var_bool, self): No newline at end of file
188 def enabled_items2(var_bool, self):
189 self.btnRestart.setEnabled(not(var_bool)) No newline at end of file
189 self.btnRestart.setEnabled(not(var_bool))
190 self.btnStartburn.setEnabled(not(var_bool)) No newline at end of file
190 self.btnStartburn.setEnabled(not(var_bool))
191 self.btnStopburn.setEnabled(var_bool) No newline at end of file
191 self.btnStopburn.setEnabled(var_bool)
192 self.chkCheck.setEnabled(not(var_bool)) No newline at end of file
192 self.chkCheck.setEnabled(not(var_bool))
193 self.actionChange_Parameters.setEnabled(False)
No newline at end of file
194
No newline at end of file
195
No newline at end of file
196
No newline at end of file
197
No newline at end of file
198 #---------------------------------------------- Actualiza estado en los labels -------------------------------------------------------
No newline at end of file
199
No newline at end of file
200 def update_message(type, self):
No newline at end of file
201
No newline at end of file
202 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
No newline at end of file
203
No newline at end of file
204 if type == 1:
No newline at end of file
205 var_message = "BURNING"
No newline at end of file
206 if var_index == 0:
No newline at end of file
207 self.txtBstatusA.setText(var_message)
No newline at end of file
208 self.txtBdiscA.setText(str(self.var_disc_n))
No newline at end of file
209 self.txtBcopyA.setText(str(self.var_copy_n))
No newline at end of file
210
No newline at end of file
211 if var_index == 1:
No newline at end of file
212 self.txtBstatusB.setText(var_message)
No newline at end of file
213 self.txtBdiscB.setText(str(self.var_disc_n))
No newline at end of file
214 self.txtBcopyB.setText(str(self.var_copy_n))
No newline at end of file
215
No newline at end of file
216 if var_index == 2:
No newline at end of file
217 self.txtBstatusC.setText(var_message)
No newline at end of file
218 self.txtBdiscC.setText(str(self.var_disc_n))
No newline at end of file
219 self.txtBcopyC.setText(str(self.var_copy_n))
No newline at end of file
220
No newline at end of file
221 if var_index == 3:
No newline at end of file
222 self.txtBstatusD.setText(var_message)
No newline at end of file
223 self.txtBdiscD.setText(str(self.var_disc_n))
No newline at end of file
224 self.txtBcopyD.setText(str(self.var_copy_n))
No newline at end of file
225
No newline at end of file
226 if type == 2:
No newline at end of file
227 var_message = "COMPLETED"
No newline at end of file
228 if var_index == 0:
No newline at end of file
229 self.txtBstatusA.setText(var_message)
No newline at end of file
230
No newline at end of file
231 if var_index == 1:
No newline at end of file
232 self.txtBstatusB.setText(var_message)
No newline at end of file
233
No newline at end of file
234 if var_index == 2:
No newline at end of file
235 self.txtBstatusC.setText(var_message)
No newline at end of file
236
No newline at end of file
237 if var_index == 3:
No newline at end of file
238 self.txtBstatusD.setText(var_message)
No newline at end of file
239
No newline at end of file
240
No newline at end of file
241
No newline at end of file
242 No newline at end of file
@@ -1,517 +1,523
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 Ui_Parameters import Ui_Parameters No newline at end of file
11 from Ui_Parameters import Ui_Parameters
12 from Ui_About import Ui_About No newline at end of file
12 from Ui_About import Ui_About
13 from PyQt4 import QtGui No newline at end of file
13 from PyQt4 import QtGui
14 from subprocess import * No newline at end of file
14 from subprocess import *
15 import sys No newline at end of file
15 import sys
16 import os No newline at end of file
16 import os
17 #import subprocess No newline at end of file
17 #import subprocess
18 import commands No newline at end of file
18 import commands
19 from functions import functions No newline at end of file
19 from functions import functions
20 from functions import functions2 No newline at end of file
20 from functions import functions2
21 No newline at end of file
21
22 class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file
22 class MainWindow(QMainWindow, Ui_MainWindow):
23 """ No newline at end of file
23 """
24 Class documentation goes here. No newline at end of file
24 Class documentation goes here.
25 """ No newline at end of file
25 """
26 No newline at end of file
26
27 def __init__(self, parent = None): No newline at end of file
27 def __init__(self, parent = None):
28 QMainWindow.__init__(self, parent) No newline at end of file
28 QMainWindow.__init__(self, parent)
29 self.setupUi(self) No newline at end of file
29 self.setupUi(self)
30 No newline at end of file
30
31 self.setupUi2() No newline at end of file
31 self.setupUi2()
32 #sys.stdout = self #redirige salida estandar No newline at end of file
32 #sys.stdout = self #redirige salida estandar
33 No newline at end of file
33
34 def setupUi2(self): No newline at end of file
34 def setupUi2(self):
35 No newline at end of file
35
36 # functions2.detect_devices(self) #busca los dispositivos de grabacion No newline at end of file
36 # functions2.detect_devices(self) #busca los dispositivos de grabacion
37 No newline at end of file
37
38 self.var_Discs = 0 #Numero de discos del proyecto No newline at end of file
38 self.var_Discs = 0 #Numero de discos del proyecto
39 self.var_Copys = 0 #Numero de copias No newline at end of file
39 self.var_Copys = 0 #Numero de copias
40 self.var_disc_n = 0 No newline at end of file
40 self.var_disc_n = 0
41 self.var_copy_n = 0 No newline at end of file
41 self.var_copy_n = 0
42 self.var_burned_discs = 0 No newline at end of file
42 self.var_burned_discs = 0
43 No newline at end of file
43
44 self.var_list=[] No newline at end of file
44 self.var_list=[]
45 self.var_sublist=[] No newline at end of file
45 self.var_sublist=[]
46 No newline at end of file
46
47 self.var_devices=[] No newline at end of file
47 self.var_devices=[]
48 No newline at end of file
48
49 self.var_step = 0 No newline at end of file
49 self.var_step = 0
50 self.bool_state_burning = False No newline at end of file
50 self.bool_state_burning = False
51 self.blank_discs = False No newline at end of file
51 self.blank_discs = False
52 No newline at end of file
52
53 No newline at end of file
53
54 #Revisa si existe el archivo de confirguracion No newline at end of file
54 #Revisa si existe el archivo de confirguracion
55 if os.path.isfile("parameters.conf"): No newline at end of file
55 if os.path.isfile("parameters.conf"):
56 functions2.get_parameters_conf(self) No newline at end of file
56 functions2.get_parameters_conf(self)
57 self.txtInfo.append("Parameters were loaded from configuration file") No newline at end of file
57 self.txtInfo.append("Parameters were loaded from configuration file")
58 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
58 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
59 No newline at end of file
59
60 else: No newline at end of file
60 else:
61 # self.txtInfo.append("Elija los parametros de configuracion") No newline at end of file
61 # self.txtInfo.append("Elija los parametros de configuracion")
62 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas No newline at end of file
62 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas
63 No newline at end of file
63
64 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados No newline at end of file
64 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
65 No newline at end of file
65
66 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
66 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
67 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
67 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
68 functions.load_days(self) No newline at end of file
68 functions.load_days(self)
69 No newline at end of file
69
70 if os.path.isfile("parameters.conf"): No newline at end of file
70 if os.path.isfile("parameters.conf"):
71 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion No newline at end of file
71 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion
72 No newline at end of file
72
73 if os.path.isfile("burning.conf"): No newline at end of file
73 if os.path.isfile("burning.conf"):
74 functions2.get_burning_conf(self) No newline at end of file
74 functions2.get_burning_conf(self)
75 self.txtInfo.append("Current disc: "+str(self.var_disc_n)) No newline at end of file
75 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
76 self.txtInfo.append("Current copy: "+str(self.var_copy_n)) No newline at end of file
76 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
77 self.btnStartburn.setText("Continue") No newline at end of file
77 self.btnStartburn.setText("Continue")
78 No newline at end of file
78
79 self.txtDeviceA.setText("/dev/scd0") No newline at end of file
79 self.txtDeviceA.setText("/dev/scd0")
80 self.txtDeviceB.setText("/dev/scd1") No newline at end of file
80 self.txtDeviceB.setText("/dev/scd1")
81 self.txtDeviceC.setText("/dev/scd2") No newline at end of file
81 self.txtDeviceC.setText("/dev/scd2")
82 self.txtDeviceD.setText("/dev/scd3") No newline at end of file
82 self.txtDeviceD.setText("/dev/scd3")
83 No newline at end of file
83
84 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) No newline at end of file
84 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
85 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) No newline at end of file
85 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
86 No newline at end of file
86
87 self.var_process = QtCore.QProcess() No newline at end of file
87 self.var_process = QtCore.QProcess()
88 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput) No newline at end of file
88 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput)
89 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError) No newline at end of file
89 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError)
90 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished) No newline at end of file
90 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished)
91 No newline at end of file
91
92 self.var_process_check = QtCore.QProcess() No newline at end of file
92 self.var_process_check = QtCore.QProcess()
93 self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check) No newline at end of file
93 self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check)
94 self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) No newline at end of file
94 self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check)
95 self.connect(self.var_process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) No newline at end of file
95 self.connect(self.var_process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check)
96 No newline at end of file
96
97 def write(self, txt): No newline at end of file
97 def write(self, txt):
98 self.txtInfo.append(str(txt)) No newline at end of file
98 self.txtInfo.append(str(txt))
99 No newline at end of file
99
100 def changeParameters(self): No newline at end of file
100 def changeParameters(self):
101 dlg=QtGui.QDialog() No newline at end of file
101 dlg=QtGui.QDialog()
102 dlgui=Ui_Parameters() No newline at end of file
102 dlgui=Ui_Parameters()
103 dlgui.setupUi(dlg) No newline at end of file
103 dlgui.setupUi(dlg)
104 if (dlg.exec_() == QtGui.QDialog.Accepted): No newline at end of file
104 if (dlg.exec_() == QtGui.QDialog.Accepted):
105 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value(): No newline at end of file
105 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value():
106 self.txtInfo.append("Wrong parameters") No newline at end of file
106 self.txtInfo.append("Wrong parameters")
107 else: No newline at end of file
107 else:
108 self.var_Copys = dlgui.txtNcopys.value() No newline at end of file
108 self.var_Copys = dlgui.txtNcopys.value()
109 self.var_disc_n = dlgui.txtDisc.value() No newline at end of file
109 self.var_disc_n = dlgui.txtDisc.value()
110 self.var_copy_n = dlgui.txtCopy.value() No newline at end of file
110 self.var_copy_n = dlgui.txtCopy.value()
111 self.txtInfo.append("Changed parameters") No newline at end of file
111 self.txtInfo.append("Changed parameters")
112 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 ) No newline at end of file
112 No newline at end of file
113
113 No newline at end of file
114
114 def about(self): No newline at end of file
115 def about(self):
115 dlg_about=QtGui.QDialog() No newline at end of file
116 dlg_about=QtGui.QDialog()
116 dlgui_about=Ui_About() No newline at end of file
117 dlgui_about=Ui_About()
117 dlgui_about.setupUi(dlg_about) No newline at end of file
118 dlgui_about.setupUi(dlg_about)
118 dlg_about.exec_() No newline at end of file
119 dlg_about.exec_()
119 No newline at end of file
120
120 #----------------------------------------------------- Funciones del proceso --------------------------------------------------------------- No newline at end of file
121 #----------------------------------------------------- Funciones del proceso ---------------------------------------------------------------
121 No newline at end of file
122
122 def readOuput(self):
123 def readOuput(self):
No newline at end of file
124 # self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
123 self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) No newline at end of file
No newline at end of file
125 pass No newline at end of file
124 No newline at end of file
126
125 def readError(self): No newline at end of file
127 def readError(self):
126 self.txtInfo.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) No newline at end of file
128 self.txtInfo.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
127 No newline at end of file
129
128 def finished(self):
130 def finished(self):
No newline at end of file
131 self.txtInfo.insertPlainText("\nprocess completed"+QtCore.QString(self.var_process.exitCode())+"\n") No newline at end of file
129 self.txtInfo.insertPlainText("process completed"+QtCore.QString(self.var_process.exitCode())+"\n") No newline at end of file
130 No newline at end of file
132
131 No newline at end of file
133
132 if self.var_process.exitCode() != 0: No newline at end of file
134 if self.var_process.exitCode() != 0:
133 self.txtInfo.append("ERROR") No newline at end of file
135 self.txtInfo.append("ERROR")
134 No newline at end of file
136
135 if self.bool_state_burning: No newline at end of file
137 if self.bool_state_burning:
136 if self.var_step == 0: No newline at end of file
138 if self.var_step == 0:
137 self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada No newline at end of file
139 self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada
138 No newline at end of file
140
139 elif self.var_step == 1: No newline at end of file
141 elif self.var_step == 1:
142 functions2.update_message(2, self) No newline at end of file
140 self.var_copy_n += 1 No newline at end of file
143 self.var_copy_n += 1
141 No newline at end of file
144
142 self.burning() No newline at end of file
145 self.burning()
143 No newline at end of file
146
144 No newline at end of file
147
145 #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- No newline at end of file
148 #----------------------------------------------------- Funciones del proceso de verificacion ---------------------------------------------------------------
146 No newline at end of file
149
147 def readOuput_check(self): No newline at end of file
150 def readOuput_check(self):
148 self.txtInfo.insertPlainText("stdout check: " + QtCore.QString(self.var_process_check.readAllStandardOutput())) No newline at end of file
151 self.txtInfo.insertPlainText("stdout check: " + QtCore.QString(self.var_process_check.readAllStandardOutput()))
149 No newline at end of file
152
150 def readError_check(self): No newline at end of file
153 def readError_check(self):
151 self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError())) No newline at end of file
154 self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError()))
152 No newline at end of file
155
153 def finished_check(self): No newline at end of file
156 def finished_check(self):
154 self.txtInfo.append("check process completed "+QtCore.QString(self.var_process_check.exitCode())+"\n") No newline at end of file
157 self.txtInfo.append("check process completed "+QtCore.QString(self.var_process_check.exitCode())+"\n")
155 No newline at end of file
158
156 No newline at end of file
159
157 #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- No newline at end of file
160 #----------------------------------------------------- Obtencion de la ruta de los datos ---------------------------------------------------------------
158 No newline at end of file
161
159 @pyqtSignature("") No newline at end of file
162 @pyqtSignature("")
160 def on_btnDpath_clicked(self): No newline at end of file
163 def on_btnDpath_clicked(self):
161 """ No newline at end of file
164 """
162 Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file
165 Permite seleccionar graficamente el direcorio de los datos a grabar
163 """ No newline at end of file
166 """
164 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
167 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
165 self.txtDpath.setText(self.var_Dpath) No newline at end of file
168 self.txtDpath.setText(self.var_Dpath)
166 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
169 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
167 functions.load_days(self) No newline at end of file
170 functions.load_days(self)
168 No newline at end of file
171
169 No newline at end of file
172
170 @pyqtSignature("") No newline at end of file
173 @pyqtSignature("")
171 def on_txtDpath_editingFinished(self): No newline at end of file
174 def on_txtDpath_editingFinished(self):
172 """ No newline at end of file
175 """
173 Carga la ruta editada y verifica que sea correcta y carga la lista de dias No newline at end of file
176 Carga la ruta editada y verifica que sea correcta y carga la lista de dias
174 """ No newline at end of file
177 """
175 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
178 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada
176 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
179 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
177 functions.load_days(self) No newline at end of file
180 functions.load_days(self)
178 No newline at end of file
181
179 No newline at end of file
182
180 #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- No newline at end of file
183 #----------------------------------------------------- Obtencion de las ruta del proyecto ---------------------------------------------------------------
181 No newline at end of file
184
182 @pyqtSignature("") No newline at end of file
185 @pyqtSignature("")
183 def on_btnRpath_clicked(self): No newline at end of file
186 def on_btnRpath_clicked(self):
184 """ No newline at end of file
187 """
185 Permite seleccionar graficamente el direcorio del proyecto No newline at end of file
188 Permite seleccionar graficamente el direcorio del proyecto
186 """ No newline at end of file
189 """
187 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
190 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
188 self.txtRpath.setText(self.var_Rpath) No newline at end of file
191 self.txtRpath.setText(self.var_Rpath)
189 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
192 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
190 No newline at end of file
193
191 No newline at end of file
194
192 @pyqtSignature("") No newline at end of file
195 @pyqtSignature("")
193 def on_txtRpath_editingFinished(self): No newline at end of file
196 def on_txtRpath_editingFinished(self):
194 """ No newline at end of file
197 """
195 Valida la ruta del proyecto No newline at end of file
198 Valida la ruta del proyecto
196 """ No newline at end of file
199 """
197 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
200 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada
198 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
201 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
199 No newline at end of file
202
200 No newline at end of file
203
201 #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- No newline at end of file
204 #----------------------------------------------------- Tipo de datos ---------------------------------------------------------------
202 No newline at end of file
205
203 @pyqtSignature("int") No newline at end of file
206 @pyqtSignature("int")
204 def on_lstDtype_activated(self, index): No newline at end of file
207 def on_lstDtype_activated(self, index):
205 """ No newline at end of file
208 """
206 Permite elegir entre los tipos de archivos No newline at end of file
209 Permite elegir entre los tipos de archivos
207 """ No newline at end of file
210 """
208 self.txtDtype.setReadOnly(True) No newline at end of file
211 self.txtDtype.setReadOnly(True)
209 if index == 0: No newline at end of file
212 if index == 0:
210 self.var_Dtype ='r' No newline at end of file
213 self.var_Dtype ='r'
211 elif index == 1: No newline at end of file
214 elif index == 1:
212 self.var_Dtype ='pdata' No newline at end of file
215 self.var_Dtype ='pdata'
213 elif index == 2: No newline at end of file
216 elif index == 2:
214 self.var_Dtype ='sswma' No newline at end of file
217 self.var_Dtype ='sswma'
215 else : No newline at end of file
218 else :
216 self.var_Dtype ='' No newline at end of file
219 self.var_Dtype =''
217 self.txtDtype.setReadOnly(False) No newline at end of file
220 self.txtDtype.setReadOnly(False)
218 No newline at end of file
221
219 self.txtDtype.setText(self.var_Dtype) No newline at end of file
222 self.txtDtype.setText(self.var_Dtype)
220 functions.load_days(self) #llamada a funcion No newline at end of file
223 functions.load_days(self) #llamada a funcion
221 No newline at end of file
224
222 @pyqtSignature("") No newline at end of file
225 @pyqtSignature("")
223 def on_txtDtype_editingFinished(self): No newline at end of file
226 def on_txtDtype_editingFinished(self):
224 self.var_Dtype=str(self.txtDtype.text()) No newline at end of file
227 self.var_Dtype=str(self.txtDtype.text())
225 functions.load_days(self) #llamada a funcion No newline at end of file
228 functions.load_days(self) #llamada a funcion
226 No newline at end of file
229
227 No newline at end of file
230
228 #----------------------------------------------------- Etiqueta --------------------------------------------------------------- No newline at end of file
231 #----------------------------------------------------- Etiqueta ---------------------------------------------------------------
229 No newline at end of file
232
230 @pyqtSignature("") No newline at end of file
233 @pyqtSignature("")
231 def on_txtElabel_editingFinished(self): No newline at end of file
234 def on_txtElabel_editingFinished(self):
232 self.var_Elabel = str(self.txtElabel.text()) No newline at end of file
235 self.var_Elabel = str(self.txtElabel.text())
233 No newline at end of file
236
234 #----------------------------------------------------- Numero de copias --------------------------------------------------------------- No newline at end of file
237 #----------------------------------------------------- Numero de copias ---------------------------------------------------------------
235 @pyqtSignature("") No newline at end of file
238 @pyqtSignature("")
236 def on_txtCopys_editingFinished(self): No newline at end of file
239 def on_txtCopys_editingFinished(self):
237 self.var_Copys = self.txtCopys.value() No newline at end of file
240 self.var_Copys = self.txtCopys.value()
238 No newline at end of file
241
239 #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- No newline at end of file
242 #----------------------------------------------------- Seleccion del rango de fechas ---------------------------------------------------------------
240 No newline at end of file
243
241 @pyqtSignature("int") #CLOSED No newline at end of file
244 @pyqtSignature("int") #CLOSED
242 def on_lstStartDay_activated(self, index): No newline at end of file
245 def on_lstStartDay_activated(self, index):
243 """ No newline at end of file
246 """
244 Cambia la lista de opciones en lstStopDay No newline at end of file
247 Cambia la lista de opciones en lstStopDay
245 """ No newline at end of file
248 """
246 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file
249 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
247 self.lstStopDay.clear() No newline at end of file
250 self.lstStopDay.clear()
248 No newline at end of file
251
249 for i in self.var_list[index:]: No newline at end of file
252 for i in self.var_list[index:]:
250 self.lstStopDay.addItem(i) No newline at end of file
253 self.lstStopDay.addItem(i)
251 No newline at end of file
254
252 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file
255 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
253 No newline at end of file
256
254 functions.get_sub_list(self) No newline at end of file
257 functions.get_sub_list(self)
255 No newline at end of file
258
256 No newline at end of file
259
257 @pyqtSignature("int") #CLOSED No newline at end of file
260 @pyqtSignature("int") #CLOSED
258 def on_lstStopDay_activated(self, index): No newline at end of file
261 def on_lstStopDay_activated(self, index):
259 """ No newline at end of file
262 """
260 Cambia la lista de opciones en lstStartDay No newline at end of file
263 Cambia la lista de opciones en lstStartDay
261 """ No newline at end of file
264 """
262 var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file
265 var_StartDay_index=self.lstStartDay.currentIndex()
263 var_end_index = self.lstStopDay.count() - index No newline at end of file
266 var_end_index = self.lstStopDay.count() - index
264 self.lstStartDay.clear() No newline at end of file
267 self.lstStartDay.clear()
265 No newline at end of file
268
266 for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file
269 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
267 self.lstStartDay.addItem(i) No newline at end of file
270 self.lstStartDay.addItem(i)
268 No newline at end of file
271
269 self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file
272 self.lstStartDay.setCurrentIndex(var_StartDay_index)
270 No newline at end of file
273
271 functions.get_sub_list(self) No newline at end of file
274 functions.get_sub_list(self)
272 No newline at end of file
275
273 No newline at end of file
276
274 #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- No newline at end of file
277 #----------------------------------------------------- Capacidad del dispositivo de grabacion ---------------------------------------------------------------
275 No newline at end of file
278
276 @pyqtSignature("") No newline at end of file
279 @pyqtSignature("")
277 def on_txtDcapacity_editingFinished(self): No newline at end of file
280 def on_txtDcapacity_editingFinished(self):
278 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
281 self.var_Dcapacity = self.txtDcapacity.value()
279 No newline at end of file
282
280 No newline at end of file
283
281 @pyqtSignature("int") #CLOSED No newline at end of file
284 @pyqtSignature("int") #CLOSED
282 def on_lstDcapacity_activated(self, index): No newline at end of file
285 def on_lstDcapacity_activated(self, index):
283 """ No newline at end of file
286 """
284 Permite elegir el tamaΓ±o del disco No newline at end of file
287 Permite elegir el tamaΓ±o del disco
285 """ No newline at end of file
288 """
286 if index == 0: No newline at end of file
289 if index == 0:
287 var_size=25.0 No newline at end of file
290 var_size=25.0
288 elif index == 1: No newline at end of file
291 elif index == 1:
289 var_size=8.5 No newline at end of file
292 var_size=8.5
290 elif index == 2: No newline at end of file
293 elif index == 2:
291 var_size=4.7 No newline at end of file
294 var_size=4.7
292 elif index == 3: No newline at end of file
295 elif index == 3:
293 var_size=0.7 No newline at end of file
296 var_size=0.7
294 No newline at end of file
297
295 if index != 4: No newline at end of file
298 if index != 4:
296 self.txtDcapacity.setValue(var_size*10**9/1024**2) No newline at end of file
299 self.txtDcapacity.setValue(var_size*10**9/1024**2)
297 self.txtDcapacity.setReadOnly(True) No newline at end of file
300 self.txtDcapacity.setReadOnly(True)
298 else: No newline at end of file
301 else:
299 self.txtDcapacity.setValue(100.0) No newline at end of file
302 self.txtDcapacity.setValue(100.0)
300 self.txtDcapacity.setReadOnly(False) No newline at end of file
303 self.txtDcapacity.setReadOnly(False)
301 No newline at end of file
304
302 self.var_lstDcapacity = self.lstDcapacity.currentIndex() No newline at end of file
305 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
303 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
306 self.var_Dcapacity = self.txtDcapacity.value()
304 No newline at end of file
307
305 No newline at end of file
308
306 #============================================================================== No newline at end of file
309 #==============================================================================
307 # Botones para la generacion de los archivos de configuracion y el proceso de grabacion No newline at end of file
310 # Botones para la generacion de los archivos de configuracion y el proceso de grabacion
308 #============================================================================== No newline at end of file
311 #==============================================================================
309 No newline at end of file
312
310 #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- No newline at end of file
313 #----------------------------------------------------- Generacion de la configuracion usando los parametros ---------------------------------------------------------------
311 No newline at end of file
314
312 @pyqtSignature("") No newline at end of file
315 @pyqtSignature("")
313 def on_btnGbkp_clicked(self): No newline at end of file
316 def on_btnGbkp_clicked(self):
314 """ No newline at end of file
317 """
315 Generacion de archivos de configuracion usando los parametros No newline at end of file
318 Generacion de archivos de configuracion usando los parametros
316 """ No newline at end of file
319 """
317 No newline at end of file
320
318 if functions.validate_parameters(self) == False: No newline at end of file
321 if functions.validate_parameters(self) == False:
319 return No newline at end of file
322 return
320 No newline at end of file
323
321 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file
324 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
322 list_dirs=['gpath','iso','ppath', 'tmpdata'] No newline at end of file
325 list_dirs=['gpath','iso','ppath', 'tmpdata']
323 bool_make_dirs = functions.make_dirs(list_dirs, self) No newline at end of file
326 bool_make_dirs = functions.make_dirs(list_dirs, self)
324 if bool_make_dirs == False: No newline at end of file
327 if bool_make_dirs == False:
325 return No newline at end of file
328 return
326 No newline at end of file
329
327 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar No newline at end of file
330 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar
328 No newline at end of file
331
329 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat No newline at end of file
332 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat
330 No newline at end of file
333
331 functions.make_files_print(self) # Se crean los archivos .print No newline at end of file
334 functions.make_files_print(self) # Se crean los archivos .print
332 No newline at end of file
335
333 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf No newline at end of file
336 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf
334 No newline at end of file
337
335 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
338 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
336 No newline at end of file
339
337 #Se bloquean los parametros de configuracion No newline at end of file
340 #Se bloquean los parametros de configuracion
338 functions2.enabled_items1(True, self) No newline at end of file
341 functions2.enabled_items1(True, self)
339 No newline at end of file
342
340 No newline at end of file
343
341 No newline at end of file
344
342 #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- No newline at end of file
345 #----------------------------------------------------- Permite reiniciar la configuracion ---------------------------------------------------------------
343 No newline at end of file
346
344 @pyqtSignature("") No newline at end of file
347 @pyqtSignature("")
345 def on_btnRestart_clicked(self): No newline at end of file
348 def on_btnRestart_clicked(self):
346 """ No newline at end of file
349 """
347 Permite que se puedan cambiar los parametros No newline at end of file
350 Permite que se puedan cambiar los parametros
348 """ No newline at end of file
351 """
349 if os.path.isfile("parameters.conf"): No newline at end of file
352 if os.path.isfile("parameters.conf"):
350 os.remove("parameters.conf") No newline at end of file
353 os.remove("parameters.conf")
351 if os.path.isfile("burning.conf"): No newline at end of file
354 if os.path.isfile("burning.conf"):
352 os.remove("burning.conf") No newline at end of file
355 os.remove("burning.conf")
353 No newline at end of file
356
354 functions2.enabled_items1(False, self) No newline at end of file
357 functions2.enabled_items1(False, self)
355 self.btnStartburn.setText("Start Burn") No newline at end of file
358 self.btnStartburn.setText("Start Burn")
356 No newline at end of file
359
357 No newline at end of file
360
358 No newline at end of file
361
359 #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- No newline at end of file
362 #----------------------------------------------------- Iniciar proceso de grabacion ---------------------------------------------------------------
360 No newline at end of file
363
361 @pyqtSignature("") No newline at end of file
364 @pyqtSignature("")
362 def on_btnStartburn_clicked(self): No newline at end of file
365 def on_btnStartburn_clicked(self):
363 """ No newline at end of file
366 """
364 Se inicia el proceso de grabacion No newline at end of file
367 Se inicia el proceso de grabacion
365 """
368 """
No newline at end of file
369 ####### self.txtInfo.append("BUTTON: on_btnStartburn_clicked") No newline at end of file
366 self.txtInfo.append("BUTTON: on_btnStartburn_clicked") No newline at end of file
367 #Verifica que exista algun dispositivo de grabacion seleccionado No newline at end of file
370 #Verifica que exista algun dispositivo de grabacion seleccionado
368 if not(functions2.selected_devices(self)): No newline at end of file
371 if not(functions2.selected_devices(self)):
369 self.txtInfo.append("There is no recording device selected") No newline at end of file
372 self.txtInfo.append("There is no recording device selected")
370 return No newline at end of file
373 return
371 No newline at end of file
374
372 # #Lista los dispositivos de grabacion a usar No newline at end of file
375 # #Lista los dispositivos de grabacion a usar
373 # for dev in self.var_devices: No newline at end of file
376 # for dev in self.var_devices:
374 # self.txtInfo.append("recording device :"+dev) No newline at end of file
377 # self.txtInfo.append("recording device :"+dev)
375 No newline at end of file
378
376 #Si se ingresaron los DVDs en blanco No newline at end of file
379 #Si se ingresaron los DVDs en blanco
377 if self.blank_discs == True: No newline at end of file
380 if self.blank_discs == True:
378 self.btnStartburn.setEnabled(False) No newline at end of file
381 self.btnStartburn.setEnabled(False)
379 self.burning() No newline at end of file
382 self.burning()
380 return No newline at end of file
383 return
381 No newline at end of file
384
382 #Si se cargo los parametros de burning.conf No newline at end of file
385 #Si se cargo los parametros de burning.conf
383 if self.var_burned_discs != 0: No newline at end of file
386 if self.var_burned_discs != 0:
384 self.txtInfo.append("BURNED DISC: "+str(self.var_burned_discs)) No newline at end of file
387 self.txtInfo.append("BURNED DISC: "+str(self.var_burned_discs))
385 self.var_step = 0 No newline at end of file
388 self.var_step = 0
386 self.bool_state_burning = True No newline at end of file
389 self.bool_state_burning = True
387 self.blank_discs = False No newline at end of file
390 self.blank_discs = False
388 functions2.enabled_items2(True, self) No newline at end of file
391 functions2.enabled_items2(True, self)
389 self.burning() No newline at end of file
392 self.burning()
390 return No newline at end of file
393 return
391 No newline at end of file
394
392 #Asigna las variables con los valores iniciales No newline at end of file
395 #Asigna las variables con los valores iniciales
393 self.var_disc_n = 1 # numero de disco actual para grabacion No newline at end of file
396 self.var_disc_n = 1 # numero de disco actual para grabacion
394 self.var_copy_n = 1 No newline at end of file
397 self.var_copy_n = 1
395 self.var_burned_discs = 0 #numero de discos grabados No newline at end of file
398 self.var_burned_discs = 0 #numero de discos grabados
396 self.var_step = 0 No newline at end of file
399 self.var_step = 0
397 self.bool_state_burning = True No newline at end of file
400 self.bool_state_burning = True
398 self.blank_discs = False No newline at end of file
401 self.blank_discs = False
399 functions2.enabled_items2(True, self) No newline at end of file
402 functions2.enabled_items2(True, self)
400 self.burning() No newline at end of file
403 self.burning()
401 No newline at end of file
404
402 No newline at end of file
405
403 def burning(self): No newline at end of file
406 def burning(self):
404 No newline at end of file
407
405 var_Rpath_ppath=self.var_Rpath+"/ppath" No newline at end of file
408 var_Rpath_ppath=self.var_Rpath+"/ppath"
406 var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file
409 var_Rpath_iso=self.var_Rpath+"/iso"
407 No newline at end of file
410
408 #Si ya se grabaron todas las copias del disco No newline at end of file
411 #Si ya se grabaron todas las copias del disco
409 if self.var_copy_n > self.var_Copys: No newline at end of file
412 if self.var_copy_n > self.var_Copys:
410 #borra la imagen.iso del numero de disco anterior No newline at end of file
413 #borra la imagen.iso del numero de disco anterior
411 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
414 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
No newline at end of file
415 # self.txtInfo.append("Deleting iso file") No newline at end of file
412 self.txtInfo.append("Deleting iso file") No newline at end of file
413 # os.remove(file_iso) No newline at end of file
416 # os.remove(file_iso)
414 self.var_copy_n = 1 No newline at end of file
417 self.var_copy_n = 1
415 self.var_disc_n += 1 # aumenta numero de disco actual para grabacion No newline at end of file
418 self.var_disc_n += 1 # aumenta numero de disco actual para grabacion
416 self.var_step = 0 No newline at end of file
419 self.var_step = 0
417 No newline at end of file
420
418 #Si ya se grabaron todos los discos No newline at end of file
421 #Si ya se grabaron todos los discos
419 if self.var_disc_n > self.var_Discs: No newline at end of file
422 if self.var_disc_n > self.var_Discs:
420 self.bool_state_burning = False No newline at end of file
423 self.bool_state_burning = False
421 self.txtInfo.append("Recording process is complete") No newline at end of file
424 self.txtInfo.append("Recording process is complete")
422 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
425 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
No newline at end of file
426 self.on_btnRestart_clicked()
423 return
No newline at end of file
No newline at end of file
427 self.btnStopburn.setEnabled(False)
424
No newline at end of file
No newline at end of file
428 return
425 self.txtInfo.append("\n"+str(self.var_disc_n)+" "+str(self.var_copy_n)+" "+str(self.var_step)) No newline at end of file
No newline at end of file
429
No newline at end of file
430 # self.txtInfo.append("\n"+str(self.var_disc_n)+" "+str(self.var_copy_n)+" "+str(self.var_step)) No newline at end of file
426 No newline at end of file
431
427 #Creacion del archivo.iso para la grabacion No newline at end of file
432 #Creacion del archivo.iso para la grabacion
428 if self.var_step == 0: No newline at end of file
433 if self.var_step == 0:
429 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########") No newline at end of file
434 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
430 self.txtInfo.append("---------Creating iso file number: "+str(self.var_disc_n)) No newline at end of file
435 self.txtInfo.append("---------Creating iso file number: "+str(self.var_disc_n))
431 var_cmd = functions.cmd_iso(self) No newline at end of file
436 var_cmd = functions.cmd_iso(self)
432 No newline at end of file
437
433 #Grabacion de los DVDs No newline at end of file
438 #Grabacion de los DVDs
434 elif self.var_step == 1: No newline at end of file
439 elif self.var_step == 1:
435 No newline at end of file
440
436 functions2.make_burning_conf(self) No newline at end of file
441 functions2.make_burning_conf(self)
437 No newline at end of file
442
438 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
443 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
No newline at end of file
444 # self.txtInfo.append("INDEX: "+str(var_index)) No newline at end of file
439 No newline at end of file
440 if var_index == 0 and self.blank_discs == False: No newline at end of file
445 if var_index == 0 and self.blank_discs == False:
441 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion No newline at end of file
446 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
442 self.blank_discs = True No newline at end of file
447 self.blank_discs = True
443 self.btnStartburn.setText("Continue") No newline at end of file
448 self.btnStartburn.setText("Continue")
444 self.btnStartburn.setEnabled(True) No newline at end of file
449 self.btnStartburn.setEnabled(True)
445 return No newline at end of file
450 return
446 No newline at end of file
451
447 self.blank_discs = False No newline at end of file
452 self.blank_discs = False
448
453
No newline at end of file
454 self.txtInfo.append("recording disc:"+str(self.var_copy_n)+", copy:"+str(self.var_copy_n))
449 self.txtInfo.append("Grabando la copia numero: "+str(self.var_copy_n)) No newline at end of file
No newline at end of file
455 functions2.update_message(1, self) No newline at end of file
450 No newline at end of file
456
451 var_dev_tmp = self.var_devices[var_index] No newline at end of file
457 var_dev_tmp = self.var_devices[var_index]
452 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" No newline at end of file
458 file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso"
453 var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso No newline at end of file
459 var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
454 No newline at end of file
460
455 self.var_process.start('echo "comando"') No newline at end of file
461 self.var_process.start('echo "comando"')
456 # self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
462 # self.txtInfo.append("CMD: "+var_cmd)
457 No newline at end of file
463
458 # self.txtInfo.append("creando iso") No newline at end of file
464 # self.txtInfo.append("creando iso")
459 # self.var_process.start(var_cmd) No newline at end of file
465 # self.var_process.start(var_cmd)
460 No newline at end of file
466
461 No newline at end of file
467
462 #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- No newline at end of file
468 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
463 No newline at end of file
469
464 @pyqtSignature("") No newline at end of file
470 @pyqtSignature("")
465 def on_btnStopburn_clicked(self): No newline at end of file
471 def on_btnStopburn_clicked(self):
466 """ No newline at end of file
472 """
467 Slot documentation goes here. No newline at end of file
473 Slot documentation goes here.
468 """ No newline at end of file
474 """
469 self.bool_state_burning = False No newline at end of file
475 self.bool_state_burning = False
470 self.var_process.terminate() #Termina el proceso, si puede No newline at end of file
476 self.var_process.terminate() #Termina el proceso, si puede
471 # self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona No newline at end of file
477 # self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona
472 self.txtInfo.append("Stopped recording") No newline at end of file
478 self.txtInfo.append("Stopped recording")
473 functions2.enabled_items2(False, self) No newline at end of file
479 functions2.enabled_items2(False, self)
474 No newline at end of file
480
475 No newline at end of file
481
476 #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- No newline at end of file
482 #----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
477 No newline at end of file
483
478 @pyqtSignature("") No newline at end of file
484 @pyqtSignature("")
479 def on_btnTdevA_clicked(self): No newline at end of file
485 def on_btnTdevA_clicked(self):
480 var_dev = str(self.txtDeviceA.text()) No newline at end of file
486 var_dev = str(self.txtDeviceA.text())
481 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
487 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
482 commands.getstatusoutput(var_cmd) No newline at end of file
488 commands.getstatusoutput(var_cmd)
483 No newline at end of file
489
484 @pyqtSignature("") No newline at end of file
490 @pyqtSignature("")
485 def on_btnTdevB_clicked(self): No newline at end of file
491 def on_btnTdevB_clicked(self):
486 var_dev = str(self.txtDeviceB.text()) No newline at end of file
492 var_dev = str(self.txtDeviceB.text())
487 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
493 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
488 commands.getstatusoutput(var_cmd) No newline at end of file
494 commands.getstatusoutput(var_cmd)
489 No newline at end of file
495
490 @pyqtSignature("") No newline at end of file
496 @pyqtSignature("")
491 def on_btnTdevC_clicked(self): No newline at end of file
497 def on_btnTdevC_clicked(self):
492 var_dev = str(self.txtDeviceC.text()) No newline at end of file
498 var_dev = str(self.txtDeviceC.text())
493 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
499 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
494 commands.getstatusoutput(var_cmd) No newline at end of file
500 commands.getstatusoutput(var_cmd)
495 No newline at end of file
501
496 @pyqtSignature("") No newline at end of file
502 @pyqtSignature("")
497 def on_btnTdevD_clicked(self): No newline at end of file
503 def on_btnTdevD_clicked(self):
498 var_dev = str(self.txtDeviceD.text()) No newline at end of file
504 var_dev = str(self.txtDeviceD.text())
499 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
505 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
500 commands.getstatusoutput(var_cmd) No newline at end of file
506 commands.getstatusoutput(var_cmd)
501 No newline at end of file
507
502 @pyqtSignature("") No newline at end of file
508 @pyqtSignature("")
503 def on_btnTDpath_clicked(self): No newline at end of file
509 def on_btnTDpath_clicked(self):
504 """ No newline at end of file
510 """
505 Slot documentation goes here. No newline at end of file
511 Slot documentation goes here.
506 """ No newline at end of file
512 """
507 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
513 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
508 self.txtTDpath.setText(self.var_TDpath) No newline at end of file
514 self.txtTDpath.setText(self.var_TDpath)
509 self.statusTDpath = functions.dir_exists(self.var_TDpath, self) No newline at end of file
515 self.statusTDpath = functions.dir_exists(self.var_TDpath, self)
510 No newline at end of file
516
511 No newline at end of file
517
512 @pyqtSignature("") No newline at end of file
518 @pyqtSignature("")
513 def on_btnCHstart_clicked(self): No newline at end of file
519 def on_btnCHstart_clicked(self):
514 """ No newline at end of file
520 """
515 Slot documentation goes here. No newline at end of file
521 Slot documentation goes here.
516 """ No newline at end of file
522 """
517 pass No newline at end of file
523 pass
General Comments 0
You need to be logged in to leave comments. Login now