@@ -1,259 +1,269 | |||
|
1 | 1 | # -*- coding: utf-8 -*- No newline at end of file |
|
2 | 2 | No newline at end of file |
|
3 | 3 | #class BKmanager: No newline at end of file |
|
4 | 4 | # def __init__(self): No newline at end of file |
|
5 | 5 | No newline at end of file |
|
6 | 6 | from subprocess import * No newline at end of file |
|
7 | 7 | import sys No newline at end of file |
|
8 | 8 | import os No newline at end of file |
|
9 | 9 | import subprocess No newline at end of file |
|
10 | 10 | import commands No newline at end of file |
|
11 | 11 | import shutil No newline at end of file |
|
12 | 12 | No newline at end of file |
|
13 | 13 | #--------------------------------------------- Entero a cadena agregando ceros delante ------------------------------------------------- No newline at end of file |
|
14 | 14 | No newline at end of file |
|
15 | 15 | def i2s(var_n, var_length=4): No newline at end of file |
|
16 | 16 | var_n2=str(var_n) No newline at end of file |
|
17 | 17 | while len(var_n2) < var_length: No newline at end of file |
|
18 | 18 | var_n2 = "0"+var_n2 No newline at end of file |
|
19 | 19 | return var_n2 No newline at end of file |
|
20 | 20 | No newline at end of file |
|
21 | 21 | No newline at end of file |
|
22 | 22 | #----------------------------------------- Se verifica que la ruta exista y sea un directorio ------------------------------------------------- No newline at end of file |
|
23 | 23 | No newline at end of file |
|
24 | 24 | def dir_exists(var_dir, self): No newline at end of file |
|
25 | 25 | if os.path.isdir(var_dir): No newline at end of file |
|
26 | 26 | return True No newline at end of file |
|
27 | 27 | else: No newline at end of file |
|
28 | 28 | self.txtInfo.append("Incorrect path:" + str(var_dir)) No newline at end of file |
|
29 | 29 | return False No newline at end of file |
|
30 | 30 | No newline at end of file |
|
31 | 31 | No newline at end of file |
|
32 | 32 | #-------------------------------- Se buscan los archivos del tipo especificado y se cargan las fechas ----------------------------- No newline at end of file |
|
33 | 33 | No newline at end of file |
|
34 | 34 | def load_days(self): No newline at end of file |
|
35 | 35 | No newline at end of file |
|
36 | 36 | self.var_list=[] No newline at end of file |
|
37 | 37 | self.lstStartDay.clear() No newline at end of file |
|
38 | 38 | self.lstStopDay.clear() No newline at end of file |
|
39 | 39 | No newline at end of file |
|
40 | 40 | if self.statusDpath == False: No newline at end of file |
|
41 | 41 | self.btnGbkp.setEnabled(False) No newline at end of file |
|
42 | 42 | return No newline at end of file |
|
43 | 43 | No newline at end of file |
|
44 | 44 | if self.var_Dtype == '': No newline at end of file |
|
45 | 45 | return No newline at end of file |
|
46 | 46 | No newline at end of file |
|
47 | 47 | var_cmd="find " + str(self.var_Dpath) + " -name *."+ str(self.var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq" No newline at end of file |
|
48 | 48 | output=commands.getstatusoutput(var_cmd)[1] No newline at end of file |
|
49 | 49 | No newline at end of file |
|
50 | 50 | #Si no se encuentra ningun archivo No newline at end of file |
|
51 | 51 | if len(output) == 0: No newline at end of file |
|
52 | 52 | self.txtInfo.append("File not found") No newline at end of file |
|
53 | 53 | self.btnGbkp.setEnabled(False) No newline at end of file |
|
54 | 54 | return No newline at end of file |
|
55 | 55 | No newline at end of file |
|
56 | 56 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) No newline at end of file |
|
57 | 57 | for i in range(0, (len(output)+1)/8): No newline at end of file |
|
58 | 58 | self.var_list.append(output[8*i:8*(i+1)-1]) No newline at end of file |
|
59 | 59 | No newline at end of file |
|
60 | 60 | for i in self.var_list: No newline at end of file |
|
61 | 61 | self.lstStartDay.addItem(i) No newline at end of file |
|
62 | 62 | self.lstStopDay.addItem(i) No newline at end of file |
|
63 | 63 | self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) No newline at end of file |
|
64 | 64 | No newline at end of file |
|
65 | 65 | get_sub_list(self) No newline at end of file |
|
66 | 66 | self.btnGbkp.setEnabled(True) No newline at end of file |
|
67 | 67 | No newline at end of file |
|
68 | 68 | No newline at end of file |
|
69 | 69 | #-------------------------------------------------- Obtiene el rango de las fechas seleccionadas ----------------------------------------- No newline at end of file |
|
70 | 70 | No newline at end of file |
|
71 | 71 | def get_sub_list(self): No newline at end of file |
|
72 | 72 | self.var_sublist=[] No newline at end of file |
|
73 | 73 | for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]: No newline at end of file |
|
74 | 74 | self.var_sublist.append(i) No newline at end of file |
|
75 | 75 | No newline at end of file |
|
76 | 76 | No newline at end of file |
|
77 | 77 | #----------------------------------------------------- Verifica los parametros faltantes ----------------------------------------------------------- No newline at end of file |
|
78 | 78 | No newline at end of file |
|
79 | 79 | def validate_parameters(self): No newline at end of file |
|
80 | 80 | #Verifica que las ruta del proyecto sea valida No newline at end of file |
|
81 | 81 | if self.statusRpath == False: No newline at end of file |
|
82 | 82 | self.txtInfo.append("Incorrect proyect path") No newline at end of file |
|
83 | 83 | return False No newline at end of file |
|
84 | 84 | No newline at end of file |
|
85 | 85 | #Verifica la etiqueta No newline at end of file |
|
86 | 86 | if len(self.var_Elabel) == 0: No newline at end of file |
|
87 | 87 | self.txtInfo.append("Enter label") No newline at end of file |
|
88 | 88 | return False No newline at end of file |
|
89 | 89 | No newline at end of file |
|
90 | 90 | return True No newline at end of file |
|
91 | 91 | No newline at end of file |
|
92 | 92 | No newline at end of file |
|
93 | 93 | #------------------------------------------------- Crea directorios en la ruta indicada ----------------------------------------------------------- No newline at end of file |
|
94 | 94 | No newline at end of file |
|
95 | 95 | def make_dirs(list_dirs, self): No newline at end of file |
|
96 | 96 | """ No newline at end of file |
|
97 | 97 | No newline at end of file |
|
98 | 98 | """ No newline at end of file |
|
99 | 99 | No newline at end of file |
|
100 | 100 | for var_dir in list_dirs: No newline at end of file |
|
101 | 101 | shutil.rmtree(self.var_Rpath+'/'+var_dir, True) No newline at end of file |
|
102 | 102 | var_output=commands.getstatusoutput("mkdir -p "+self.var_Rpath+'/'+var_dir)[0] No newline at end of file |
|
103 | 103 | if var_output != 0: No newline at end of file |
|
104 | 104 | self.txtInfo.append("Error creating directory: "+var_dir+", output_error:" + str(var_output)) No newline at end of file |
|
105 | 105 | return False No newline at end of file |
|
106 | 106 | self.txtInfo.append('Directories created correctly') No newline at end of file |
|
107 | 107 | return True No newline at end of file |
|
108 | 108 | No newline at end of file |
|
109 | 109 | No newline at end of file |
|
110 | 110 | #-------------------------------------------- Busca los archivos con los parametros de busqueda --------------------------------------- No newline at end of file |
|
111 | 111 | No newline at end of file |
|
112 | 112 | def list_files(self): No newline at end of file |
|
113 | 113 | var_files_list=[] No newline at end of file |
|
114 | 114 | for var_doy in self.var_sublist: No newline at end of file |
|
115 | 115 | var_cmd="find " + str(self.var_Dpath) + " -name ?"+var_doy+"???."+ str(self.var_Dtype) + " |sort" No newline at end of file |
|
116 | 116 | var_output=commands.getstatusoutput(var_cmd)[1] No newline at end of file |
|
117 | 117 | for var_file in var_output.split(): No newline at end of file |
|
118 | 118 | var_files_list.append(var_file) #Almacena cada archivo en la lista No newline at end of file |
|
119 | 119 | return var_files_list No newline at end of file |
|
120 | 120 | No newline at end of file |
|
121 | 121 | No newline at end of file |
|
122 | 122 | #--------------- Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD ----------------------- No newline at end of file |
|
123 | 123 | No newline at end of file |
|
124 | 124 | def make_files_dat(var_files_list, self): No newline at end of file |
|
125 | 125 | var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar No newline at end of file |
|
126 | 126 | var_n=1 #Numero del DVD actual No newline at end of file |
|
127 | 127 | var_tmp=0 #Se usa para acumular el tamaΓ±o de los archivos de la lista No newline at end of file |
|
128 | 128 | var_files_list_2=[] #Se usa para almacenar la lista de archivos agrbar en cada DVD No newline at end of file |
|
129 | 129 | No newline at end of file |
|
130 | 130 | for i in var_files_list: #Se asignan en i los archivos de la lista No newline at end of file |
|
131 | 131 | No newline at end of file |
|
132 | 132 | var_size_i=os.path.getsize(i)/1024+1 #tamaΓ±o en KB del archivo de la lista, se suma 1 KB para evitar problemas al momento de sumar No newline at end of file |
|
133 | 133 | var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista No newline at end of file |
|
134 | 134 | No newline at end of file |
|
135 | 135 | #Si el tamaΓ±o acumulado es mayor que el de el DVD No newline at end of file |
|
136 | 136 | if var_tmp > (self.var_Dcapacity * 1024): No newline at end of file |
|
137 | 137 | var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real No newline at end of file |
|
138 | 138 | #se crea un archivo con numeral en el sufijo y extension .dat No newline at end of file |
|
139 | 139 | var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w") No newline at end of file |
|
140 | 140 | #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat No newline at end of file |
|
141 | 141 | for line in var_files_list_2: No newline at end of file |
|
142 | 142 | var_tmp_path=line.split(self.var_Dpath)[1][:-13] No newline at end of file |
|
143 | 143 | var_file.write(var_tmp_path+'='+line+'\n') No newline at end of file |
|
144 | 144 | var_file.close() No newline at end of file |
|
145 | 145 | No newline at end of file |
|
146 | 146 | var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual No newline at end of file |
|
147 | 147 | var_files_list_2=[] #Se reinicia la lista No newline at end of file |
|
148 | 148 | var_n += 1 No newline at end of file |
|
149 | 149 | var_files_list_2.append(i) No newline at end of file |
|
150 | 150 | No newline at end of file |
|
151 | 151 | #se crea un archivo con numeral en el sufijo y extension .dat No newline at end of file |
|
152 | 152 | var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w") No newline at end of file |
|
153 | 153 | #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat No newline at end of file |
|
154 | 154 | for line in var_files_list_2: No newline at end of file |
|
155 | 155 | var_tmp_path=line.split(self.var_Dpath)[1][:-13] No newline at end of file |
|
156 | 156 | var_file.write(var_tmp_path+'='+line+'\n') No newline at end of file |
|
157 | 157 | var_file.close() No newline at end of file |
|
158 | 158 | No newline at end of file |
|
159 | 159 | self.txtInfo.append("configuration files created") No newline at end of file |
|
160 | 160 | return var_n No newline at end of file |
|
161 | 161 | No newline at end of file |
|
162 | 162 | No newline at end of file |
|
163 | 163 | #------------------------------ Genera los archivos .print con los cuales se creara los postscript ----------------------------------- No newline at end of file |
|
164 | 164 | No newline at end of file |
|
165 | 165 | def make_files_print(self): No newline at end of file |
|
166 | 166 | No newline at end of file |
|
167 | 167 | var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar No newline at end of file |
|
168 | 168 | var_Rpath_gpath=self.var_Rpath+"/gpath" #Ruta de los archivos postscript No newline at end of file |
|
169 | 169 | var_labels=[] No newline at end of file |
|
170 | 170 | for m in range (0, self.txtPSgraphic.value() - 1): No newline at end of file |
|
171 | 171 | var_lines = "\n" * 9 No newline at end of file |
|
172 | 172 | var_labels.append(var_lines) No newline at end of file |
|
173 | 173 | No newline at end of file |
|
174 | 174 | # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .print No newline at end of file |
|
175 | 175 | for var_n in range(1, self.var_Discs + 1): No newline at end of file |
|
176 | 176 | No newline at end of file |
|
177 | 177 | #se abren los archivos .dat en modo lectura No newline at end of file |
|
178 | 178 | var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","r") No newline at end of file |
|
179 | 179 | lines=var_file.readlines() # Se lee las lineas en el archivo y se almacenan en la lista No newline at end of file |
|
180 | 180 | var_file.close() No newline at end of file |
|
181 | 181 | list_files=[] No newline at end of file |
|
182 | 182 | var_lines=[] No newline at end of file |
|
183 | 183 | No newline at end of file |
|
184 | 184 | for j in range(0, len(lines)): No newline at end of file |
|
185 | 185 | No newline at end of file |
|
186 | 186 | if j == 0: No newline at end of file |
|
187 | 187 | var_first_folder = lines[j].split('=')[0] No newline at end of file |
|
188 | 188 | var_first_file = (lines[j].split('=')[1])[:-1] No newline at end of file |
|
189 | 189 | continue No newline at end of file |
|
190 | 190 | No newline at end of file |
|
191 | 191 | var_tmp_folder = lines[j].split('=')[0] No newline at end of file |
|
192 | 192 | var_tmp_file = (lines[j].split('=')[1])[:-1] No newline at end of file |
|
193 | 193 | No newline at end of file |
|
194 | 194 | # Si el subfolder superior o el DOY del archivo actual y el anterior son diferentes No newline at end of file |
|
195 | 195 | if (var_tmp_folder != var_first_folder) or (var_tmp_file[0:-5] != var_first_file[0:-5]): No newline at end of file |
|
196 | 196 | var_last_file = (lines[j-1].split('=')[1])[:-1] No newline at end of file |
|
197 | 197 | list_files.append([var_first_folder, var_first_file, var_last_file]) No newline at end of file |
|
198 | 198 | No newline at end of file |
|
199 | 199 | var_first_folder = lines[j].split('=')[0] No newline at end of file |
|
200 | 200 | var_first_file = (lines[j].split('=')[1])[:-1] No newline at end of file |
|
201 | 201 | No newline at end of file |
|
202 | 202 | var_last_file = (lines[-1].split('=')[1])[:-1] No newline at end of file |
|
203 | 203 | list_files.append([var_first_folder, var_first_file, var_last_file]) No newline at end of file |
|
204 | 204 | No newline at end of file |
|
205 | 205 | var_lines2 = lines_print(list_files, self.var_Elabel) No newline at end of file |
|
206 | 206 | No newline at end of file |
|
207 | 207 | for k in range(0, len(var_lines2) / 5): No newline at end of file |
|
208 | 208 | var_lines=["\n"] No newline at end of file |
|
209 | 209 | var_lines.append(" "+self.var_Elabel+" "+i2s(var_n)+"/"+i2s(self.var_Discs)+"\n") No newline at end of file |
|
210 | 210 | var_lines.append("Year Doy Folder"+" "*6+"Set"+" "*9+"Time range\n") No newline at end of file |
|
211 | 211 | var_lines.extend(var_lines2[(5*k):(5*(k+1))]) No newline at end of file |
|
212 | 212 | var_lines.append("\n") No newline at end of file |
|
213 | 213 | var_labels.append(var_lines) No newline at end of file |
|
214 | 214 | No newline at end of file |
|
215 | 215 | for i in range(0, (len(var_labels) // 33) +1 ): No newline at end of file |
|
216 | 216 | var_file=var_Rpath_gpath+"/"+self.var_Elabel+"_"+i2s(i+1) No newline at end of file |
|
217 | 217 | file_ps = open(var_file+".print","w") No newline at end of file |
|
218 | 218 | if i == (len(var_labels) // 33): No newline at end of file |
|
219 | 219 | var_sub_labels = var_labels[33*i:] No newline at end of file |
|
220 | 220 | else: No newline at end of file |
|
221 | 221 | var_sub_labels = var_labels[33*i:33*(i+1)] No newline at end of file |
|
222 | 222 | No newline at end of file |
|
223 | 223 | for label in var_sub_labels: No newline at end of file |
|
224 | 224 | for line in label: No newline at end of file |
|
225 | 225 | file_ps.write(line) No newline at end of file |
|
226 | 226 | file_ps.close() No newline at end of file |
|
227 | 227 | var_cmd="enscript "+var_file+".print -p "+var_file+".ps -f Times-Roman7 " \ No newline at end of file |
|
228 | 228 | +" -3R -j -B --margins=21.25:20.4:25.51:20 --media=A4" No newline at end of file |
|
229 | 229 | var_output=commands.getstatusoutput(var_cmd)[0] No newline at end of file |
|
230 | 230 | No newline at end of file |
|
231 | 231 | No newline at end of file |
|
232 | 232 | def lines_print(list_files, var_Elabel): No newline at end of file |
|
233 | 233 | """ No newline at end of file |
|
234 | 234 | Devuelve las lineas del rango de archivos de cada etiqueta segun el formato No newline at end of file |
|
235 | 235 | """ No newline at end of file |
|
236 | 236 | var_lines=[] No newline at end of file |
|
237 | 237 | for i in list_files: No newline at end of file |
|
238 | 238 | No newline at end of file |
|
239 | 239 | # Si el archivo se grabara directamente en la / del DVD y no en un /directorio/ No newline at end of file |
|
240 | 240 | # se usa la etiqueta para indicar la parte de la etiqueta donde va el subdirectorio No newline at end of file |
|
241 | 241 | if i[0] == '/': No newline at end of file |
|
242 | 242 | var_folder = var_Elabel No newline at end of file |
|
243 | 243 | else: No newline at end of file |
|
244 | 244 | var_folder = i[0].split('/')[-2] No newline at end of file |
|
245 | 245 | No newline at end of file |
|
246 | 246 | var_first_file = i[1] No newline at end of file |
|
247 | 247 | var_last_file = i[2] No newline at end of file |
|
248 | 248 | No newline at end of file |
|
249 | 249 | var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1] No newline at end of file |
|
250 | 250 | var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1] No newline at end of file |
|
251 | 251 | No newline at end of file |
|
252 | 252 | var_lines.append(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" " No newline at end of file |
|
253 | 253 | +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n") No newline at end of file |
|
254 | 254 | #Nos aseguramos que sea un mutiplo de 5 No newline at end of file |
|
255 | 255 | while (len(var_lines) % 5) != 0: No newline at end of file |
|
256 | 256 | var_lines.append("\n") No newline at end of file |
|
257 | 257 | No newline at end of file |
|
258 | 258 | return var_lines No newline at end of file |
|
259 | 259 | No newline at end of file |
|
260 | def cmd_iso(self): | |
|
No newline at end of file | ||
|
261 | var_Rpath_ppath=self.var_Rpath+"/ppath" | |
|
No newline at end of file | ||
|
262 | var_Rpath_iso=self.var_Rpath+"/iso" | |
|
No newline at end of file | ||
|
263 | #comando para la creacion del archivo.iso | |
|
No newline at end of file | ||
|
264 | file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(self.var_disc_n)+".dat" | |
|
No newline at end of file | ||
|
265 | file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso" | |
|
No newline at end of file | ||
|
266 | var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' | |
|
No newline at end of file | ||
|
267 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel | |
|
No newline at end of file | ||
|
268 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso | |
|
No newline at end of file | ||
|
269 | return var_cmd No newline at end of file |
@@ -1,165 +1,192 | |||
|
1 | 1 | # -*- coding: utf-8 -*- No newline at end of file |
|
2 | 2 | No newline at end of file |
|
3 | 3 | No newline at end of file |
|
4 | 4 | from subprocess import * No newline at end of file |
|
5 | 5 | import sys No newline at end of file |
|
6 | 6 | import os No newline at end of file |
|
7 | 7 | import subprocess No newline at end of file |
|
8 | 8 | import commands No newline at end of file |
|
9 | 9 | No newline at end of file |
|
10 | 10 | #----------------------------------------------------- Deteccion de los dispositivos de grabacion --------------------------------------------------------------- No newline at end of file |
|
11 | 11 | No newline at end of file |
|
12 | 12 | def detect_devices(self): No newline at end of file |
|
13 | 13 | """ No newline at end of file |
|
14 | 14 | Deteccion de los dispositvos de grabacion No newline at end of file |
|
15 | 15 | """ No newline at end of file |
|
16 | 16 | #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ? No newline at end of file |
|
17 | 17 | var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'" No newline at end of file |
|
18 | 18 | No newline at end of file |
|
19 | 19 | var_output = commands.getstatusoutput(var_cmd) No newline at end of file |
|
20 | 20 | if var_output[0] != 0: No newline at end of file |
|
21 | 21 | self.txtInfo.append("No recording devices") No newline at end of file |
|
22 | 22 | else: No newline at end of file |
|
23 | 23 | # self.txtInfo.append("dispositivos encontrados") No newline at end of file |
|
24 | 24 | var_devices = var_output[1].split('\n') No newline at end of file |
|
25 | 25 | No newline at end of file |
|
26 | 26 | var_tmp=[] No newline at end of file |
|
27 | 27 | for i in range(0, 4): No newline at end of file |
|
28 | 28 | if i < len(var_devices): No newline at end of file |
|
29 | 29 | var_len = len(var_devices[i]) No newline at end of file |
|
30 | 30 | var_tmp.append(var_devices[i][1:var_len - 1]) No newline at end of file |
|
31 | 31 | else: No newline at end of file |
|
32 | 32 | var_tmp.append('') No newline at end of file |
|
33 | 33 | No newline at end of file |
|
34 | 34 | #Se escriben los dispostivos correspodientes, si existen No newline at end of file |
|
35 | 35 | self.txtDeviceA.setText(str(var_tmp[0])) No newline at end of file |
|
36 | 36 | self.txtDeviceB.setText(str(var_tmp[1])) No newline at end of file |
|
37 | 37 | self.txtDeviceC.setText(str(var_tmp[2])) No newline at end of file |
|
38 | 38 | self.txtDeviceD.setText(str(var_tmp[3])) No newline at end of file |
|
39 | 39 | #Se desactivan los que no existen No newline at end of file |
|
40 | 40 | if len(var_tmp[0]) == 0 : No newline at end of file |
|
41 | 41 | self.chkDevA.setChecked(False) No newline at end of file |
|
42 | 42 | self.chkDevA.setEnabled(False) No newline at end of file |
|
43 | 43 | if len(var_tmp[1]) == 0 : No newline at end of file |
|
44 | 44 | self.chkDevB.setChecked(False) No newline at end of file |
|
45 | 45 | self.chkDevB.setEnabled(False) No newline at end of file |
|
46 | 46 | if len(var_tmp[2]) == 0 : No newline at end of file |
|
47 | 47 | self.chkDevC.setChecked(False) No newline at end of file |
|
48 | 48 | self.chkDevC.setEnabled(False) No newline at end of file |
|
49 | 49 | if len(var_tmp[3]) == 0 : No newline at end of file |
|
50 | 50 | self.chkDevD.setChecked(False) No newline at end of file |
|
51 | 51 | self.chkDevD.setEnabled(False) No newline at end of file |
|
52 | 52 | No newline at end of file |
|
53 | 53 | #----------------------------------- expulsa los dispositivos de grabacion -------------------------------------------- No newline at end of file |
|
54 | 54 | No newline at end of file |
|
55 | 55 | def eject_devices(self): No newline at end of file |
|
56 | self.txtInfo.append("Ejecting recording devices") | |
|
No newline at end of file | ||
|
57 | return No newline at end of file | |
|
56 | 58 | for var_dev in self.var_devices: No newline at end of file |
|
57 | 59 | var_cmd = 'eject ' + var_dev No newline at end of file |
|
58 | 60 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
59 | 61 | No newline at end of file |
|
60 | 62 | #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- No newline at end of file |
|
61 | 63 | No newline at end of file |
|
62 | 64 | def selected_devices(self): No newline at end of file |
|
63 | 65 | self.var_devices=[] No newline at end of file |
|
64 | 66 | if self.chkDevA.isChecked(): No newline at end of file |
|
65 | 67 | self.var_devices.append(str(self.txtDeviceA.text())) No newline at end of file |
|
66 | 68 | if self.chkDevB.isChecked(): No newline at end of file |
|
67 | 69 | self.var_devices.append(str(self.txtDeviceB.text())) No newline at end of file |
|
68 | 70 | if self.chkDevC.isChecked(): No newline at end of file |
|
69 | 71 | self.var_devices.append(str(self.txtDeviceC.text())) No newline at end of file |
|
70 | 72 | if self.chkDevD.isChecked(): No newline at end of file |
|
71 | 73 | self.var_devices.append(str(self.txtDeviceD.text())) No newline at end of file |
|
72 | 74 | No newline at end of file |
|
73 | 75 | if len(self.var_devices) == 0: No newline at end of file |
|
74 | 76 | return False No newline at end of file |
|
75 | 77 | else: No newline at end of file |
|
76 | 78 | return True No newline at end of file |
|
77 | 79 | No newline at end of file |
|
78 | 80 | No newline at end of file |
|
79 | 81 | #----------------------------------------------------- Inicializacion para pruebas--------------------------------------------------------------- No newline at end of file |
|
80 | 82 | No newline at end of file |
|
81 | 83 | def set_parameters_test(self): No newline at end of file |
|
82 | 84 | """ No newline at end of file |
|
83 | 85 | Se usa para inicializar ciertos parametros para pruebas No newline at end of file |
|
84 | 86 | """ No newline at end of file |
|
85 | 87 | self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS') No newline at end of file |
|
86 | 88 | self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager') No newline at end of file |
|
87 | 89 | self.txtElabel.setText('EW_DRIFTS_pruebas') No newline at end of file |
|
88 | 90 | self.lstDcapacity.setCurrentIndex(4) No newline at end of file |
|
89 | 91 | self.txtDcapacity.setValue(100.0) No newline at end of file |
|
90 | 92 | self.txtDcapacity.setReadOnly(False) No newline at end of file |
|
91 | 93 | self.txtDeviceA.setText("/dev/scd0") No newline at end of file |
|
92 | 94 | self.txtDeviceB.setText("/dev/scd1") No newline at end of file |
|
93 | 95 | self.txtDeviceC.setText("/dev/scd2") No newline at end of file |
|
94 | 96 | self.txtDeviceD.setText("/dev/scd3") No newline at end of file |
|
95 | 97 | No newline at end of file |
|
96 | 98 | No newline at end of file |
|
97 | 99 | No newline at end of file |
|
98 | 100 | #----------------------------------------------------- crea parameters.conf --------------------------------------------------------------- No newline at end of file |
|
99 | 101 | No newline at end of file |
|
100 | 102 | def make_parameters_conf(self): No newline at end of file |
|
101 | 103 | var_file = open("parameters.conf","w") No newline at end of file |
|
102 | 104 | var_file.write(self.var_Dpath+"\n") #0 Ruta de los datos No newline at end of file |
|
103 | 105 | var_file.write(self.var_Rpath+"\n") #1 Ruta del proyecto No newline at end of file |
|
104 | 106 | var_file.write(str(self.var_lstDtype)+"\n") #2 opcion Data Type No newline at end of file |
|
105 | 107 | var_file.write(self.var_Dtype+"\n") #3 extension Data Type No newline at end of file |
|
106 | 108 | var_file.write(self.var_Elabel+"\n") #4 etiqueta No newline at end of file |
|
107 | 109 | var_file.write(str(self.var_Copys)+"\n") #5 Numero de copias No newline at end of file |
|
108 | 110 | var_file.write(str(self.var_lstDcapacity)+"\n") #6 opcion Device Capacity No newline at end of file |
|
109 | 111 | var_file.write(str(self.var_Dcapacity)+"\n") #7 tamaΓ±o Device Capacity No newline at end of file |
|
110 | 112 | var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar No newline at end of file |
|
111 | 113 | # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial No newline at end of file |
|
112 | 114 | # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final No newline at end of file |
|
113 | 115 | No newline at end of file |
|
114 | 116 | var_file.close() No newline at end of file |
|
115 | 117 | No newline at end of file |
|
116 | 118 | #----------------------------------------------------- carga parameters.conf --------------------------------------------------------------- No newline at end of file |
|
117 | 119 | No newline at end of file |
|
118 | 120 | def get_parameters_conf(self): No newline at end of file |
|
119 | 121 | var_file = open("parameters.conf","r") No newline at end of file |
|
120 | 122 | lines = var_file.readlines() No newline at end of file |
|
121 | 123 | self.txtDpath.setText(lines[0][:-1]) #0 No newline at end of file |
|
122 | 124 | self.txtRpath.setText(lines[1][:-1]) #1 No newline at end of file |
|
123 | 125 | self.lstDtype.setCurrentIndex(int(lines[2])) #2 No newline at end of file |
|
124 | 126 | self.txtDtype.setText(lines[3][:-1]) #3 No newline at end of file |
|
125 | 127 | self.txtElabel.setText(lines[4][:-1]) #4 No newline at end of file |
|
126 | 128 | self.txtCopys.setValue(int(lines[5][:-1])) #5 No newline at end of file |
|
127 | 129 | self.lstDcapacity.setCurrentIndex(int(lines[6])) #6 No newline at end of file |
|
128 | 130 | self.txtDcapacity.setValue(float(lines[7])) #7 No newline at end of file |
|
129 | 131 | self.var_Discs = int(lines[8]) #8 No newline at end of file |
|
130 | 132 | # var_StartDay = int(lines[6]) #9 No newline at end of file |
|
131 | 133 | # var_StopDay = int(lines[7]) #10 No newline at end of file |
|
134 | ################################ | |
|
No newline at end of file | ||
|
135 | self.var_Copys = self.txtCopys.value() #5 | |
|
No newline at end of file | ||
|
136 | ################################ | |
|
No newline at end of file | ||
|
137 | No newline at end of file | |
|
132 | 138 | var_file.close() No newline at end of file |
|
133 | 139 | No newline at end of file |
|
134 | 140 | No newline at end of file |
|
135 | 141 | No newline at end of file |
|
136 | 142 | #-------------------------- actualiza el valor de las variables con los parametros seleccionados ----------------------------- No newline at end of file |
|
137 | 143 | No newline at end of file |
|
138 | 144 | def set_vars(self): No newline at end of file |
|
139 | 145 | self.var_Dpath = str(self.txtDpath.text()) #0 No newline at end of file |
|
140 | 146 | self.var_Rpath = str(self.txtRpath.text()) #1 No newline at end of file |
|
141 | 147 | self.var_lstDtype = self.lstDtype.currentIndex() #2 No newline at end of file |
|
142 | 148 | self.var_Dtype = str(self.txtDtype.text()) #3 No newline at end of file |
|
143 | 149 | self.var_Elabel = str(self.txtElabel.text()) #4 No newline at end of file |
|
144 | 150 | self.var_Copys = self.txtCopys.value() #5 No newline at end of file |
|
145 | 151 | self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6 No newline at end of file |
|
146 | 152 | self.var_Dcapacity = self.txtDcapacity.value() #7 No newline at end of file |
|
147 | 153 | self.var_Discs = self.var_Discs #8 No newline at end of file |
|
154 | ||
|
No newline at end of file | ||
|
155 | ||
|
No newline at end of file | ||
|
156 | #-------------------------- crea burning.conf ----------------------------- | |
|
No newline at end of file | ||
|
157 | ||
|
No newline at end of file | ||
|
158 | def make_burning_conf(self): | |
|
No newline at end of file | ||
|
159 | var_file = open("burning.conf","w") | |
|
No newline at end of file | ||
|
160 | var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 ) | |
|
No newline at end of file | ||
|
161 | var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados | |
|
No newline at end of file | ||
|
162 | var_file.write(str(self.var_disc_n)+"\n") #1 Disco 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 | |
|
No newline at end of file | ||
|
164 | var_file.close() | |
|
No newline at end of file | ||
|
165 | ||
|
No newline at end of file | ||
|
166 | #----------------------------------------------------- carga burning.conf --------------------------------------------------------------- | |
|
No newline at end of file | ||
|
167 | ||
|
No newline at end of file | ||
|
168 | def get_burning_conf(self): | |
|
No newline at end of file | ||
|
169 | var_file = open("burning.conf","r") | |
|
No newline at end of file | ||
|
170 | lines = var_file.readlines() | |
|
No newline at end of file | ||
|
171 | self.var_burned_discs = int(lines[0]) #0 | |
|
No newline at end of file | ||
|
172 | self.var_disc_n = int(lines[1]) | |
|
No newline at end of file | ||
|
173 | self.var_copy_n = int(lines[2]) | |
|
No newline at end of file | ||
|
174 | var_file.close() No newline at end of file | |
|
148 | 175 | No newline at end of file |
|
149 | 176 | #---------------------------------------------- Habilitacion y deshabilitacion de items ------------------------------------------------------- No newline at end of file |
|
150 | 177 | No newline at end of file |
|
151 | 178 | def enabled_items1(var_bool, self): No newline at end of file |
|
152 | 179 | self.tabParameters.setEnabled(not(var_bool)) No newline at end of file |
|
153 | 180 | self.lstDcapacity.setEnabled(not(var_bool)) No newline at end of file |
|
154 | 181 | self.txtDcapacity.setEnabled(not(var_bool)) No newline at end of file |
|
155 | 182 | self.actionChange_Parameters.setEnabled(var_bool) No newline at end of file |
|
156 | 183 | self.btnGbkp.setEnabled(not(var_bool)) No newline at end of file |
|
157 | 184 | self.btnRestart.setEnabled(var_bool) No newline at end of file |
|
158 | 185 | self.btnStartburn.setEnabled(var_bool) No newline at end of file |
|
159 | 186 | No newline at end of file |
|
160 | 187 | No newline at end of file |
|
161 | 188 | def enabled_items2(var_bool, self): No newline at end of file |
|
162 | 189 | self.btnRestart.setEnabled(not(var_bool)) No newline at end of file |
|
163 | 190 | self.btnStartburn.setEnabled(not(var_bool)) No newline at end of file |
|
164 | 191 | self.btnStopburn.setEnabled(var_bool) No newline at end of file |
|
165 | 192 | self.chkCheck.setEnabled(not(var_bool)) No newline at end of file |
@@ -1,169 +1,165 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> No newline at end of file |
|
2 | 2 | <!DOCTYPE Project SYSTEM "Project-4.6.dtd"> No newline at end of file |
|
3 | 3 | <!-- eric4 project file for project jro_backup_manager --> |
|
4 | No newline at end of file | |
|
4 | <!-- Saved: 2010-05-24, 08:55:25 --> No newline at end of file | |
|
5 | 5 | <!-- Copyright (C) 2010 , --> No newline at end of file |
|
6 | 6 | <Project version="4.6"> No newline at end of file |
|
7 | 7 | <Language>en</Language> No newline at end of file |
|
8 | 8 | <ProgLanguage mixed="0">Python</ProgLanguage> No newline at end of file |
|
9 | 9 | <ProjectType>Qt4</ProjectType> No newline at end of file |
|
10 | 10 | <Description></Description> No newline at end of file |
|
11 | 11 | <Version>0.1</Version> No newline at end of file |
|
12 | 12 | <Author></Author> No newline at end of file |
|
13 | 13 | <Email></Email> No newline at end of file |
|
14 | 14 | <Sources> No newline at end of file |
|
15 | 15 | <Source>__init__.py</Source> No newline at end of file |
|
16 | 16 | <Source>ui/Ui_MainWindow.py</Source> No newline at end of file |
|
17 | 17 | <Source>ui/MainWindow.py</Source> No newline at end of file |
|
18 | 18 | <Source>main.py</Source> No newline at end of file |
|
19 | 19 | <Source>ui/__init__.py</Source> No newline at end of file |
|
20 | 20 | <Source>functions/__init__.py</Source> No newline at end of file |
|
21 | 21 | <Source>functions/functions.py</Source> No newline at end of file |
|
22 | 22 | <Source>functions/functions2.py</Source> No newline at end of file |
|
23 | 23 | <Source>functions/func_doc.py</Source> |
|
No newline at end of file | ||
|
24 | <Source>ui/Ui_About2.py</Source> | |
|
No newline at end of file | ||
|
25 | <Source>ui/Ui_Parameters2.py</Source> No newline at end of file | |
|
26 | 24 | <Source>ui/Ui_About.py</Source> No newline at end of file |
|
27 | 25 | <Source>ui/Ui_Parameters.py</Source> No newline at end of file |
|
28 | 26 | </Sources> No newline at end of file |
|
29 | 27 | <Forms> No newline at end of file |
|
30 | 28 | <Form>ui/MainWindow.ui</Form> |
|
No newline at end of file | ||
|
31 | <Form>ui/About2.ui</Form> | |
|
No newline at end of file | ||
|
32 | <Form>ui/Parameters2.ui</Form> No newline at end of file | |
|
33 | 29 | <Form>ui/About.ui</Form> No newline at end of file |
|
34 | 30 | <Form>ui/Parameters.ui</Form> No newline at end of file |
|
35 | 31 | </Forms> No newline at end of file |
|
36 | 32 | <Translations> No newline at end of file |
|
37 | 33 | </Translations> No newline at end of file |
|
38 | 34 | <Resources> No newline at end of file |
|
39 | 35 | </Resources> No newline at end of file |
|
40 | 36 | <Interfaces> No newline at end of file |
|
41 | 37 | </Interfaces> No newline at end of file |
|
42 | 38 | <Others> No newline at end of file |
|
43 | 39 | </Others> No newline at end of file |
|
44 | 40 | <MainScript>main.py</MainScript> No newline at end of file |
|
45 | 41 | <Vcs> No newline at end of file |
|
46 | 42 | <VcsType>Subversion</VcsType> No newline at end of file |
|
47 | 43 | <VcsOptions> No newline at end of file |
|
48 | 44 | <dict> No newline at end of file |
|
49 | 45 | <key> No newline at end of file |
|
50 | 46 | <string>add</string> No newline at end of file |
|
51 | 47 | </key> No newline at end of file |
|
52 | 48 | <value> No newline at end of file |
|
53 | 49 | <list> No newline at end of file |
|
54 | 50 | <string></string> No newline at end of file |
|
55 | 51 | </list> No newline at end of file |
|
56 | 52 | </value> No newline at end of file |
|
57 | 53 | <key> No newline at end of file |
|
58 | 54 | <string>checkout</string> No newline at end of file |
|
59 | 55 | </key> No newline at end of file |
|
60 | 56 | <value> No newline at end of file |
|
61 | 57 | <list> No newline at end of file |
|
62 | 58 | <string></string> No newline at end of file |
|
63 | 59 | </list> No newline at end of file |
|
64 | 60 | </value> No newline at end of file |
|
65 | 61 | <key> No newline at end of file |
|
66 | 62 | <string>commit</string> No newline at end of file |
|
67 | 63 | </key> No newline at end of file |
|
68 | 64 | <value> No newline at end of file |
|
69 | 65 | <list> No newline at end of file |
|
70 | 66 | <string></string> No newline at end of file |
|
71 | 67 | </list> No newline at end of file |
|
72 | 68 | </value> No newline at end of file |
|
73 | 69 | <key> No newline at end of file |
|
74 | 70 | <string>diff</string> No newline at end of file |
|
75 | 71 | </key> No newline at end of file |
|
76 | 72 | <value> No newline at end of file |
|
77 | 73 | <list> No newline at end of file |
|
78 | 74 | <string></string> No newline at end of file |
|
79 | 75 | </list> No newline at end of file |
|
80 | 76 | </value> No newline at end of file |
|
81 | 77 | <key> No newline at end of file |
|
82 | 78 | <string>export</string> No newline at end of file |
|
83 | 79 | </key> No newline at end of file |
|
84 | 80 | <value> No newline at end of file |
|
85 | 81 | <list> No newline at end of file |
|
86 | 82 | <string></string> No newline at end of file |
|
87 | 83 | </list> No newline at end of file |
|
88 | 84 | </value> No newline at end of file |
|
89 | 85 | <key> No newline at end of file |
|
90 | 86 | <string>global</string> No newline at end of file |
|
91 | 87 | </key> No newline at end of file |
|
92 | 88 | <value> No newline at end of file |
|
93 | 89 | <list> No newline at end of file |
|
94 | 90 | <string></string> No newline at end of file |
|
95 | 91 | </list> No newline at end of file |
|
96 | 92 | </value> No newline at end of file |
|
97 | 93 | <key> No newline at end of file |
|
98 | 94 | <string>history</string> No newline at end of file |
|
99 | 95 | </key> No newline at end of file |
|
100 | 96 | <value> No newline at end of file |
|
101 | 97 | <list> No newline at end of file |
|
102 | 98 | <string></string> No newline at end of file |
|
103 | 99 | </list> No newline at end of file |
|
104 | 100 | </value> No newline at end of file |
|
105 | 101 | <key> No newline at end of file |
|
106 | 102 | <string>log</string> No newline at end of file |
|
107 | 103 | </key> No newline at end of file |
|
108 | 104 | <value> No newline at end of file |
|
109 | 105 | <list> No newline at end of file |
|
110 | 106 | <string></string> No newline at end of file |
|
111 | 107 | </list> No newline at end of file |
|
112 | 108 | </value> No newline at end of file |
|
113 | 109 | <key> No newline at end of file |
|
114 | 110 | <string>remove</string> No newline at end of file |
|
115 | 111 | </key> No newline at end of file |
|
116 | 112 | <value> No newline at end of file |
|
117 | 113 | <list> No newline at end of file |
|
118 | 114 | <string></string> No newline at end of file |
|
119 | 115 | </list> No newline at end of file |
|
120 | 116 | </value> No newline at end of file |
|
121 | 117 | <key> No newline at end of file |
|
122 | 118 | <string>status</string> No newline at end of file |
|
123 | 119 | </key> No newline at end of file |
|
124 | 120 | <value> No newline at end of file |
|
125 | 121 | <list> No newline at end of file |
|
126 | 122 | <string></string> No newline at end of file |
|
127 | 123 | </list> No newline at end of file |
|
128 | 124 | </value> No newline at end of file |
|
129 | 125 | <key> No newline at end of file |
|
130 | 126 | <string>tag</string> No newline at end of file |
|
131 | 127 | </key> No newline at end of file |
|
132 | 128 | <value> No newline at end of file |
|
133 | 129 | <list> No newline at end of file |
|
134 | 130 | <string></string> No newline at end of file |
|
135 | 131 | </list> No newline at end of file |
|
136 | 132 | </value> No newline at end of file |
|
137 | 133 | <key> No newline at end of file |
|
138 | 134 | <string>update</string> No newline at end of file |
|
139 | 135 | </key> No newline at end of file |
|
140 | 136 | <value> No newline at end of file |
|
141 | 137 | <list> No newline at end of file |
|
142 | 138 | <string></string> No newline at end of file |
|
143 | 139 | </list> No newline at end of file |
|
144 | 140 | </value> No newline at end of file |
|
145 | 141 | </dict> No newline at end of file |
|
146 | 142 | </VcsOptions> No newline at end of file |
|
147 | 143 | <VcsOtherData> No newline at end of file |
|
148 | 144 | <dict> No newline at end of file |
|
149 | 145 | <key> No newline at end of file |
|
150 | 146 | <string>standardLayout</string> No newline at end of file |
|
151 | 147 | </key> No newline at end of file |
|
152 | 148 | <value> No newline at end of file |
|
153 | 149 | <bool>True</bool> No newline at end of file |
|
154 | 150 | </value> No newline at end of file |
|
155 | 151 | </dict> No newline at end of file |
|
156 | 152 | </VcsOtherData> No newline at end of file |
|
157 | 153 | </Vcs> No newline at end of file |
|
158 | 154 | <FiletypeAssociations> No newline at end of file |
|
159 | 155 | <FiletypeAssociation pattern="*.ui" type="FORMS" /> No newline at end of file |
|
160 | 156 | <FiletypeAssociation pattern="*.idl" type="INTERFACES" /> No newline at end of file |
|
161 | 157 | <FiletypeAssociation pattern="*.qm" type="TRANSLATIONS" /> No newline at end of file |
|
162 | 158 | <FiletypeAssociation pattern="*.ptl" type="SOURCES" /> No newline at end of file |
|
163 | 159 | <FiletypeAssociation pattern="*.pyw" type="SOURCES" /> No newline at end of file |
|
164 | 160 | <FiletypeAssociation pattern="*.ui.h" type="FORMS" /> No newline at end of file |
|
165 | 161 | <FiletypeAssociation pattern="*.ts" type="TRANSLATIONS" /> No newline at end of file |
|
166 | 162 | <FiletypeAssociation pattern="*.py" type="SOURCES" /> No newline at end of file |
|
167 | 163 | <FiletypeAssociation pattern="*.qrc" type="RESOURCES" /> No newline at end of file |
|
168 | 164 | </FiletypeAssociations> No newline at end of file |
|
169 | 165 | </Project> No newline at end of file |
@@ -1,484 +1,517 | |||
|
1 | 1 | # -*- coding: utf-8 -*- No newline at end of file |
|
2 | 2 | No newline at end of file |
|
3 | 3 | """ No newline at end of file |
|
4 | 4 | Module implementing MainWindow. No newline at end of file |
|
5 | 5 | """ No newline at end of file |
|
6 | 6 | No newline at end of file |
|
7 | 7 | from PyQt4.QtGui import QMainWindow No newline at end of file |
|
8 | 8 | from PyQt4.QtCore import pyqtSignature No newline at end of file |
|
9 | 9 | from PyQt4 import QtCore No newline at end of file |
|
10 | 10 | from Ui_MainWindow import Ui_MainWindow No newline at end of file |
|
11 | 11 | from Ui_Parameters import Ui_Parameters No newline at end of file |
|
12 | 12 | from Ui_About import Ui_About No newline at end of file |
|
13 | 13 | from PyQt4 import QtGui No newline at end of file |
|
14 | 14 | from subprocess import * No newline at end of file |
|
15 | 15 | import sys No newline at end of file |
|
16 | 16 | import os No newline at end of file |
|
17 | 17 | #import subprocess No newline at end of file |
|
18 | 18 | import commands No newline at end of file |
|
19 | 19 | from functions import functions No newline at end of file |
|
20 | 20 | from functions import functions2 No newline at end of file |
|
21 | 21 | No newline at end of file |
|
22 | 22 | class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file |
|
23 | 23 | """ No newline at end of file |
|
24 | 24 | Class documentation goes here. No newline at end of file |
|
25 | 25 | """ No newline at end of file |
|
26 | 26 | No newline at end of file |
|
27 | 27 | def __init__(self, parent = None): No newline at end of file |
|
28 | 28 | QMainWindow.__init__(self, parent) No newline at end of file |
|
29 | 29 | self.setupUi(self) No newline at end of file |
|
30 | 30 | No newline at end of file |
|
31 | 31 | self.setupUi2() No newline at end of file |
|
32 | 32 | #sys.stdout = self #redirige salida estandar No newline at end of file |
|
33 | 33 | No newline at end of file |
|
34 | 34 | def setupUi2(self): No newline at end of file |
|
35 | 35 | No newline at end of file |
|
36 | 36 | # functions2.detect_devices(self) #busca los dispositivos de grabacion No newline at end of file |
|
37 | 37 | No newline at end of file |
|
38 | 38 | self.var_Discs = 0 #Numero de discos del proyecto No newline at end of file |
|
39 | 39 | self.var_Copys = 0 #Numero de copias No newline at end of file |
|
40 | 40 | self.var_disc_n = 0 No newline at end of file |
|
41 | 41 | self.var_copy_n = 0 No newline at end of file |
|
42 | self.var_burned_discs = 0 No newline at end of file | |
|
42 | 43 | No newline at end of file |
|
43 | 44 | self.var_list=[] No newline at end of file |
|
44 | 45 | self.var_sublist=[] No newline at end of file |
|
45 | 46 | No newline at end of file |
|
46 | 47 | self.var_devices=[] No newline at end of file |
|
47 | 48 | No newline at end of file |
|
48 | 49 | self.var_step = 0 No newline at end of file |
|
49 | 50 | self.bool_state_burning = False No newline at end of file |
|
50 | 51 | self.blank_discs = False No newline at end of file |
|
51 | 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 | 55 | if os.path.isfile("parameters.conf"): No newline at end of file |
|
56 | functions2.get_parameters_conf(self) No newline at end of file | |
|
55 | 57 | self.txtInfo.append("Parameters were loaded from configuration file") |
|
No newline at end of file | ||
|
56 | functions2.get_parameters_conf(self) No newline at end of file | |
|
57 | 58 | self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file |
|
58 | 59 | No newline at end of file |
|
59 | 60 | else: No newline at end of file |
|
60 | 61 | # self.txtInfo.append("Elija los parametros de configuracion") No newline at end of file |
|
61 | 62 | functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas No newline at end of file |
|
62 | 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 | 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 | 67 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file |
|
67 | 68 | functions.load_days(self) No newline at end of file |
|
68 | 69 | No newline at end of file |
|
69 | 70 | if os.path.isfile("parameters.conf"): No newline at end of file |
|
70 | 71 | functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion No newline at end of file |
|
72 | ||
|
No newline at end of file | ||
|
73 | if os.path.isfile("burning.conf"): | |
|
No newline at end of file | ||
|
74 | functions2.get_burning_conf(self) | |
|
No newline at end of file | ||
|
75 | self.txtInfo.append("Current disc: "+str(self.var_disc_n)) | |
|
No newline at end of file | ||
|
76 | self.txtInfo.append("Current copy: "+str(self.var_copy_n)) | |
|
No newline at end of file | ||
|
77 | self.btnStartburn.setText("Continue") | |
|
No newline at end of file | ||
|
78 | ||
|
No newline at end of file | ||
|
79 | self.txtDeviceA.setText("/dev/scd0") | |
|
No newline at end of file | ||
|
80 | self.txtDeviceB.setText("/dev/scd1") | |
|
No newline at end of file | ||
|
81 | self.txtDeviceC.setText("/dev/scd2") | |
|
No newline at end of file | ||
|
82 | self.txtDeviceD.setText("/dev/scd3") No newline at end of file | |
|
71 | 83 | No newline at end of file |
|
72 | 84 | self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) No newline at end of file |
|
73 | 85 | self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) No newline at end of file |
|
74 | 86 | No newline at end of file |
|
75 | 87 | self.var_process = QtCore.QProcess() No newline at end of file |
|
76 | 88 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput) No newline at end of file |
|
77 | 89 | self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError) No newline at end of file |
|
78 | 90 | self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished) No newline at end of file |
|
79 | 91 | No newline at end of file |
|
80 | 92 | self.var_process_check = QtCore.QProcess() No newline at end of file |
|
81 | 93 | self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check) No newline at end of file |
|
82 | 94 | self.connect(self.var_process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) No newline at end of file |
|
83 | 95 | self.connect(self.var_process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) No newline at end of file |
|
84 | 96 | No newline at end of file |
|
85 | 97 | def write(self, txt): No newline at end of file |
|
86 | 98 | self.txtInfo.append(str(txt)) No newline at end of file |
|
87 | 99 | No newline at end of file |
|
88 | 100 | def changeParameters(self): No newline at end of file |
|
89 | 101 | dlg=QtGui.QDialog() No newline at end of file |
|
90 | 102 | dlgui=Ui_Parameters() No newline at end of file |
|
91 | 103 | dlgui.setupUi(dlg) No newline at end of file |
|
92 | 104 | if (dlg.exec_() == QtGui.QDialog.Accepted): No newline at end of file |
|
93 | 105 | if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value(): No newline at end of file |
|
94 | 106 | self.txtInfo.append("Wrong parameters") No newline at end of file |
|
95 | 107 | else: No newline at end of file |
|
96 | 108 | self.var_Copys = dlgui.txtNcopys.value() No newline at end of file |
|
97 | 109 | self.var_disc_n = dlgui.txtDisc.value() No newline at end of file |
|
98 | 110 | self.var_copy_n = dlgui.txtCopy.value() No newline at end of file |
|
99 | 111 | self.txtInfo.append("Changed parameters") No newline at end of file |
|
100 | 112 | No newline at end of file |
|
101 | 113 | No newline at end of file |
|
102 | 114 | def about(self): No newline at end of file |
|
103 | 115 | dlg_about=QtGui.QDialog() No newline at end of file |
|
104 | 116 | dlgui_about=Ui_About() No newline at end of file |
|
105 | 117 | dlgui_about.setupUi(dlg_about) No newline at end of file |
|
106 | 118 | dlg_about.exec_() No newline at end of file |
|
107 | 119 | No newline at end of file |
|
108 | 120 | #----------------------------------------------------- Funciones del proceso --------------------------------------------------------------- No newline at end of file |
|
109 | 121 | No newline at end of file |
|
110 | 122 | def readOuput(self): No newline at end of file |
|
111 | 123 | self.txtInfo.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) No newline at end of file |
|
112 | 124 | No newline at end of file |
|
113 | 125 | def readError(self): |
|
126 | No newline at end of file | |
|
114 | self.txtInfo.setText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) No newline at end of file | |
|
115 | 127 | No newline at end of file |
|
116 | 128 | def finished(self): |
|
129 | No newline at end of file | |
|
117 | self.txtInfo.append("proceso terminado finished() "+QtCore.QString(self.var_process.exitCode())+"\n") | |
|
No newline at end of file | ||
|
130 | No newline at end of file | |
|
118 | if self.var_disc_n <= self.var_Discs and self.bool_state_burning: No newline at end of file | |
|
No newline at end of file | ||
|
131 | ||
|
No newline at end of file | ||
|
132 | if self.var_process.exitCode() != 0: | |
|
No newline at end of file | ||
|
133 | self.txtInfo.append("ERROR") | |
|
No newline at end of file | ||
|
134 | ||
|
No newline at end of file | ||
|
135 | if self.bool_state_burning: | |
|
No newline at end of file | ||
|
136 | if self.var_step == 0: | |
|
No newline at end of file | ||
|
137 | self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada | |
|
No newline at end of file | ||
|
138 | ||
|
No newline at end of file | ||
|
139 | elif self.var_step == 1: | |
|
No newline at end of file | ||
|
140 | self.var_copy_n += 1 | |
|
No newline at end of file | ||
|
141 | No newline at end of file | |
|
119 | 142 | self.burning() No newline at end of file |
|
120 | 143 | No newline at end of file |
|
121 | 144 | No newline at end of file |
|
122 | 145 | #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- No newline at end of file |
|
123 | 146 | No newline at end of file |
|
124 | 147 | def readOuput_check(self): No newline at end of file |
|
125 | 148 | self.txtInfo.insertPlainText("stdout check: " + QtCore.QString(self.var_process_check.readAllStandardOutput())) No newline at end of file |
|
126 | 149 | No newline at end of file |
|
127 | 150 | def readError_check(self): No newline at end of file |
|
128 | 151 | self.txtInfo.setText("stderr check: " + QtCore.QString(self.var_process_check.readAllStandardError())) No newline at end of file |
|
129 | 152 | No newline at end of file |
|
130 | 153 | def finished_check(self): |
|
154 | No newline at end of file | |
|
131 | self.txtInfo.append("proceso terminado finished() check"+QtCore.QString(self.var_process_check.exitCode())+"\n") No newline at end of file | |
|
132 | 155 | No newline at end of file |
|
133 | 156 | No newline at end of file |
|
134 | 157 | #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- No newline at end of file |
|
135 | 158 | No newline at end of file |
|
136 | 159 | @pyqtSignature("") No newline at end of file |
|
137 | 160 | def on_btnDpath_clicked(self): No newline at end of file |
|
138 | 161 | """ No newline at end of file |
|
139 | 162 | Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file |
|
140 | 163 | """ No newline at end of file |
|
141 | 164 | self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file |
|
142 | 165 | self.txtDpath.setText(self.var_Dpath) No newline at end of file |
|
143 | 166 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file |
|
144 | 167 | functions.load_days(self) No newline at end of file |
|
145 | 168 | No newline at end of file |
|
146 | 169 | No newline at end of file |
|
147 | 170 | @pyqtSignature("") No newline at end of file |
|
148 | 171 | def on_txtDpath_editingFinished(self): No newline at end of file |
|
149 | 172 | """ No newline at end of file |
|
150 | 173 | Carga la ruta editada y verifica que sea correcta y carga la lista de dias No newline at end of file |
|
151 | 174 | """ No newline at end of file |
|
152 | 175 | self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file |
|
153 | 176 | self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file |
|
154 | 177 | functions.load_days(self) No newline at end of file |
|
155 | 178 | No newline at end of file |
|
156 | 179 | No newline at end of file |
|
157 | 180 | #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- No newline at end of file |
|
158 | 181 | No newline at end of file |
|
159 | 182 | @pyqtSignature("") No newline at end of file |
|
160 | 183 | def on_btnRpath_clicked(self): No newline at end of file |
|
161 | 184 | """ No newline at end of file |
|
162 | 185 | Permite seleccionar graficamente el direcorio del proyecto No newline at end of file |
|
163 | 186 | """ No newline at end of file |
|
164 | 187 | self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file |
|
165 | 188 | self.txtRpath.setText(self.var_Rpath) No newline at end of file |
|
166 | 189 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file |
|
167 | 190 | No newline at end of file |
|
168 | 191 | No newline at end of file |
|
169 | 192 | @pyqtSignature("") No newline at end of file |
|
170 | 193 | def on_txtRpath_editingFinished(self): No newline at end of file |
|
171 | 194 | """ No newline at end of file |
|
172 | 195 | Valida la ruta del proyecto No newline at end of file |
|
173 | 196 | """ No newline at end of file |
|
174 | 197 | self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file |
|
175 | 198 | self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file |
|
176 | 199 | No newline at end of file |
|
177 | 200 | No newline at end of file |
|
178 | 201 | #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- No newline at end of file |
|
179 | 202 | No newline at end of file |
|
180 | 203 | @pyqtSignature("int") No newline at end of file |
|
181 | 204 | def on_lstDtype_activated(self, index): No newline at end of file |
|
182 | 205 | """ No newline at end of file |
|
183 | 206 | Permite elegir entre los tipos de archivos No newline at end of file |
|
184 | 207 | """ No newline at end of file |
|
185 | 208 | self.txtDtype.setReadOnly(True) No newline at end of file |
|
186 | 209 | if index == 0: No newline at end of file |
|
187 | 210 | self.var_Dtype ='r' No newline at end of file |
|
188 | 211 | elif index == 1: No newline at end of file |
|
189 | 212 | self.var_Dtype ='pdata' No newline at end of file |
|
190 | 213 | elif index == 2: No newline at end of file |
|
191 | 214 | self.var_Dtype ='sswma' No newline at end of file |
|
192 | 215 | else : No newline at end of file |
|
193 | 216 | self.var_Dtype ='' No newline at end of file |
|
194 | 217 | self.txtDtype.setReadOnly(False) No newline at end of file |
|
195 | 218 | No newline at end of file |
|
196 | 219 | self.txtDtype.setText(self.var_Dtype) No newline at end of file |
|
197 | 220 | functions.load_days(self) #llamada a funcion No newline at end of file |
|
198 | 221 | No newline at end of file |
|
199 | 222 | @pyqtSignature("") No newline at end of file |
|
200 | 223 | def on_txtDtype_editingFinished(self): No newline at end of file |
|
201 | 224 | self.var_Dtype=str(self.txtDtype.text()) No newline at end of file |
|
202 | 225 | functions.load_days(self) #llamada a funcion No newline at end of file |
|
203 | 226 | No newline at end of file |
|
204 | 227 | No newline at end of file |
|
205 | 228 | #----------------------------------------------------- Etiqueta --------------------------------------------------------------- No newline at end of file |
|
206 | 229 | No newline at end of file |
|
207 | 230 | @pyqtSignature("") No newline at end of file |
|
208 | 231 | def on_txtElabel_editingFinished(self): No newline at end of file |
|
209 | 232 | self.var_Elabel = str(self.txtElabel.text()) No newline at end of file |
|
210 | 233 | No newline at end of file |
|
211 | 234 | #----------------------------------------------------- Numero de copias --------------------------------------------------------------- No newline at end of file |
|
212 | 235 | @pyqtSignature("") No newline at end of file |
|
213 | 236 | def on_txtCopys_editingFinished(self): No newline at end of file |
|
214 | 237 | self.var_Copys = self.txtCopys.value() No newline at end of file |
|
215 | 238 | No newline at end of file |
|
216 | 239 | #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- No newline at end of file |
|
217 | 240 | No newline at end of file |
|
218 | 241 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
219 | 242 | def on_lstStartDay_activated(self, index): No newline at end of file |
|
220 | 243 | """ No newline at end of file |
|
221 | 244 | Cambia la lista de opciones en lstStopDay No newline at end of file |
|
222 | 245 | """ No newline at end of file |
|
223 | 246 | var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file |
|
224 | 247 | self.lstStopDay.clear() No newline at end of file |
|
225 | 248 | No newline at end of file |
|
226 | 249 | for i in self.var_list[index:]: No newline at end of file |
|
227 | 250 | self.lstStopDay.addItem(i) No newline at end of file |
|
228 | 251 | No newline at end of file |
|
229 | 252 | self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file |
|
230 | 253 | No newline at end of file |
|
231 | 254 | functions.get_sub_list(self) No newline at end of file |
|
232 | 255 | No newline at end of file |
|
233 | 256 | No newline at end of file |
|
234 | 257 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
235 | 258 | def on_lstStopDay_activated(self, index): No newline at end of file |
|
236 | 259 | """ No newline at end of file |
|
237 | 260 | Cambia la lista de opciones en lstStartDay No newline at end of file |
|
238 | 261 | """ No newline at end of file |
|
239 | 262 | var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file |
|
240 | 263 | var_end_index = self.lstStopDay.count() - index No newline at end of file |
|
241 | 264 | self.lstStartDay.clear() No newline at end of file |
|
242 | 265 | No newline at end of file |
|
243 | 266 | for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file |
|
244 | 267 | self.lstStartDay.addItem(i) No newline at end of file |
|
245 | 268 | No newline at end of file |
|
246 | 269 | self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file |
|
247 | 270 | No newline at end of file |
|
248 | 271 | functions.get_sub_list(self) No newline at end of file |
|
249 | 272 | No newline at end of file |
|
250 | 273 | No newline at end of file |
|
251 | 274 | #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- No newline at end of file |
|
252 | 275 | No newline at end of file |
|
253 | 276 | @pyqtSignature("") No newline at end of file |
|
254 | 277 | def on_txtDcapacity_editingFinished(self): No newline at end of file |
|
255 | 278 | self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file |
|
256 | 279 | No newline at end of file |
|
257 | 280 | No newline at end of file |
|
258 | 281 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
259 | 282 | def on_lstDcapacity_activated(self, index): No newline at end of file |
|
260 | 283 | """ No newline at end of file |
|
261 | 284 | Permite elegir el tamaΓ±o del disco No newline at end of file |
|
262 | 285 | """ No newline at end of file |
|
263 | 286 | if index == 0: No newline at end of file |
|
264 | 287 | var_size=25.0 No newline at end of file |
|
265 | 288 | elif index == 1: No newline at end of file |
|
266 | 289 | var_size=8.5 No newline at end of file |
|
267 | 290 | elif index == 2: No newline at end of file |
|
268 | 291 | var_size=4.7 No newline at end of file |
|
269 | 292 | elif index == 3: No newline at end of file |
|
270 | 293 | var_size=0.7 No newline at end of file |
|
271 | 294 | No newline at end of file |
|
272 | 295 | if index != 4: No newline at end of file |
|
273 | 296 | self.txtDcapacity.setValue(var_size*10**9/1024**2) No newline at end of file |
|
274 | 297 | self.txtDcapacity.setReadOnly(True) No newline at end of file |
|
275 | 298 | else: No newline at end of file |
|
276 | 299 | self.txtDcapacity.setValue(100.0) No newline at end of file |
|
277 | 300 | self.txtDcapacity.setReadOnly(False) No newline at end of file |
|
278 | 301 | No newline at end of file |
|
279 | 302 | self.var_lstDcapacity = self.lstDcapacity.currentIndex() No newline at end of file |
|
280 | 303 | self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file |
|
281 | 304 | No newline at end of file |
|
282 | 305 | No newline at end of file |
|
283 | 306 | #============================================================================== No newline at end of file |
|
284 | 307 | # Botones para la generacion de los archivos de configuracion y el proceso de grabacion No newline at end of file |
|
285 | 308 | #============================================================================== No newline at end of file |
|
286 | 309 | No newline at end of file |
|
287 | 310 | #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- No newline at end of file |
|
288 | 311 | No newline at end of file |
|
289 | 312 | @pyqtSignature("") No newline at end of file |
|
290 | 313 | def on_btnGbkp_clicked(self): No newline at end of file |
|
291 | 314 | """ No newline at end of file |
|
292 | 315 | Generacion de archivos de configuracion usando los parametros No newline at end of file |
|
293 | 316 | """ No newline at end of file |
|
294 | 317 | No newline at end of file |
|
295 | 318 | if functions.validate_parameters(self) == False: No newline at end of file |
|
296 | 319 | return No newline at end of file |
|
297 | 320 | No newline at end of file |
|
298 | 321 | #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file |
|
299 | 322 | list_dirs=['gpath','iso','ppath', 'tmpdata'] No newline at end of file |
|
300 | 323 | bool_make_dirs = functions.make_dirs(list_dirs, self) No newline at end of file |
|
301 | 324 | if bool_make_dirs == False: No newline at end of file |
|
302 | 325 | return No newline at end of file |
|
303 | 326 | No newline at end of file |
|
304 | 327 | var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar No newline at end of file |
|
305 | 328 | No newline at end of file |
|
306 | 329 | self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat No newline at end of file |
|
307 | 330 | No newline at end of file |
|
308 | 331 | functions.make_files_print(self) # Se crean los archivos .print No newline at end of file |
|
309 | 332 | No newline at end of file |
|
310 | 333 | functions2.make_parameters_conf(self) # se crea el archivo parameters.conf No newline at end of file |
|
311 | 334 | No newline at end of file |
|
312 | 335 | self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file |
|
313 | 336 | No newline at end of file |
|
314 | 337 | #Se bloquean los parametros de configuracion No newline at end of file |
|
315 | 338 | functions2.enabled_items1(True, self) No newline at end of file |
|
316 | 339 | No newline at end of file |
|
317 | 340 | No newline at end of file |
|
318 | 341 | No newline at end of file |
|
319 | 342 | #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- No newline at end of file |
|
320 | 343 | No newline at end of file |
|
321 | 344 | @pyqtSignature("") No newline at end of file |
|
322 | 345 | def on_btnRestart_clicked(self): No newline at end of file |
|
323 | 346 | """ No newline at end of file |
|
324 | 347 | Permite que se puedan cambiar los parametros No newline at end of file |
|
325 | 348 | """ No newline at end of file |
|
349 | if os.path.isfile("parameters.conf"): | |
|
No newline at end of file | ||
|
350 | os.remove("parameters.conf") | |
|
No newline at end of file | ||
|
351 | if os.path.isfile("burning.conf"): | |
|
No newline at end of file | ||
|
352 | os.remove("burning.conf") | |
|
No newline at end of file | ||
|
353 | No newline at end of file | |
|
326 | 354 | functions2.enabled_items1(False, self) |
|
355 | No newline at end of file | |
|
327 | os.remove("parameters.conf") No newline at end of file | |
|
No newline at end of file | ||
|
356 | No newline at end of file | |
|
328 | 357 | No newline at end of file |
|
329 | 358 | No newline at end of file |
|
330 | 359 | #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- No newline at end of file |
|
331 | 360 | No newline at end of file |
|
332 | 361 | @pyqtSignature("") No newline at end of file |
|
333 | 362 | def on_btnStartburn_clicked(self): No newline at end of file |
|
334 | 363 | """ No newline at end of file |
|
335 | 364 | Se inicia el proceso de grabacion No newline at end of file |
|
336 | 365 | """ |
|
366 | No newline at end of file | |
|
337 | No newline at end of file | |
|
No newline at end of file | ||
|
367 | #Verifica que exista algun dispositivo de grabacion seleccionado | |
|
No newline at end of file | ||
|
368 | if not(functions2.selected_devices(self)): | |
|
No newline at end of file | ||
|
369 | self.txtInfo.append("There is no recording device selected") | |
|
No newline at end of file | ||
|
370 | return | |
|
No newline at end of file | ||
|
371 | ||
|
No newline at end of file | ||
|
372 | # #Lista los dispositivos de grabacion a usar | |
|
No newline at end of file | ||
|
373 | # for dev in self.var_devices: | |
|
No newline at end of file | ||
|
374 | # self.txtInfo.append("recording device :"+dev) | |
|
No newline at end of file | ||
|
375 | ||
|
No newline at end of file | ||
|
376 | #Si se ingresaron los DVDs en blanco No newline at end of file | |
|
338 | 377 | if self.blank_discs == True: No newline at end of file |
|
339 | 378 | self.btnStartburn.setEnabled(False) No newline at end of file |
|
340 | 379 | self.burning() No newline at end of file |
|
341 | 380 | return No newline at end of file |
|
342 | 381 | |
|
382 | No newline at end of file | |
|
343 | #Verifica que exista algun dispositivo de grabacion seleccionado | |
|
No newline at end of file | ||
|
383 | No newline at end of file | |
|
344 | if not(functions2.selected_devices(self)): | |
|
No newline at end of file | ||
|
384 | No newline at end of file | |
|
345 | self.txtInfo.append("There is no recording device selected") | |
|
No newline at end of file | ||
|
346 | return | |
|
No newline at end of file | ||
|
347 | ||
|
No newline at end of file | ||
|
348 | #Lista los dispositivos de grabacion a usar | |
|
No newline at end of file | ||
|
349 | for dev in self.var_devices: | |
|
No newline at end of file | ||
|
350 | self.txtInfo.append("recording device :"+dev) | |
|
No newline at end of file | ||
|
351 | ||
|
No newline at end of file | ||
|
352 | #Asigna las variables con los valores iniciales | |
|
No newline at end of file | ||
|
353 | self.var_disc_n = 0 # numero de disco actual para grabacion | |
|
No newline at end of file | ||
|
354 | self.var_copy_n = 0 No newline at end of file | |
|
355 | 385 | self.var_step = 0 No newline at end of file |
|
356 | 386 | self.bool_state_burning = True No newline at end of file |
|
357 | 387 | self.blank_discs = False No newline at end of file |
|
358 | 388 | No newline at end of file |
|
359 | 389 | functions2.enabled_items2(True, self) No newline at end of file |
|
360 | 390 |
|
|
391 | ||
|
No newline at end of file | ||
|
392 | #Asigna las variables con los valores iniciales | |
|
No newline at end of file | ||
|
393 | self.var_disc_n = 1 # numero de disco actual para grabacion | |
|
No newline at end of file | ||
|
394 | self.var_copy_n = 1 | |
|
No newline at end of file | ||
|
395 | self.var_burned_discs = 0 #numero de discos grabados | |
|
No newline at end of file | ||
|
396 | self.var_step = 0 | |
|
No newline at end of file | ||
|
397 | self.bool_state_burning = True | |
|
No newline at end of file | ||
|
398 | self.blank_discs = False | |
|
No newline at end of file | ||
|
399 | functions2.enabled_items2(True, self) | |
|
No newline at end of file | ||
|
400 | self.burning() | |
|
No newline at end of file | ||
|
401 | ||
|
No newline at end of file | ||
|
402 | No newline at end of file | |
|
361 | 403 | No newline at end of file |
|
362 | 404 | def burning(self): No newline at end of file |
|
363 | 405 | No newline at end of file |
|
364 | 406 |
var_Rpath_ |
|
365 | 407 | var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file |
|
366 | 408 | |
|
409 | No newline at end of file | |
|
367 | #Creacion del archivo.iso para la grabacion | |
|
No newline at end of file | ||
|
410 | No newline at end of file | |
|
368 | if self.var_step == 0: No newline at end of file | |
|
369 | 411 | #borra la imagen.iso del numero de disco anterior |
|
No newline at end of file | ||
|
370 | if self.var_disc_n > 0: No newline at end of file | |
|
371 | 412 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" |
|
413 | No newline at end of file | |
|
372 | # os.remove(file_iso) | |
|
No newline at end of file | ||
|
414 | No newline at end of file | |
|
373 | No newline at end of file | |
|
No newline at end of file | ||
|
415 | self.var_disc_n += 1 # aumenta numero de disco actual para grabacion No newline at end of file | |
|
374 | 416 | self.var_disc_n += 1 # aumenta numero de disco actual para grabacion |
|
417 | No newline at end of file | |
|
375 | self.var_copy_n = 0 # Resetea el numero actual de la copia No newline at end of file | |
|
376 | 418 | No newline at end of file |
|
377 | 419 | #Si ya se grabaron todos los discos No newline at end of file |
|
378 | 420 | if self.var_disc_n > self.var_Discs: No newline at end of file |
|
379 | 421 | self.bool_state_burning = False No newline at end of file |
|
380 | 422 | self.txtInfo.append("Recording process is complete") |
|
423 | No newline at end of file | |
|
381 | # functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion | |
|
No newline at end of file | ||
|
424 | No newline at end of file | |
|
382 | ||
|
No newline at end of file | ||
|
425 | No newline at end of file | |
|
383 | return | |
|
No newline at end of file | ||
|
426 | No newline at end of file | |
|
384 | ||
|
No newline at end of file | ||
|
427 | No newline at end of file | |
|
385 | self.txtInfo.append("########## DISCO NUMERO: "+str(self.var_disc_n)+"##########") | |
|
No newline at end of file | ||
|
428 | No newline at end of file | |
|
386 | self.txtInfo.append("--------Creando el iso del disco numero: "+str(self.var_disc_n)) | |
|
No newline at end of file | ||
|
429 | No newline at end of file | |
|
387 | ||
|
No newline at end of file | ||
|
430 | No newline at end of file | |
|
388 | #comando para la creacion del archivo.iso | |
|
No newline at end of file | ||
|
431 | No newline at end of file | |
|
389 | file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(self.var_disc_n)+".dat" | |
|
No newline at end of file | ||
|
432 | No newline at end of file | |
|
390 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" | |
|
No newline at end of file | ||
|
391 | var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' | |
|
No newline at end of file | ||
|
392 | var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel | |
|
No newline at end of file | ||
|
393 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso | |
|
No newline at end of file | ||
|
394 | self.var_step = 1 #Se ira al paso de la grabacion en la siguiente llamada No newline at end of file | |
|
395 | 433 | No newline at end of file |
|
396 | 434 | #Grabacion de los DVDs No newline at end of file |
|
397 | 435 | elif self.var_step == 1: |
|
436 | No newline at end of file | |
|
398 | self.var_copy_n += 1 # numero de copia actual | |
|
No newline at end of file | ||
|
437 | No newline at end of file | |
|
399 | var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) ) % len(self.var_devices) No newline at end of file | |
|
No newline at end of file | ||
|
438 | 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 | ||
|
439 | No newline at end of file | |
|
400 | 440 | No newline at end of file |
|
401 | 441 | if var_index == 0 and self.blank_discs == False: |
|
442 | No newline at end of file | |
|
402 | self.txtInfo.append("EXPULSANDO BANDEJAS") | |
|
No newline at end of file | ||
|
403 | self.var_copy_n -= 1 #El numero de copia se regresa al estado anterior | |
|
No newline at end of file | ||
|
404 | # functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion No newline at end of file | |
|
405 | 443 | self.blank_discs = True No newline at end of file |
|
406 | 444 |
self.btnStartburn.set |
|
407 | 445 | self.btnStartburn.setEnabled(True) No newline at end of file |
|
408 | 446 |
|
|
409 | 447 | No newline at end of file |
|
410 | 448 | self.blank_discs = False No newline at end of file |
|
411 | 449 | No newline at end of file |
|
412 | 450 | self.txtInfo.append("Grabando la copia numero: "+str(self.var_copy_n)) |
|
No newline at end of file | ||
|
413 | #Si esta es la ultima copia se pasara al siguiente disco en la siguiente llamada a la funcion | |
|
No newline at end of file | ||
|
414 | if self.var_copy_n == self.var_Copys: | |
|
No newline at end of file | ||
|
415 | self.var_step = 0 No newline at end of file | |
|
416 | 451 | No newline at end of file |
|
417 | 452 | var_dev_tmp = self.var_devices[var_index] No newline at end of file |
|
418 | 453 | file_iso=var_Rpath_iso+"/"+functions.i2s(self.var_disc_n)+".iso" No newline at end of file |
|
419 | 454 | var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso No newline at end of file |
|
420 | 455 | |
|
456 | No newline at end of file | |
|
421 | self.var_process.start('ls') | |
|
No newline at end of file | ||
|
457 | No newline at end of file | |
|
422 | self.txtInfo.append("CMD: "+var_cmd) No newline at end of file | |
|
423 | 458 | No newline at end of file |
|
424 | 459 | # self.txtInfo.append("creando iso") No newline at end of file |
|
425 | 460 | # self.var_process.start(var_cmd) No newline at end of file |
|
426 | 461 | No newline at end of file |
|
427 | 462 | No newline at end of file |
|
428 | 463 | #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- No newline at end of file |
|
429 | 464 | No newline at end of file |
|
430 | 465 | @pyqtSignature("") No newline at end of file |
|
431 | 466 | def on_btnStopburn_clicked(self): No newline at end of file |
|
432 | 467 | """ No newline at end of file |
|
433 | 468 | Slot documentation goes here. No newline at end of file |
|
434 | 469 | """ No newline at end of file |
|
435 | 470 | self.bool_state_burning = False No newline at end of file |
|
436 | 471 | self.var_process.terminate() #Termina el proceso, si puede No newline at end of file |
|
437 | 472 | # self.var_process.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona No newline at end of file |
|
438 | 473 | self.txtInfo.append("Stopped recording") No newline at end of file |
|
439 | 474 | functions2.enabled_items2(False, self) |
|
No newline at end of file | ||
|
440 | self.btnStartburn.setText("Start Burn") No newline at end of file | |
|
441 | 475 | No newline at end of file |
|
442 | 476 | No newline at end of file |
|
443 | 477 | #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- No newline at end of file |
|
444 | 478 | No newline at end of file |
|
445 | 479 | @pyqtSignature("") No newline at end of file |
|
446 | 480 | def on_btnTdevA_clicked(self): No newline at end of file |
|
447 | 481 | var_dev = str(self.txtDeviceA.text()) No newline at end of file |
|
448 | 482 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
449 | 483 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
450 | 484 | No newline at end of file |
|
451 | 485 | @pyqtSignature("") No newline at end of file |
|
452 | 486 | def on_btnTdevB_clicked(self): No newline at end of file |
|
453 | 487 | var_dev = str(self.txtDeviceB.text()) No newline at end of file |
|
454 | 488 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
455 | 489 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
456 | 490 | No newline at end of file |
|
457 | 491 | @pyqtSignature("") No newline at end of file |
|
458 | 492 | def on_btnTdevC_clicked(self): No newline at end of file |
|
459 | 493 | var_dev = str(self.txtDeviceC.text()) No newline at end of file |
|
460 | 494 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
461 | 495 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
462 | 496 | No newline at end of file |
|
463 | 497 | @pyqtSignature("") No newline at end of file |
|
464 | 498 | def on_btnTdevD_clicked(self): No newline at end of file |
|
465 | 499 | var_dev = str(self.txtDeviceD.text()) No newline at end of file |
|
466 | 500 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
467 | 501 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
468 | 502 | No newline at end of file |
|
469 | 503 | @pyqtSignature("") No newline at end of file |
|
470 | 504 | def on_btnTDpath_clicked(self): No newline at end of file |
|
471 | 505 | """ No newline at end of file |
|
472 | 506 | Slot documentation goes here. No newline at end of file |
|
473 | 507 | """ No newline at end of file |
|
474 | 508 | self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file |
|
475 | 509 |
self. |
|
476 | 510 | self.statusTDpath = functions.dir_exists(self.var_TDpath, self) No newline at end of file |
|
477 | 511 | No newline at end of file |
|
478 | 512 | No newline at end of file |
|
479 | 513 | @pyqtSignature("") No newline at end of file |
|
480 | 514 | def on_btnCHstart_clicked(self): No newline at end of file |
|
481 | 515 | """ No newline at end of file |
|
482 | 516 | Slot documentation goes here. No newline at end of file |
|
483 | 517 |
|
|
484 | 518 | pass No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now