##// END OF EJS Templates
***
ralonso -
r87:88
parent child
Show More
@@ -1,361 +1,361
1 # -*- coding: utf-8 -*- No newline at end of file
1 # -*- coding: utf-8 -*-
2 No newline at end of file
2
3 #class BKmanager: No newline at end of file
3 #class BKmanager:
4 # def __init__(self): No newline at end of file
4 # def __init__(self):
5 No newline at end of file
5
6 from subprocess import * No newline at end of file
6 from subprocess import *
7 import sys No newline at end of file
7 import sys
8 import os No newline at end of file
8 import os
9 import subprocess No newline at end of file
9 import subprocess
10 import commands No newline at end of file
10 import commands
11 import shutil No newline at end of file
11 import shutil
12 import functions2 No newline at end of file
12 import functions2
13 No newline at end of file
13
14 #--------------------------------------------- Entero a cadena agregando ceros delante ------------------------------------------------- No newline at end of file
14 #--------------------------------------------- Entero a cadena agregando ceros delante -------------------------------------------------
15 No newline at end of file
15
16 def i2s(var_n, var_length=4): No newline at end of file
16 def i2s(var_n, var_length=4):
17 var_n2=str(var_n) No newline at end of file
17 var_n2=str(var_n)
18 while len(var_n2) < var_length: No newline at end of file
18 while len(var_n2) < var_length:
19 var_n2 = "0"+var_n2 No newline at end of file
19 var_n2 = "0"+var_n2
20 return var_n2 No newline at end of file
20 return var_n2
21 No newline at end of file
21
22 No newline at end of file
22
23 #----------------------------------------- Se verifica que la ruta exista y sea un directorio ------------------------------------------------- No newline at end of file
23 #----------------------------------------- Se verifica que la ruta exista y sea un directorio -------------------------------------------------
24 No newline at end of file
24
25 def dir_exists(var_dir, self): No newline at end of file
25 def dir_exists(var_dir, self):
26 if os.path.isdir(var_dir): No newline at end of file
26 if os.path.isdir(var_dir):
27 return True No newline at end of file
27 return True
28 else: No newline at end of file
28 else:
29 self.txtInfo.append("Incorrect path:" + str(var_dir)) No newline at end of file
29 self.txtInfo.append("Incorrect path:" + str(var_dir))
30 return False No newline at end of file
30 return False
31 No newline at end of file
31
32 No newline at end of file
32
33 #-------------------------------- Se buscan los archivos del tipo especificado y se cargan las fechas ----------------------------- No newline at end of file
33 #-------------------------------- Se buscan los archivos del tipo especificado y se cargan las fechas -----------------------------
34 No newline at end of file
34
35 def load_days(self): No newline at end of file
35 def load_days(self):
36 No newline at end of file
36
37 self.var_list=[] No newline at end of file
37 self.var_list=[]
38 self.lstStartDay.clear() No newline at end of file
38 self.lstStartDay.clear()
39 self.lstStopDay.clear() No newline at end of file
39 self.lstStopDay.clear()
40 No newline at end of file
40
41 if self.statusDpath == False: No newline at end of file
41 if self.statusDpath == False:
42 self.btnGbkp.setEnabled(False) No newline at end of file
42 self.btnGbkp.setEnabled(False)
43 return No newline at end of file
43 return
44 No newline at end of file
44
45 if self.var_Dtype == '': No newline at end of file
45 if self.var_Dtype == '':
46 return No newline at end of file
46 return
47 No newline at end of file
47
48 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 var_cmd="find " + str(self.var_Dpath) + " -name *."+ str(self.var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
49 output=commands.getstatusoutput(var_cmd)[1] No newline at end of file
49 output=commands.getstatusoutput(var_cmd)[1]
50 No newline at end of file
50
51 #Si no se encuentra ningun archivo No newline at end of file
51 #Si no se encuentra ningun archivo
52 if len(output) == 0: No newline at end of file
52 if len(output) == 0:
53 self.txtInfo.append("File not found") No newline at end of file
53 self.txtInfo.append("File not found")
54 self.btnGbkp.setEnabled(False) No newline at end of file
54 self.btnGbkp.setEnabled(False)
55 return No newline at end of file
55 return
56 No newline at end of file
56
57 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) No newline at end of file
57 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
58 for i in range(0, (len(output)+1)/8): No newline at end of file
58 for i in range(0, (len(output)+1)/8):
59 self.var_list.append(output[8*i:8*(i+1)-1]) No newline at end of file
59 self.var_list.append(output[8*i:8*(i+1)-1])
60 No newline at end of file
60
61 for i in self.var_list: No newline at end of file
61 for i in self.var_list:
62 self.lstStartDay.addItem(i) No newline at end of file
62 self.lstStartDay.addItem(i)
63 self.lstStopDay.addItem(i) No newline at end of file
63 self.lstStopDay.addItem(i)
64 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) No newline at end of file
64 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
65 No newline at end of file
65
66 get_sub_list(self) No newline at end of file
66 get_sub_list(self)
67 self.btnGbkp.setEnabled(True) No newline at end of file
67 self.btnGbkp.setEnabled(True)
68 No newline at end of file
68
69 No newline at end of file
69
70 #-------------------------------------------------- Obtiene el rango de las fechas seleccionadas ----------------------------------------- No newline at end of file
70 #-------------------------------------------------- Obtiene el rango de las fechas seleccionadas -----------------------------------------
71 No newline at end of file
71
72 def get_sub_list(self): No newline at end of file
72 def get_sub_list(self):
73 self.var_sublist=[] No newline at end of file
73 self.var_sublist=[]
74 for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]: No newline at end of file
74 for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]:
75 self.var_sublist.append(i) No newline at end of file
75 self.var_sublist.append(i)
76 No newline at end of file
76
77 No newline at end of file
77
78 #----------------------------------------------------- Verifica los parametros faltantes ----------------------------------------------------------- No newline at end of file
78 #----------------------------------------------------- Verifica los parametros faltantes -----------------------------------------------------------
79 No newline at end of file
79
80 def validate_parameters(self): No newline at end of file
80 def validate_parameters(self):
81 #Verifica que las ruta del proyecto sea valida No newline at end of file
81 #Verifica que las ruta del proyecto sea valida
82 if self.statusRpath == False: No newline at end of file
82 if self.statusRpath == False:
83 self.txtInfo.append("Incorrect proyect path") No newline at end of file
83 self.txtInfo.append("Incorrect proyect path")
84 return False No newline at end of file
84 return False
85 No newline at end of file
85
86 #Verifica la etiqueta No newline at end of file
86 #Verifica la etiqueta
87 if len(self.var_Elabel) == 0: No newline at end of file
87 if len(self.var_Elabel) == 0:
88 self.txtInfo.append("Enter label") No newline at end of file
88 self.txtInfo.append("Enter label")
89 return False No newline at end of file
89 return False
90 No newline at end of file
90
91 return True No newline at end of file
91 return True
92 No newline at end of file
92
93 No newline at end of file
93
94 #------------------------------------------------- Crea directorios en la ruta indicada ----------------------------------------------------------- No newline at end of file
94 #------------------------------------------------- Crea directorios en la ruta indicada -----------------------------------------------------------
95 No newline at end of file
95
96 def make_dirs(list_dirs, self): No newline at end of file
96 def make_dirs(list_dirs, self):
97 No newline at end of file
97
98 for var_dir in list_dirs: No newline at end of file
98 for var_dir in list_dirs:
99 shutil.rmtree(self.var_Rpath+'/'+var_dir, True) No newline at end of file
99 shutil.rmtree(self.var_Rpath+'/'+var_dir, True)
100 var_output=commands.getstatusoutput("mkdir -p "+self.var_Rpath+'/'+var_dir) No newline at end of file
100 var_output=commands.getstatusoutput("mkdir -p "+self.var_Rpath+'/'+var_dir)
101 if var_output[0] != 0: No newline at end of file
101 if var_output[0] != 0:
102 self.txtInfo.append("Error creating directory: "+var_dir+", output_error:" + str(var_output[0])) No newline at end of file
102 self.txtInfo.append("Error creating directory: "+var_dir+", output_error:" + str(var_output[0]))
103 return False No newline at end of file
103 return False
104 self.txtInfo.append('Directories created correctly') No newline at end of file
104 self.txtInfo.append('Directories created correctly')
105 return True No newline at end of file
105 return True
106 No newline at end of file
106
107 def remove_dir(var_dir, self): No newline at end of file
107 def remove_dir(var_dir, self):
108 var_output = commands.getstatusoutput('chmod -R 777 '+var_dir) No newline at end of file
108 var_output = commands.getstatusoutput('chmod -R 777 '+var_dir)
109 if var_output[0] != 0: No newline at end of file
109 if var_output[0] != 0:
110 self.txtInfo.append("Error changing permissions: "+var_dir+", output_error:" + str(var_output[0])) No newline at end of file
110 self.txtInfo.append("Error changing permissions: "+var_dir+", output_error:" + str(var_output[0]))
111 return False No newline at end of file
111 return False
112 No newline at end of file
112
113 var_output = commands.getstatusoutput('rm -rf '+var_dir) No newline at end of file
113 var_output = commands.getstatusoutput('rm -rf '+var_dir)
114 if var_output[0] != 0: No newline at end of file
114 if var_output[0] != 0:
115 self.txtInfo.append("Error deleting directory: "+var_dir+", output_error:" + str(var_output[0])) No newline at end of file
115 self.txtInfo.append("Error deleting directory: "+var_dir+", output_error:" + str(var_output[0]))
116 return False No newline at end of file
116 return False
117 return True No newline at end of file
117 return True
118 No newline at end of file
118
119 def make_dir(var_dir, self): No newline at end of file
119 def make_dir(var_dir, self):
120 var_output = commands.getstatusoutput('mkdir '+var_dir) No newline at end of file
120 var_output = commands.getstatusoutput('mkdir '+var_dir)
121 if var_output[0] != 0:
121 if var_output[0] != 0:
No newline at end of file
122 self.txtInfo.append("Error making directory: "+var_dir+", output_error:" + str(var_output[0])) No newline at end of file
122 self.txtInfo.append("Error deleting directory: "+var_dir+", output_error:" + str(var_output[0])) No newline at end of file
123 return False No newline at end of file
123 return False
124 return True No newline at end of file
124 return True
125 No newline at end of file
125
126 #-------------------------------------------- Busca los archivos con los parametros de busqueda --------------------------------------- No newline at end of file
126 #-------------------------------------------- Busca los archivos con los parametros de busqueda ---------------------------------------
127 No newline at end of file
127
128 def list_files(self): No newline at end of file
128 def list_files(self):
129 var_files_list=[] No newline at end of file
129 var_files_list=[]
130 for var_doy in self.var_sublist: No newline at end of file
130 for var_doy in self.var_sublist:
131 var_cmd="find " + str(self.var_Dpath) + " -name ?"+var_doy+"???."+ str(self.var_Dtype) + " |sort" No newline at end of file
131 var_cmd="find " + str(self.var_Dpath) + " -name ?"+var_doy+"???."+ str(self.var_Dtype) + " |sort"
132 var_output=commands.getstatusoutput(var_cmd)[1] No newline at end of file
132 var_output=commands.getstatusoutput(var_cmd)[1]
133 for var_file in var_output.split(): No newline at end of file
133 for var_file in var_output.split():
134 var_files_list.append(var_file) #Almacena cada archivo en la lista No newline at end of file
134 var_files_list.append(var_file) #Almacena cada archivo en la lista
135 return var_files_list No newline at end of file
135 return var_files_list
136 No newline at end of file
136
137 No newline at end of file
137
138 #--------------- Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD ----------------------- No newline at end of file
138 #--------------- Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD -----------------------
139 No newline at end of file
139
140 def make_files_dat(var_files_list, self): No newline at end of file
140 def make_files_dat(var_files_list, self):
141 var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar No newline at end of file
141 var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar
142 var_n=1 #Numero del DVD actual No newline at end of file
142 var_n=1 #Numero del DVD actual
143 var_tmp=0 #Se usa para acumular el tamaΓ±o de los archivos de la lista No newline at end of file
143 var_tmp=0 #Se usa para acumular el tamaΓ±o de los archivos de la lista
144 var_files_list_2=[] #Se usa para almacenar la lista de archivos agrbar en cada DVD No newline at end of file
144 var_files_list_2=[] #Se usa para almacenar la lista de archivos agrbar en cada DVD
145 No newline at end of file
145
146 for i in var_files_list: #Se asignan en i los archivos de la lista No newline at end of file
146 for i in var_files_list: #Se asignan en i los archivos de la lista
147 No newline at end of file
147
148 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
148 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
149 var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista No newline at end of file
149 var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista
150 No newline at end of file
150
151 #Si el tamaΓ±o acumulado es mayor que el de el DVD No newline at end of file
151 #Si el tamaΓ±o acumulado es mayor que el de el DVD
152 if var_tmp > (self.var_Dcapacity * 1024): No newline at end of file
152 if var_tmp > (self.var_Dcapacity * 1024):
153 var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real No newline at end of file
153 var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real
154 #se crea un archivo con numeral en el sufijo y extension .dat No newline at end of file
154 #se crea un archivo con numeral en el sufijo y extension .dat
155 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w") No newline at end of file
155 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w")
156 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat No newline at end of file
156 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
157 for line in var_files_list_2: No newline at end of file
157 for line in var_files_list_2:
158 var_tmp_path=line.split(self.var_Dpath)[1][:-13] No newline at end of file
158 var_tmp_path=line.split(self.var_Dpath)[1][:-13]
159 var_file.write(var_tmp_path+'='+line+'\n') No newline at end of file
159 var_file.write(var_tmp_path+'='+line+'\n')
160 var_file.close() No newline at end of file
160 var_file.close()
161 No newline at end of file
161
162 var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual No newline at end of file
162 var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual
163 var_files_list_2=[] #Se reinicia la lista No newline at end of file
163 var_files_list_2=[] #Se reinicia la lista
164 var_n += 1 No newline at end of file
164 var_n += 1
165 var_files_list_2.append(i) No newline at end of file
165 var_files_list_2.append(i)
166 No newline at end of file
166
167 #se crea un archivo con numeral en el sufijo y extension .dat No newline at end of file
167 #se crea un archivo con numeral en el sufijo y extension .dat
168 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w") No newline at end of file
168 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w")
169 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat No newline at end of file
169 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
170 for line in var_files_list_2: No newline at end of file
170 for line in var_files_list_2:
171 var_tmp_path=line.split(self.var_Dpath)[1][:-13] No newline at end of file
171 var_tmp_path=line.split(self.var_Dpath)[1][:-13]
172 var_file.write(var_tmp_path+'='+line+'\n') No newline at end of file
172 var_file.write(var_tmp_path+'='+line+'\n')
173 var_file.close() No newline at end of file
173 var_file.close()
174 No newline at end of file
174
175 self.txtInfo.append("configuration files created") No newline at end of file
175 self.txtInfo.append("configuration files created")
176 return var_n No newline at end of file
176 return var_n
177 No newline at end of file
177
178 No newline at end of file
178
179 #------------------------------ Genera los archivos .print con los cuales se creara los postscript ----------------------------------- No newline at end of file
179 #------------------------------ Genera los archivos .print con los cuales se creara los postscript -----------------------------------
180 No newline at end of file
180
181 def make_files_print(self): No newline at end of file
181 def make_files_print(self):
182 No newline at end of file
182
183 var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar No newline at end of file
183 var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar
184 var_Rpath_gpath=self.var_Rpath+"/gpath" #Ruta de los archivos postscript No newline at end of file
184 var_Rpath_gpath=self.var_Rpath+"/gpath" #Ruta de los archivos postscript
185 var_labels=[] No newline at end of file
185 var_labels=[]
186 for m in range (0, self.txtPSgraphic.value() - 1): No newline at end of file
186 for m in range (0, self.txtPSgraphic.value() - 1):
187 var_lines = "\n" * 9 No newline at end of file
187 var_lines = "\n" * 9
188 var_labels.append(var_lines) No newline at end of file
188 var_labels.append(var_lines)
189 No newline at end of file
189
190 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .print No newline at end of file
190 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .print
191 for var_n in range(1, self.var_Discs + 1): No newline at end of file
191 for var_n in range(1, self.var_Discs + 1):
192 No newline at end of file
192
193 #se abren los archivos .dat en modo lectura No newline at end of file
193 #se abren los archivos .dat en modo lectura
194 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","r") No newline at end of file
194 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","r")
195 lines=var_file.readlines() # Se lee las lineas en el archivo y se almacenan en la lista No newline at end of file
195 lines=var_file.readlines() # Se lee las lineas en el archivo y se almacenan en la lista
196 var_file.close() No newline at end of file
196 var_file.close()
197 list_files=[] No newline at end of file
197 list_files=[]
198 var_lines=[] No newline at end of file
198 var_lines=[]
199 No newline at end of file
199
200 for j in range(0, len(lines)): No newline at end of file
200 for j in range(0, len(lines)):
201 No newline at end of file
201
202 if j == 0: No newline at end of file
202 if j == 0:
203 var_first_folder = lines[j].split('=')[0] No newline at end of file
203 var_first_folder = lines[j].split('=')[0]
204 var_first_file = (lines[j].split('=')[1])[:-1] No newline at end of file
204 var_first_file = (lines[j].split('=')[1])[:-1]
205 continue No newline at end of file
205 continue
206 No newline at end of file
206
207 var_tmp_folder = lines[j].split('=')[0] No newline at end of file
207 var_tmp_folder = lines[j].split('=')[0]
208 var_tmp_file = (lines[j].split('=')[1])[:-1] No newline at end of file
208 var_tmp_file = (lines[j].split('=')[1])[:-1]
209 No newline at end of file
209
210 # Si el subfolder superior o el DOY del archivo actual y el anterior son diferentes No newline at end of file
210 # Si el subfolder superior o el DOY del archivo actual y el anterior son diferentes
211 if (var_tmp_folder != var_first_folder) or (var_tmp_file[0:-5] != var_first_file[0:-5]): No newline at end of file
211 if (var_tmp_folder != var_first_folder) or (var_tmp_file[0:-5] != var_first_file[0:-5]):
212 var_last_file = (lines[j-1].split('=')[1])[:-1] No newline at end of file
212 var_last_file = (lines[j-1].split('=')[1])[:-1]
213 list_files.append([var_first_folder, var_first_file, var_last_file]) No newline at end of file
213 list_files.append([var_first_folder, var_first_file, var_last_file])
214 No newline at end of file
214
215 var_first_folder = lines[j].split('=')[0] No newline at end of file
215 var_first_folder = lines[j].split('=')[0]
216 var_first_file = (lines[j].split('=')[1])[:-1] No newline at end of file
216 var_first_file = (lines[j].split('=')[1])[:-1]
217 No newline at end of file
217
218 var_last_file = (lines[-1].split('=')[1])[:-1] No newline at end of file
218 var_last_file = (lines[-1].split('=')[1])[:-1]
219 list_files.append([var_first_folder, var_first_file, var_last_file]) No newline at end of file
219 list_files.append([var_first_folder, var_first_file, var_last_file])
220 No newline at end of file
220
221 var_lines2 = lines_print(list_files, self.var_Elabel) No newline at end of file
221 var_lines2 = lines_print(list_files, self.var_Elabel)
222 No newline at end of file
222
223 for k in range(0, len(var_lines2) / 5): No newline at end of file
223 for k in range(0, len(var_lines2) / 5):
224 var_lines=["\n"] No newline at end of file
224 var_lines=["\n"]
225 var_lines.append(" "+self.var_Elabel+" "+i2s(var_n)+"/"+i2s(self.var_Discs)+"\n") No newline at end of file
225 var_lines.append(" "+self.var_Elabel+" "+i2s(var_n)+"/"+i2s(self.var_Discs)+"\n")
226 var_lines.append("Year Doy Folder"+" "*9+"Set"+" "*11+"Time range\n") No newline at end of file
226 var_lines.append("Year Doy Folder"+" "*9+"Set"+" "*11+"Time range\n")
227 var_lines.extend(var_lines2[(5*k):(5*(k+1))]) No newline at end of file
227 var_lines.extend(var_lines2[(5*k):(5*(k+1))])
228 var_lines.append("\n") No newline at end of file
228 var_lines.append("\n")
229 var_labels.append(var_lines) No newline at end of file
229 var_labels.append(var_lines)
230 No newline at end of file
230
231 for i in range(0, (len(var_labels) // 33) +1 ): No newline at end of file
231 for i in range(0, (len(var_labels) // 33) +1 ):
232 var_file=var_Rpath_gpath+"/"+self.var_Elabel+"_"+i2s(i+1) No newline at end of file
232 var_file=var_Rpath_gpath+"/"+self.var_Elabel+"_"+i2s(i+1)
233 file_ps = open(var_file+".print","w") No newline at end of file
233 file_ps = open(var_file+".print","w")
234 if i == (len(var_labels) // 33): No newline at end of file
234 if i == (len(var_labels) // 33):
235 var_sub_labels = var_labels[33*i:] No newline at end of file
235 var_sub_labels = var_labels[33*i:]
236 else: No newline at end of file
236 else:
237 var_sub_labels = var_labels[33*i:33*(i+1)] No newline at end of file
237 var_sub_labels = var_labels[33*i:33*(i+1)]
238 No newline at end of file
238
239 for label in var_sub_labels: No newline at end of file
239 for label in var_sub_labels:
240 for line in label: No newline at end of file
240 for line in label:
241 file_ps.write(line) No newline at end of file
241 file_ps.write(line)
242 file_ps.close() No newline at end of file
242 file_ps.close()
243 var_cmd="enscript "+var_file+".print -p "+var_file+".ps -f Times-Roman7 " \ No newline at end of file
243 var_cmd="enscript "+var_file+".print -p "+var_file+".ps -f Times-Roman7 " \
244 +" -3R -j -B --margins=21.25:20.4:25.51:20 --media=A4" No newline at end of file
244 +" -3R -j -B --margins=21.25:20.4:25.51:20 --media=A4"
245 var_output=commands.getstatusoutput(var_cmd)[0] No newline at end of file
245 var_output=commands.getstatusoutput(var_cmd)[0]
246 No newline at end of file
246
247 No newline at end of file
247
248 def lines_print(list_files, var_Elabel): No newline at end of file
248 def lines_print(list_files, var_Elabel):
249 """ No newline at end of file
249 """
250 Devuelve las lineas del rango de archivos de cada etiqueta segun el formato No newline at end of file
250 Devuelve las lineas del rango de archivos de cada etiqueta segun el formato
251 """ No newline at end of file
251 """
252 var_lines=[] No newline at end of file
252 var_lines=[]
253 for i in list_files: No newline at end of file
253 for i in list_files:
254 No newline at end of file
254
255 # Si el archivo se grabara directamente en la / del DVD y no en un /directorio/ No newline at end of file
255 # Si el archivo se grabara directamente en la / del DVD y no en un /directorio/
256 # se usa la etiqueta para indicar la parte de la etiqueta donde va el subdirectorio No newline at end of file
256 # se usa la etiqueta para indicar la parte de la etiqueta donde va el subdirectorio
257 if i[0] == '/': No newline at end of file
257 if i[0] == '/':
258 var_folder = var_Elabel No newline at end of file
258 var_folder = var_Elabel
259 else: No newline at end of file
259 else:
260 var_folder = i[0].split('/')[-2] No newline at end of file
260 var_folder = i[0].split('/')[-2]
261 No newline at end of file
261
262 var_first_file = i[1] No newline at end of file
262 var_first_file = i[1]
263 var_last_file = i[2] No newline at end of file
263 var_last_file = i[2]
264 No newline at end of file
264
265 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1] No newline at end of file
265 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1]
266 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1] No newline at end of file
266 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1]
267 No newline at end of file
267
268 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
268 var_lines.append(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+"-"
269 +var_last_file[-5:-2]+" "+var_date_first_file+"-"+var_date_last_file+"\n") No newline at end of file
269 +var_last_file[-5:-2]+" "+var_date_first_file+"-"+var_date_last_file+"\n")
270 #Nos aseguramos que sea un mutiplo de 5 No newline at end of file
270 #Nos aseguramos que sea un mutiplo de 5
271 while (len(var_lines) % 5) != 0: No newline at end of file
271 while (len(var_lines) % 5) != 0:
272 var_lines.append("\n") No newline at end of file
272 var_lines.append("\n")
273 No newline at end of file
273
274 return var_lines No newline at end of file
274 return var_lines
275 No newline at end of file
275
276 #---------------------------------------comandos para el proceso de grabacion ------------------------------------------ No newline at end of file
276 #---------------------------------------comandos para el proceso de grabacion ------------------------------------------
277 def cmd_iso(self): No newline at end of file
277 def cmd_iso(self):
278 var_Rpath_ppath=self.var_Rpath+"/ppath" No newline at end of file
278 var_Rpath_ppath=self.var_Rpath+"/ppath"
279 var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file
279 var_Rpath_iso=self.var_Rpath+"/iso"
280 #comando para la creacion del archivo.iso No newline at end of file
280 #comando para la creacion del archivo.iso
281 file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(self.var_disc_n)+".dat" No newline at end of file
281 file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(self.var_disc_n)+".dat"
282 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso" No newline at end of file
282 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso"
283 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' No newline at end of file
283 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
284 var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel No newline at end of file
284 var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel
285 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso No newline at end of file
285 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
286 return var_cmd No newline at end of file
286 return var_cmd
287 No newline at end of file
287
288 def cmd_burn(self): No newline at end of file
288 def cmd_burn(self):
289 var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file
289 var_Rpath_iso=self.var_Rpath+"/iso"
290 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso" No newline at end of file
290 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso"
291 No newline at end of file
291
292 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
292 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
293 var_dev_tmp = self.var_devices[var_index] No newline at end of file
293 var_dev_tmp = self.var_devices[var_index]
294 No newline at end of file
294
295 # var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso No newline at end of file
295 # var_cmd = "wodim -v dev="+var_dev_tmp+" speed=16 "+ file_iso
296 var_cmd = "growisofs -dvd-compat -Z "+var_dev_tmp+"="+ file_iso No newline at end of file
296 var_cmd = "growisofs -dvd-compat -Z "+var_dev_tmp+"="+ file_iso
297 return var_cmd No newline at end of file
297 return var_cmd
298 No newline at end of file
298
299 No newline at end of file
299
300 def cmd_check(dev_sr, self): No newline at end of file
300 def cmd_check(dev_sr, self):
301 No newline at end of file
301
302 var_Rpath_tmpdata=self.var_Rpath+"/tmpdata" No newline at end of file
302 var_Rpath_tmpdata=self.var_Rpath+"/tmpdata"
303 No newline at end of file
303
304 var_output=commands.getstatusoutput('df -hT | grep '+dev_sr) No newline at end of file
304 var_output=commands.getstatusoutput('df -hT | grep '+dev_sr)
305 if var_output[0] != 0: No newline at end of file
305 if var_output[0] != 0:
306 return "FATAL ERROR" No newline at end of file
306 return "FATAL ERROR"
307 else: No newline at end of file
307 else:
308 var_cmd = "cp -rfv "+var_output[1] .split()[-1]+"/ "+var_Rpath_tmpdata+"/" No newline at end of file
308 var_cmd = "cp -rfv "+var_output[1] .split()[-1]+"/ "+var_Rpath_tmpdata+"/"
309 return var_cmd No newline at end of file
309 return var_cmd
310 No newline at end of file
310
311 def cmd_manual_check(var_data_dir, var_TDpath): No newline at end of file
311 def cmd_manual_check(var_data_dir, var_TDpath):
312 No newline at end of file
312
313 var_cmd = "cp -rfv "+var_data_dir+"/ "+var_TDpath+"/" No newline at end of file
313 var_cmd = "cp -rfv "+var_data_dir+"/ "+var_TDpath+"/"
314 return var_cmd No newline at end of file
314 return var_cmd
315 No newline at end of file
315
316 No newline at end of file
316
317 def remove_iso(self): No newline at end of file
317 def remove_iso(self):
318 var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file
318 var_Rpath_iso=self.var_Rpath+"/iso"
319 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso" No newline at end of file
319 file_iso=var_Rpath_iso+"/"+i2s(self.var_disc_n)+".iso"
320 # shutil.rmtree(self.var_Rpath+'/'+var_dir, True) No newline at end of file
320 # shutil.rmtree(self.var_Rpath+'/'+var_dir, True)
321 if os.path.isfile(file_iso): No newline at end of file
321 if os.path.isfile(file_iso):
322 os.remove(file_iso) No newline at end of file
322 os.remove(file_iso)
323 No newline at end of file
323
324 #Si es el ultimo disco se termina el proceso No newline at end of file
324 #Si es el ultimo disco se termina el proceso
325 def is_last_disc_and_copy(self): No newline at end of file
325 def is_last_disc_and_copy(self):
326 if self.var_disc_n == self.var_Discs and self.var_copy_n == self.var_Copys: No newline at end of file
326 if self.var_disc_n == self.var_Discs and self.var_copy_n == self.var_Copys:
327 self.function_final() No newline at end of file
327 self.function_final()
328 else: No newline at end of file
328 else:
329 next_disc(self) No newline at end of file
329 next_disc(self)
330 No newline at end of file
330
331 #Define cual es el siguiente disco a grabar y que paso seguir No newline at end of file
331 #Define cual es el siguiente disco a grabar y que paso seguir
332 def next_disc(self, error = False): No newline at end of file
332 def next_disc(self, error = False):
333 if self.var_copy_n == self.var_Copys: No newline at end of file
333 if self.var_copy_n == self.var_Copys:
334 #borrado del iso No newline at end of file
334 #borrado del iso
335 self.txtInfo.append("Deleting iso file: "+i2s(self.var_disc_n)+".iso") No newline at end of file
335 self.txtInfo.append("Deleting iso file: "+i2s(self.var_disc_n)+".iso")
336 remove_iso(self) No newline at end of file
336 remove_iso(self)
337 No newline at end of file
337
338 self.var_disc_n += 1 No newline at end of file
338 self.var_disc_n += 1
339 self.var_copy_n = 1 No newline at end of file
339 self.var_copy_n = 1
340 self.var_step = 0 No newline at end of file
340 self.var_step = 0
341 No newline at end of file
341
342 else: No newline at end of file
342 else:
343 self.var_copy_n += 1 No newline at end of file
343 self.var_copy_n += 1
344 self.var_step = 1 No newline at end of file
344 self.var_step = 1
345 No newline at end of file
345
346 functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente No newline at end of file
346 functions2.make_burning_conf(self) # Si el proceso no ha sido detenido manualmente
347 #crea el archivo burning.conf para el seguimiento de los discos grabados No newline at end of file
347 #crea el archivo burning.conf para el seguimiento de los discos grabados
348 No newline at end of file
348
349 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
349 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
350 No newline at end of file
350
351 self.txtInfo.append("NEXT DISC: "+str(self.var_disc_n)+" COPY: "+str(self.var_copy_n) No newline at end of file
351 self.txtInfo.append("NEXT DISC: "+str(self.var_disc_n)+" COPY: "+str(self.var_copy_n)
352 +" INDEX: "+str(var_index)+" STEP: "+str(self.var_step)) No newline at end of file
352 +" INDEX: "+str(var_index)+" STEP: "+str(self.var_step))
353 self.txtInfo.append("\n") No newline at end of file
353 self.txtInfo.append("\n")
354 No newline at end of file
354
355 if var_index == 0 : No newline at end of file
355 if var_index == 0 :
356 self.function_eject() No newline at end of file
356 self.function_eject()
357 No newline at end of file
357
358 elif self.var_step == 0: No newline at end of file
358 elif self.var_step == 0:
359 self.function_iso() No newline at end of file
359 self.function_iso()
360 elif self.var_step == 1: No newline at end of file
360 elif self.var_step == 1:
361 self.function_burn() No newline at end of file
361 self.function_burn()
@@ -1,305 +1,290
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 var_devices = var_output[1].split('\n') No newline at end of file
23 var_devices = var_output[1].split('\n')
24 No newline at end of file
24
25 var_tmp=[] No newline at end of file
25 var_tmp=[]
26 for i in range(0, 4): No newline at end of file
26 for i in range(0, 4):
27 if i < len(var_devices): No newline at end of file
27 if i < len(var_devices):
28 var_len = len(var_devices[i]) No newline at end of file
28 var_len = len(var_devices[i])
29 var_tmp.append(var_devices[i][1:var_len - 1]) No newline at end of file
29 var_tmp.append(var_devices[i][1:var_len - 1])
30 else: No newline at end of file
30 else:
31 var_tmp.append('') No newline at end of file
31 var_tmp.append('')
32 No newline at end of file
32
33 #Se escriben los dispostivos correspodientes, si existen No newline at end of file
33 #Se escriben los dispostivos correspodientes, si existen
34 self.txtDeviceA.setText(str(var_tmp[0])) No newline at end of file
34 self.txtDeviceA.setText(str(var_tmp[0]))
35 self.txtDeviceB.setText(str(var_tmp[1])) No newline at end of file
35 self.txtDeviceB.setText(str(var_tmp[1]))
36 self.txtDeviceC.setText(str(var_tmp[2])) No newline at end of file
36 self.txtDeviceC.setText(str(var_tmp[2]))
37 self.txtDeviceD.setText(str(var_tmp[3])) No newline at end of file
37 self.txtDeviceD.setText(str(var_tmp[3]))
38 #Se desactivan los que no existen No newline at end of file
38 #Se desactivan los que no existen
39 if len(var_tmp[0]) == 0 : No newline at end of file
39 if len(var_tmp[0]) == 0 :
40 self.chkDevA.setChecked(False) No newline at end of file
40 self.chkDevA.setChecked(False)
41 self.chkDevA.setEnabled(False) No newline at end of file
41 self.chkDevA.setEnabled(False)
42 if len(var_tmp[1]) == 0 : No newline at end of file
42 if len(var_tmp[1]) == 0 :
43 self.chkDevB.setChecked(False) No newline at end of file
43 self.chkDevB.setChecked(False)
44 self.chkDevB.setEnabled(False) No newline at end of file
44 self.chkDevB.setEnabled(False)
45 if len(var_tmp[2]) == 0 : No newline at end of file
45 if len(var_tmp[2]) == 0 :
46 self.chkDevC.setChecked(False) No newline at end of file
46 self.chkDevC.setChecked(False)
47 self.chkDevC.setEnabled(False) No newline at end of file
47 self.chkDevC.setEnabled(False)
48 if len(var_tmp[3]) == 0 : No newline at end of file
48 if len(var_tmp[3]) == 0 :
49 self.chkDevD.setChecked(False) No newline at end of file
49 self.chkDevD.setChecked(False)
50 self.chkDevD.setEnabled(False) No newline at end of file
50 self.chkDevD.setEnabled(False)
51 No newline at end of file
51
52 #----------------------------------- expulsa los dispositivos de grabacion -------------------------------------------- No newline at end of file
52 #----------------------------------- expulsa los dispositivos de grabacion --------------------------------------------
53 No newline at end of file
53
54 def eject_devices(self): No newline at end of file
54 def eject_devices(self):
55 for var_dev in self.var_devices: No newline at end of file
55 for var_dev in self.var_devices:
56 var_cmd = 'eject ' + var_dev No newline at end of file
56 var_cmd = 'eject ' + var_dev
57 commands.getstatusoutput(var_cmd) No newline at end of file
57 commands.getstatusoutput(var_cmd)
58 No newline at end of file
58
59 #Expulsa el dispositivo de grabacion actual No newline at end of file
59 #Expulsa el dispositivo de grabacion actual
60 def eject_one_device(self): No newline at end of file
60 def eject_one_device(self):
61 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
61 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
62 var_dev = self.var_devices[var_index] No newline at end of file
62 var_dev = self.var_devices[var_index]
63 var_cmd = 'eject ' + var_dev No newline at end of file
63 var_cmd = 'eject ' + var_dev
64 commands.getstatusoutput(var_cmd) No newline at end of file
64 commands.getstatusoutput(var_cmd)
65 No newline at end of file
65
66 def eject_t_one_device(self): No newline at end of file
66 def eject_t_one_device(self):
67 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
67 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
68 var_dev = self.var_devices[var_index] No newline at end of file
68 var_dev = self.var_devices[var_index]
69 var_cmd = 'eject -t ' + var_dev No newline at end of file
69 var_cmd = 'eject -t ' + var_dev
70 commands.getstatusoutput(var_cmd) No newline at end of file
70 commands.getstatusoutput(var_cmd)
71 No newline at end of file
71
72 def get_dev_sr(self): No newline at end of file
72 def get_dev_sr(self):
73 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
73 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
74 var_dev = self.var_devices[var_index] No newline at end of file
74 var_dev = self.var_devices[var_index]
75 var_output=commands.getstatusoutput('ls -lh '+var_dev) No newline at end of file
75 var_output=commands.getstatusoutput('ls -lh '+var_dev)
76 if var_output[0] != 0: No newline at end of file
76 if var_output[0] != 0:
77 return "FATAL ERROR" No newline at end of file
77 return "FATAL ERROR"
78 else: No newline at end of file
78 else:
79 var_dev_sr = "/dev/"+var_output[1] .split()[-1] No newline at end of file
79 var_dev_sr = "/dev/"+var_output[1] .split()[-1]
80 return var_dev_sr No newline at end of file
80 return var_dev_sr
81 No newline at end of file
81
82 No newline at end of file
82
83 #----------------------------------- devuelve una lista con las carpetas en las cuales estan montados los dispositivos -------------------------------------------- No newline at end of file
83 #----------------------------------- devuelve una lista con las carpetas en las cuales estan montados los dispositivos --------------------------------------------
84 def mounted_devices(): No newline at end of file
84 def mounted_devices():
85
85
No newline at end of file
86 var_type = "iso9660" No newline at end of file
86 var_type = "tmpfs" No newline at end of file
87 var_output=commands.getstatusoutput('df -hT | grep '+ var_type) No newline at end of file
87 var_output=commands.getstatusoutput('df -hT | grep '+ var_type)
88 No newline at end of file
88
89 if var_output[0] != 0: No newline at end of file
89 if var_output[0] != 0:
90 return "FATAL ERROR" No newline at end of file
90 return "FATAL ERROR"
91 No newline at end of file
91
92 else: No newline at end of file
92 else:
93 if len(var_output[1]) == 0: No newline at end of file
93 if len(var_output[1]) == 0:
94 return "FATAL ERROR" No newline at end of file
94 return "FATAL ERROR"
95 No newline at end of file
95
96 list_dirs = [] No newline at end of file
96 list_dirs = []
97 for var_dir in var_output[1].split('\n'): No newline at end of file
97 for var_dir in var_output[1].split('\n'):
98 list_dirs.append(var_dir.split()[-1]) No newline at end of file
98 list_dirs.append(var_dir.split()[-1])
99 No newline at end of file
99
100 return list_dirs No newline at end of file
100 return list_dirs
101 No newline at end of file
101
102 No newline at end of file
102
103 #----------------------------------- listado de los dispositivos de grabacion seleccionados -------------------------------------------- No newline at end of file
103 #----------------------------------- listado de los dispositivos de grabacion seleccionados --------------------------------------------
104 No newline at end of file
104
105 def selected_devices(self): No newline at end of file
105 def selected_devices(self):
106 self.var_devices=[] No newline at end of file
106 self.var_devices=[]
107 if self.chkDevA.isChecked(): No newline at end of file
107 if self.chkDevA.isChecked():
108 self.var_devices.append(str(self.txtDeviceA.text())) No newline at end of file
108 self.var_devices.append(str(self.txtDeviceA.text()))
109 if self.chkDevB.isChecked(): No newline at end of file
109 if self.chkDevB.isChecked():
110 self.var_devices.append(str(self.txtDeviceB.text())) No newline at end of file
110 self.var_devices.append(str(self.txtDeviceB.text()))
111 if self.chkDevC.isChecked(): No newline at end of file
111 if self.chkDevC.isChecked():
112 self.var_devices.append(str(self.txtDeviceC.text())) No newline at end of file
112 self.var_devices.append(str(self.txtDeviceC.text()))
113 if self.chkDevD.isChecked(): No newline at end of file
113 if self.chkDevD.isChecked():
114 self.var_devices.append(str(self.txtDeviceD.text())) No newline at end of file
114 self.var_devices.append(str(self.txtDeviceD.text()))
115 No newline at end of file
115
116 if len(self.var_devices) == 0: No newline at end of file
116 if len(self.var_devices) == 0:
117 return False No newline at end of file
117 return False
118 else: No newline at end of file
118 else:
119 return True No newline at end of file
119 return True
120 No newline at end of file
120
121 No newline at end of file
121
122 #----------------------------------------------------- Inicializacion para pruebas--------------------------------------------------------------- No newline at end of file
122 #----------------------------------------------------- Inicializacion para pruebas---------------------------------------------------------------
123 No newline at end of file
123
124 def set_parameters_test(self): No newline at end of file
124 def set_parameters_test(self):
125 """ No newline at end of file
125 """
126 Se usa para inicializar ciertos parametros para pruebas No newline at end of file
126 Se usa para inicializar ciertos parametros para pruebas
127 """ No newline at end of file
127 """
128 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS') No newline at end of file
128 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS')
129 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager') No newline at end of file
129 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager')
130 self.txtElabel.setText('EW_DRIFTS_pruebas') No newline at end of file
130 self.txtElabel.setText('EW_DRIFTS_pruebas')
131 self.lstDcapacity.setCurrentIndex(4) No newline at end of file
131 self.lstDcapacity.setCurrentIndex(4)
132 self.txtDcapacity.setValue(100.0) No newline at end of file
132 self.txtDcapacity.setValue(100.0)
133 self.txtDcapacity.setReadOnly(False) No newline at end of file
133 self.txtDcapacity.setReadOnly(False)
134 No newline at end of file
134
135 def set_devices_test(self): No newline at end of file
135 def set_devices_test(self):
136 self.txtDeviceA.setText("/dev/scd0") No newline at end of file
136 self.txtDeviceA.setText("/dev/scd0")
137 self.txtDeviceB.setText("/dev/scd1") No newline at end of file
137 self.txtDeviceB.setText("/dev/scd1")
138 self.txtDeviceC.setText("/dev/scd2") No newline at end of file
138 self.txtDeviceC.setText("/dev/scd2")
139 self.txtDeviceD.setText("/dev/scd3") No newline at end of file
139 self.txtDeviceD.setText("/dev/scd3")
140 No newline at end of file
140
141 No newline at end of file
141
142 No newline at end of file
142
143 #----------------------------------------------------- crea parameters.conf --------------------------------------------------------------- No newline at end of file
143 #----------------------------------------------------- crea parameters.conf ---------------------------------------------------------------
144 No newline at end of file
144
145 def make_parameters_conf(self): No newline at end of file
145 def make_parameters_conf(self):
146 var_file = open("parameters.conf","w") No newline at end of file
146 var_file = open("parameters.conf","w")
147 var_file.write(self.var_Dpath+"\n") #0 Ruta de los datos No newline at end of file
147 var_file.write(self.var_Dpath+"\n") #0 Ruta de los datos
148 var_file.write(self.var_Rpath+"\n") #1 Ruta del proyecto No newline at end of file
148 var_file.write(self.var_Rpath+"\n") #1 Ruta del proyecto
149 var_file.write(str(self.var_lstDtype)+"\n") #2 opcion Data Type No newline at end of file
149 var_file.write(str(self.var_lstDtype)+"\n") #2 opcion Data Type
150 var_file.write(self.var_Dtype+"\n") #3 extension Data Type No newline at end of file
150 var_file.write(self.var_Dtype+"\n") #3 extension Data Type
151 var_file.write(self.var_Elabel+"\n") #4 etiqueta No newline at end of file
151 var_file.write(self.var_Elabel+"\n") #4 etiqueta
152 var_file.write(str(self.var_Copys)+"\n") #5 Numero de copias No newline at end of file
152 var_file.write(str(self.var_Copys)+"\n") #5 Numero de copias
153 var_file.write(str(self.var_lstDcapacity)+"\n") #6 opcion Device Capacity No newline at end of file
153 var_file.write(str(self.var_lstDcapacity)+"\n") #6 opcion Device Capacity
154 var_file.write(str(self.var_Dcapacity)+"\n") #7 tamaΓ±o Device Capacity No newline at end of file
154 var_file.write(str(self.var_Dcapacity)+"\n") #7 tamaΓ±o Device Capacity
155 var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar No newline at end of file
155 var_file.write(str(self.var_Discs)+"\n") #8 Numero de discos a grabar
156 # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial No newline at end of file
156 # var_file.write(str(self.lstStartDay.currentIndex())+"\n") #9 Indice fecha inicial
157 # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final No newline at end of file
157 # var_file.write(str(self.lstStopDay.currentIndex())+"\n") #10 Indice fecha final
158 var_file.close() No newline at end of file
158 var_file.close()
159 No newline at end of file
159
160 #----------------------------------------------------- carga parameters.conf --------------------------------------------------------------- No newline at end of file
160 #----------------------------------------------------- carga parameters.conf ---------------------------------------------------------------
161 No newline at end of file
161
162 def get_parameters_conf(self): No newline at end of file
162 def get_parameters_conf(self):
163 var_file = open("parameters.conf","r") No newline at end of file
163 var_file = open("parameters.conf","r")
164 lines = var_file.readlines() No newline at end of file
164 lines = var_file.readlines()
165 self.txtDpath.setText(lines[0][:-1]) #0 No newline at end of file
165 self.txtDpath.setText(lines[0][:-1]) #0
166 self.txtRpath.setText(lines[1][:-1]) #1 No newline at end of file
166 self.txtRpath.setText(lines[1][:-1]) #1
167 self.lstDtype.setCurrentIndex(int(lines[2])) #2 No newline at end of file
167 self.lstDtype.setCurrentIndex(int(lines[2])) #2
168 self.txtDtype.setText(lines[3][:-1]) #3 No newline at end of file
168 self.txtDtype.setText(lines[3][:-1]) #3
169 self.txtElabel.setText(lines[4][:-1]) #4 No newline at end of file
169 self.txtElabel.setText(lines[4][:-1]) #4
170 self.txtCopys.setValue(int(lines[5][:-1])) #5 No newline at end of file
170 self.txtCopys.setValue(int(lines[5][:-1])) #5
171 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6 No newline at end of file
171 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6
172 self.txtDcapacity.setValue(float(lines[7])) #7 No newline at end of file
172 self.txtDcapacity.setValue(float(lines[7])) #7
173 self.var_Discs = int(lines[8]) #8 No newline at end of file
173 self.var_Discs = int(lines[8]) #8
174 # var_StartDay = int(lines[6]) #9 No newline at end of file
174 # var_StartDay = int(lines[6]) #9
175 # var_StopDay = int(lines[7]) #10 No newline at end of file
175 # var_StopDay = int(lines[7]) #10
176 ################################ No newline at end of file
176 ################################
177 self.var_Copys = self.txtCopys.value() #5 No newline at end of file
177 self.var_Copys = self.txtCopys.value() #5
178 ################################ No newline at end of file
178 ################################
179 No newline at end of file
179
180 var_file.close() No newline at end of file
180 var_file.close()
181 No newline at end of file
181
182 No newline at end of file
182
183 #-------------------------- actualiza el valor de las variables con los parametros seleccionados ----------------------------- No newline at end of file
183 #-------------------------- actualiza el valor de las variables con los parametros seleccionados -----------------------------
184 No newline at end of file
184
185 def set_vars(self): No newline at end of file
185 def set_vars(self):
186 self.var_Dpath = str(self.txtDpath.text()) #0 No newline at end of file
186 self.var_Dpath = str(self.txtDpath.text()) #0
187 self.var_Rpath = str(self.txtRpath.text()) #1 No newline at end of file
187 self.var_Rpath = str(self.txtRpath.text()) #1
188 self.var_lstDtype = self.lstDtype.currentIndex() #2 No newline at end of file
188 self.var_lstDtype = self.lstDtype.currentIndex() #2
189 self.var_Dtype = str(self.txtDtype.text()) #3 No newline at end of file
189 self.var_Dtype = str(self.txtDtype.text()) #3
190 self.var_Elabel = str(self.txtElabel.text()) #4 No newline at end of file
190 self.var_Elabel = str(self.txtElabel.text()) #4
191 self.var_Copys = self.txtCopys.value() #5 No newline at end of file
191 self.var_Copys = self.txtCopys.value() #5
192 self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6 No newline at end of file
192 self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6
193 self.var_Dcapacity = self.txtDcapacity.value() #7 No newline at end of file
193 self.var_Dcapacity = self.txtDcapacity.value() #7
194 self.var_Discs = self.var_Discs #8 No newline at end of file
194 self.var_Discs = self.var_Discs #8
195 No newline at end of file
195
196 No newline at end of file
196
197 #-------------------------- crea burning.conf ----------------------------- No newline at end of file
197 #-------------------------- crea burning.conf -----------------------------
198 No newline at end of file
198
199 def make_burning_conf(self): No newline at end of file
199 def make_burning_conf(self):
200 var_file = open("burning.conf","w") No newline at end of file
200 var_file = open("burning.conf","w")
201 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n - 1 ) No newline at end of file
201 var_n_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n - 1 )
202 var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados No newline at end of file
202 var_file.write(str(var_n_burned_discs)+"\n") #0 Numero de discos ya grabados
203 var_file.write(str(self.var_disc_n)+"\n") #1 Disco actual para grabar No newline at end of file
203 var_file.write(str(self.var_disc_n)+"\n") #1 Disco actual para grabar
204 var_file.write(str(self.var_copy_n)+"\n") #2 Numero de copia actual para grabar No newline at end of file
204 var_file.write(str(self.var_copy_n)+"\n") #2 Numero de copia actual para grabar
205 var_file.close() No newline at end of file
205 var_file.close()
206 No newline at end of file
206
207 #----------------------------------------------------- carga burning.conf --------------------------------------------------------------- No newline at end of file
207 #----------------------------------------------------- carga burning.conf ---------------------------------------------------------------
208 No newline at end of file
208
209 def get_burning_conf(self): No newline at end of file
209 def get_burning_conf(self):
210 var_file = open("burning.conf","r") No newline at end of file
210 var_file = open("burning.conf","r")
211 lines = var_file.readlines() No newline at end of file
211 lines = var_file.readlines()
212 self.var_burned_discs = int(lines[0]) #0 No newline at end of file
212 self.var_burned_discs = int(lines[0]) #0
213 self.var_disc_n = int(lines[1]) No newline at end of file
213 self.var_disc_n = int(lines[1])
214 self.var_copy_n = int(lines[2]) No newline at end of file
214 self.var_copy_n = int(lines[2])
215 var_file.close() No newline at end of file
215 var_file.close()
216 No newline at end of file
216
217 #---------------------------------------------- Habilitacion y deshabilitacion de items ------------------------------------------------------- No newline at end of file
217 #---------------------------------------------- Habilitacion y deshabilitacion de items -------------------------------------------------------
218 No newline at end of file
218
219 def enabled_items1(var_bool, self): No newline at end of file
219 def enabled_items1(var_bool, self):
220 self.tabParameters.setEnabled(not(var_bool)) No newline at end of file
220 self.tabParameters.setEnabled(not(var_bool))
221 self.lstDcapacity.setEnabled(not(var_bool)) No newline at end of file
221 self.lstDcapacity.setEnabled(not(var_bool))
222 self.txtDcapacity.setEnabled(not(var_bool)) No newline at end of file
222 self.txtDcapacity.setEnabled(not(var_bool))
223 self.actionChange_Parameters.setEnabled(var_bool) No newline at end of file
223 self.actionChange_Parameters.setEnabled(var_bool)
224 self.btnGbkp.setEnabled(not(var_bool)) No newline at end of file
224 self.btnGbkp.setEnabled(not(var_bool))
225 self.btnRestart.setEnabled(var_bool) No newline at end of file
225 self.btnRestart.setEnabled(var_bool)
226 self.btnStartburn.setEnabled(var_bool) No newline at end of file
226 self.btnStartburn.setEnabled(var_bool)
227 No newline at end of file
227
228 No newline at end of file
228
229 def enabled_items2(var_bool, self): No newline at end of file
229 def enabled_items2(var_bool, self):
230 self.btnRestart.setEnabled(not(var_bool)) No newline at end of file
230 self.btnRestart.setEnabled(not(var_bool))
231 self.btnStartburn.setEnabled(not(var_bool)) No newline at end of file
231 self.btnStartburn.setEnabled(not(var_bool))
232 self.btnStopburn.setEnabled(var_bool) No newline at end of file
232 self.btnStopburn.setEnabled(var_bool)
233 self.chkCheck.setEnabled(not(var_bool)) No newline at end of file
233 self.chkCheck.setEnabled(not(var_bool))
234 self.chkCheck.setChecked(False) No newline at end of file
234 self.chkCheck.setChecked(False)
235 No newline at end of file
235
236 self.actionChange_Parameters.setEnabled(False) No newline at end of file
236 self.actionChange_Parameters.setEnabled(False)
237 No newline at end of file
237
238
238
No newline at end of file
239 def enabled_items3(var_bool, self):
No newline at end of file
240 self.btnRestart.setEnabled(not(var_bool))
No newline at end of file
241 self.btnStartburn.setEnabled(not(var_bool))
No newline at end of file
242 self.btnStopburn.setEnabled(var_bool)
No newline at end of file
243 self.chkCheck.setEnabled(not(var_bool))
No newline at end of file
244 self.chkCheck.setChecked(False)
No newline at end of file
245
No newline at end of file
246
No newline at end of file
247 self.actionChange_Parameters.setEnabled(False)
No newline at end of file
248
No newline at end of file
249 self.actionChange_Parameters.setEnabled(False)
No newline at end of file
250
No newline at end of file
251 self.actionChange_Parameters.setEnabled(False)
No newline at end of file
252
No newline at end of file
253 No newline at end of file
254 #---------------------------------------------- Actualiza estado en los labels ------------------------------------------------------- No newline at end of file
239 #---------------------------------------------- Actualiza estado en los labels -------------------------------------------------------
255 No newline at end of file
240
256 def update_message(type, message, self, index=-1): No newline at end of file
241 def update_message(type, message, self, index=-1):
257 if index == -1: No newline at end of file
242 if index == -1:
258 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
243 var_index = ( ( (self.var_disc_n - 1) * self.var_Copys) + (self.var_copy_n - 1) - self.var_burned_discs ) % len(self.var_devices)
259 else: No newline at end of file
244 else:
260 var_index = index No newline at end of file
245 var_index = index
261 No newline at end of file
246
262 var_message = message No newline at end of file
247 var_message = message
263 # var_message = "BURNING" No newline at end of file
248 # var_message = "BURNING"
264 # var_message = "COMPLETED" No newline at end of file
249 # var_message = "COMPLETED"
265 # var_message = "ERROR" No newline at end of file
250 # var_message = "ERROR"
266 # var_message = "CHECKING" No newline at end of file
251 # var_message = "CHECKING"
267 # var_message = "CHECKED" No newline at end of file
252 # var_message = "CHECKED"
268 No newline at end of file
253
269 if type == 1: No newline at end of file
254 if type == 1:
270 No newline at end of file
255
271 if var_index == 0: No newline at end of file
256 if var_index == 0:
272 self.txtBstatusA.setText(var_message) No newline at end of file
257 self.txtBstatusA.setText(var_message)
273 self.txtBdiscA.setText(str(self.var_disc_n)) No newline at end of file
258 self.txtBdiscA.setText(str(self.var_disc_n))
274 self.txtBcopyA.setText(str(self.var_copy_n)) No newline at end of file
259 self.txtBcopyA.setText(str(self.var_copy_n))
275 No newline at end of file
260
276 if var_index == 1: No newline at end of file
261 if var_index == 1:
277 self.txtBstatusB.setText(var_message) No newline at end of file
262 self.txtBstatusB.setText(var_message)
278 self.txtBdiscB.setText(str(self.var_disc_n)) No newline at end of file
263 self.txtBdiscB.setText(str(self.var_disc_n))
279 self.txtBcopyB.setText(str(self.var_copy_n)) No newline at end of file
264 self.txtBcopyB.setText(str(self.var_copy_n))
280 No newline at end of file
265
281 if var_index == 2: No newline at end of file
266 if var_index == 2:
282 self.txtBstatusC.setText(var_message) No newline at end of file
267 self.txtBstatusC.setText(var_message)
283 self.txtBdiscC.setText(str(self.var_disc_n)) No newline at end of file
268 self.txtBdiscC.setText(str(self.var_disc_n))
284 self.txtBcopyC.setText(str(self.var_copy_n)) No newline at end of file
269 self.txtBcopyC.setText(str(self.var_copy_n))
285 No newline at end of file
270
286 if var_index == 3: No newline at end of file
271 if var_index == 3:
287 self.txtBstatusD.setText(var_message) No newline at end of file
272 self.txtBstatusD.setText(var_message)
288 self.txtBdiscD.setText(str(self.var_disc_n)) No newline at end of file
273 self.txtBdiscD.setText(str(self.var_disc_n))
289 self.txtBcopyD.setText(str(self.var_copy_n)) No newline at end of file
274 self.txtBcopyD.setText(str(self.var_copy_n))
290 No newline at end of file
275
291 if type == 2: No newline at end of file
276 if type == 2:
292 No newline at end of file
277
293 if var_index == 0: No newline at end of file
278 if var_index == 0:
294 self.txtCHstatusA.setText(var_message) No newline at end of file
279 self.txtCHstatusA.setText(var_message)
295 No newline at end of file
280
296 if var_index == 1: No newline at end of file
281 if var_index == 1:
297 self.txtCHstatusB.setText(var_message) No newline at end of file
282 self.txtCHstatusB.setText(var_message)
298 No newline at end of file
283
299 if var_index == 2: No newline at end of file
284 if var_index == 2:
300 self.txtCHstatusC.setText(var_message) No newline at end of file
285 self.txtCHstatusC.setText(var_message)
301 No newline at end of file
286
302 if var_index == 3: No newline at end of file
287 if var_index == 3:
303 self.txtCHstatusD.setText(var_message) No newline at end of file
288 self.txtCHstatusD.setText(var_message)
304 No newline at end of file
289
305 No newline at end of file
290
@@ -1,758 +1,772
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 time No newline at end of file
18 import time
19 import commands No newline at end of file
19 import commands
20 from functions import functions No newline at end of file
20 from functions import functions
21 from functions import functions2 No newline at end of file
21 from functions import functions2
22 No newline at end of file
22
23 class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file
23 class MainWindow(QMainWindow, Ui_MainWindow):
24 """ No newline at end of file
24 """
25 Class documentation goes here. No newline at end of file
25 Class documentation goes here.
26 """ No newline at end of file
26 """
27 No newline at end of file
27
28 def __init__(self, parent = None): No newline at end of file
28 def __init__(self, parent = None):
29 QMainWindow.__init__(self, parent) No newline at end of file
29 QMainWindow.__init__(self, parent)
30 self.setupUi(self) No newline at end of file
30 self.setupUi(self)
31 self.setupUi2() No newline at end of file
31 self.setupUi2()
32 No newline at end of file
32
33 def setupUi2(self): No newline at end of file
33 def setupUi2(self):
34 No newline at end of file
34
35 self.txtInfo.append("cambio 1") No newline at end of file
35 self.txtInfo.append("cambio 1")
36 No newline at end of file
36
37 self.allTrue = False No newline at end of file
37 self.allTrue = False
38 No newline at end of file
38
39 if self.allTrue == True: No newline at end of file
39 if self.allTrue == True:
40 self.var_real_principal = True No newline at end of file
40 self.var_real_principal = True
41 self.var_real_detect_devices = True No newline at end of file
41 self.var_real_detect_devices = True
42 self.var_real_iso = True No newline at end of file
42 self.var_real_iso = True
43 self.var_real_burn = True No newline at end of file
43 self.var_real_burn = True
44 self.var_real_check = True No newline at end of file
44 self.var_real_check = True
45 self.var_real_eject = True No newline at end of file
45 self.var_real_eject = True
46 self.var_real_manual_check = True No newline at end of file
46 self.var_real_manual_check = True
47 self.var_real_show_cmd = True No newline at end of file
47 self.var_real_show_cmd = True
48 No newline at end of file
48
49 else: No newline at end of file
49 else:
50 self.var_real_principal = False No newline at end of file
50 self.var_real_principal = False
51 self.var_real_detect_devices = False No newline at end of file
51 self.var_real_detect_devices = False
52 self.var_real_iso = False No newline at end of file
52 self.var_real_iso = False
53 self.var_real_burn = False No newline at end of file
53 self.var_real_burn = False
54 self.var_real_check = False No newline at end of file
54 self.var_real_check = False
55 self.var_real_eject = False
55 self.var_real_eject = False
No newline at end of file
56 self.var_real_manual_check = True No newline at end of file
56 self.var_real_manual_check = False No newline at end of file
57 self.var_real_show_cmd = True No newline at end of file
57 self.var_real_show_cmd = True
58 No newline at end of file
58
59 if self.var_real_detect_devices == True: No newline at end of file
59 if self.var_real_detect_devices == True:
60 # Reconocimiento de los dispositivos de grabacion No newline at end of file
60 # Reconocimiento de los dispositivos de grabacion
61 functions2.detect_devices(self) No newline at end of file
61 functions2.detect_devices(self)
62 else: No newline at end of file
62 else:
63 functions2.set_devices_test(self) No newline at end of file
63 functions2.set_devices_test(self)
64 No newline at end of file
64
65 #Inicialiazacion de variables No newline at end of file
65 #Inicialiazacion de variables
66 self.var_Discs = 0 #Numero de discos del proyecto No newline at end of file
66 self.var_Discs = 0 #Numero de discos del proyecto
67 self.var_Copys = 0 #Numero de copias No newline at end of file
67 self.var_Copys = 0 #Numero de copias
68 self.var_disc_n = 0 # disco actual No newline at end of file
68 self.var_disc_n = 0 # disco actual
69 self.var_copy_n = 0 # copia actual No newline at end of file
69 self.var_copy_n = 0 # copia actual
70 self.var_burned_discs = 0 #numero de discos ya grabados No newline at end of file
70 self.var_burned_discs = 0 #numero de discos ya grabados
71 No newline at end of file
71
72 self.bool_first_iso = False No newline at end of file
72 self.bool_first_iso = False
73 self.var_step = 0 # numero de paso en el proceso No newline at end of file
73 self.var_step = 0 # numero de paso en el proceso
74 self.bool_state_burning = False #si es True se puede grabar No newline at end of file
74 self.bool_state_burning = False #si es True se puede grabar
75 self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco No newline at end of file
75 self.blank_discs = False # Si es true significa que se acaban de ingresar discos en blanco
76 No newline at end of file
76
77 self.var_list=[] # Lista de DOYs No newline at end of file
77 self.var_list=[] # Lista de DOYs
78 self.var_sublist=[] # Sub-lista de DOYs seleccionados No newline at end of file
78 self.var_sublist=[] # Sub-lista de DOYs seleccionados
79 self.var_devices=[] #Lista de dispositivos seleccionados No newline at end of file
79 self.var_devices=[] #Lista de dispositivos seleccionados
80 No newline at end of file
80
81 #Revisa si existe el archivo de confirguracion y lo carga No newline at end of file
81 #Revisa si existe el archivo de confirguracion y lo carga
82 if os.path.isfile("parameters.conf"): No newline at end of file
82 if os.path.isfile("parameters.conf"):
83 functions2.get_parameters_conf(self) No newline at end of file
83 functions2.get_parameters_conf(self)
84 self.bool_first_iso = True No newline at end of file
84 self.bool_first_iso = True
85 self.txtInfo.append("Parameters were loaded from configuration file") No newline at end of file
85 self.txtInfo.append("Parameters were loaded from configuration file")
86 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
86 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
87 No newline at end of file
87
88 elif self.var_real_principal == False: No newline at end of file
88 elif self.var_real_principal == False:
89 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas No newline at end of file
89 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas
90 No newline at end of file
90
91 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados No newline at end of file
91 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
92 No newline at end of file
92
93 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
93 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
94 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
94 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
95 functions.load_days(self) No newline at end of file
95 functions.load_days(self)
96 No newline at end of file
96
97 if os.path.isfile("parameters.conf"): No newline at end of file
97 if os.path.isfile("parameters.conf"):
98 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion No newline at end of file
98 functions2.enabled_items1(True, self) #Se bloquean los parametros de configuracion
99 No newline at end of file
99
100 if os.path.isfile("burning.conf"): No newline at end of file
100 if os.path.isfile("burning.conf"):
101 functions2.get_burning_conf(self) No newline at end of file
101 functions2.get_burning_conf(self)
102 self.txtInfo.append("Current disc: "+str(self.var_disc_n)) No newline at end of file
102 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
103 self.txtInfo.append("Current copy: "+str(self.var_copy_n)) No newline at end of file
103 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
104 self.txtInfo.append("Burned discs: "+str(self.var_burned_discs)) No newline at end of file
104 self.txtInfo.append("Burned discs: "+str(self.var_burned_discs))
105 self.btnStartburn.setText("Continue") No newline at end of file
105 self.btnStartburn.setText("Continue")
106 self.actionChange_Parameters.setEnabled(False) No newline at end of file
106 self.actionChange_Parameters.setEnabled(False)
107 No newline at end of file
107
108 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters) No newline at end of file
108 self.connect(self.actionChange_Parameters, QtCore.SIGNAL("triggered()"), self.changeParameters)
109 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about) No newline at end of file
109 self.connect(self.actionAbout, QtCore.SIGNAL("triggered()"), self.about)
110 No newline at end of file
110
111 self.process_iso = QtCore.QProcess() No newline at end of file
111 self.process_iso = QtCore.QProcess()
112 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_iso) No newline at end of file
112 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_iso)
113 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardError()'), self.readError_iso) No newline at end of file
113 self.connect(self.process_iso, QtCore.SIGNAL('readyReadStandardError()'), self.readError_iso)
114 self.connect(self.process_iso, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_iso) No newline at end of file
114 self.connect(self.process_iso, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_iso)
115 No newline at end of file
115
116 self.process_burn = QtCore.QProcess() No newline at end of file
116 self.process_burn = QtCore.QProcess()
117 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_burn) No newline at end of file
117 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_burn)
118 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardError()'), self.readError_burn) No newline at end of file
118 self.connect(self.process_burn, QtCore.SIGNAL('readyReadStandardError()'), self.readError_burn)
119 self.connect(self.process_burn, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_burn) No newline at end of file
119 self.connect(self.process_burn, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_burn)
120 No newline at end of file
120
121 self.process_check = QtCore.QProcess() No newline at end of file
121 self.process_check = QtCore.QProcess()
122 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check) No newline at end of file
122 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_check)
123 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check) No newline at end of file
123 self.connect(self.process_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_check)
124 self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check) No newline at end of file
124 self.connect(self.process_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_check)
125 No newline at end of file
125
126 self.process_manual_check = QtCore.QProcess() No newline at end of file
126 self.process_manual_check = QtCore.QProcess()
127 self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_manual_check) No newline at end of file
127 self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput_manual_check)
128 self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_manual_check) No newline at end of file
128 self.connect(self.process_manual_check, QtCore.SIGNAL('readyReadStandardError()'), self.readError_manual_check)
129 self.connect(self.process_manual_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_manual_check) No newline at end of file
129 self.connect(self.process_manual_check, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished_manual_check)
130 No newline at end of file
130
131 def changeParameters(self): No newline at end of file
131 def changeParameters(self):
132 dlg=QtGui.QDialog() No newline at end of file
132 dlg=QtGui.QDialog()
133 dlgui=Ui_Parameters() No newline at end of file
133 dlgui=Ui_Parameters()
134 dlgui.setupUi(dlg) No newline at end of file
134 dlgui.setupUi(dlg)
135 if (dlg.exec_() == QtGui.QDialog.Accepted): No newline at end of file
135 if (dlg.exec_() == QtGui.QDialog.Accepted):
136 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value(): No newline at end of file
136 if dlgui.txtDisc.value() > self.var_Discs or dlgui.txtCopy.value() > dlgui.txtNcopys.value():
137 self.txtInfo.append("Wrong parameters") No newline at end of file
137 self.txtInfo.append("Wrong parameters")
138 else: No newline at end of file
138 else:
139 self.var_Copys = dlgui.txtNcopys.value() No newline at end of file
139 self.var_Copys = dlgui.txtNcopys.value()
140 self.var_disc_n = dlgui.txtDisc.value() No newline at end of file
140 self.var_disc_n = dlgui.txtDisc.value()
141 self.var_copy_n = dlgui.txtCopy.value() No newline at end of file
141 self.var_copy_n = dlgui.txtCopy.value()
142 self.txtInfo.append("Changed parameters") No newline at end of file
142 self.txtInfo.append("Changed parameters")
143 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 ) No newline at end of file
143 self.var_burned_discs = ( ( (self.var_disc_n - 1) * self.var_Copys) + self.var_copy_n -1 )
144 self.bool_first_iso = True No newline at end of file
144 self.bool_first_iso = True
145 self.txtInfo.append("Current disc: "+str(self.var_disc_n)) No newline at end of file
145 self.txtInfo.append("Current disc: "+str(self.var_disc_n))
146 self.txtInfo.append("Current copy: "+str(self.var_copy_n)) No newline at end of file
146 self.txtInfo.append("Current copy: "+str(self.var_copy_n))
147 self.txtInfo.append("Nro Copys: "+str(self.var_Copys)) No newline at end of file
147 self.txtInfo.append("Nro Copys: "+str(self.var_Copys))
148 functions2.make_parameters_conf(self) No newline at end of file
148 functions2.make_parameters_conf(self)
149 self.txtCopys.setValue(self.var_Copys) #Actualizo mananualmente el valor Copys No newline at end of file
149 self.txtCopys.setValue(self.var_Copys) #Actualizo mananualmente el valor Copys
150 No newline at end of file
150
151 No newline at end of file
151
152 No newline at end of file
152
153 def about(self): No newline at end of file
153 def about(self):
154 dlg_about=QtGui.QDialog() No newline at end of file
154 dlg_about=QtGui.QDialog()
155 dlgui_about=Ui_About() No newline at end of file
155 dlgui_about=Ui_About()
156 dlgui_about.setupUi(dlg_about) No newline at end of file
156 dlgui_about.setupUi(dlg_about)
157 dlg_about.exec_() No newline at end of file
157 dlg_about.exec_()
158 No newline at end of file
158
159 No newline at end of file
159
160 #============================================================================== No newline at end of file
160 #==============================================================================
161 # Manejo de los eventos No newline at end of file
161 # Manejo de los eventos
162 #============================================================================== No newline at end of file
162 #==============================================================================
163 No newline at end of file
163
164 #----------------------------------------------------- Obtencion de la ruta de los datos --------------------------------------------------------------- No newline at end of file
164 #----------------------------------------------------- Obtencion de la ruta de los datos ---------------------------------------------------------------
165 No newline at end of file
165
166 @pyqtSignature("") No newline at end of file
166 @pyqtSignature("")
167 def on_btnDpath_clicked(self): No newline at end of file
167 def on_btnDpath_clicked(self):
168 """ No newline at end of file
168 """
169 Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file
169 Permite seleccionar graficamente el direcorio de los datos a grabar
170 """ No newline at end of file
170 """
171 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
171 self.var_Dpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
172 self.txtDpath.setText(self.var_Dpath) No newline at end of file
172 self.txtDpath.setText(self.var_Dpath)
173 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
173 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
174 functions.load_days(self) No newline at end of file
174 functions.load_days(self)
175 No newline at end of file
175
176 No newline at end of file
176
177 @pyqtSignature("") No newline at end of file
177 @pyqtSignature("")
178 def on_txtDpath_editingFinished(self): No newline at end of file
178 def on_txtDpath_editingFinished(self):
179 """ No newline at end of file
179 """
180 Carga la ruta editada y verifica que sea correcta y carga la lista de dias No newline at end of file
180 Carga la ruta editada y verifica que sea correcta y carga la lista de dias
181 """ No newline at end of file
181 """
182 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
182 self.var_Dpath=str(self.txtDpath.text()) #Se carga la variable con la ruta recien editada
183 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
183 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
184 functions.load_days(self) No newline at end of file
184 functions.load_days(self)
185 No newline at end of file
185
186 No newline at end of file
186
187 #----------------------------------------------------- Obtencion de las ruta del proyecto --------------------------------------------------------------- No newline at end of file
187 #----------------------------------------------------- Obtencion de las ruta del proyecto ---------------------------------------------------------------
188 No newline at end of file
188
189 @pyqtSignature("") No newline at end of file
189 @pyqtSignature("")
190 def on_btnRpath_clicked(self): No newline at end of file
190 def on_btnRpath_clicked(self):
191 """ No newline at end of file
191 """
192 Permite seleccionar graficamente el direcorio del proyecto No newline at end of file
192 Permite seleccionar graficamente el direcorio del proyecto
193 """ No newline at end of file
193 """
194 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
194 self.var_Rpath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
195 self.txtRpath.setText(self.var_Rpath) No newline at end of file
195 self.txtRpath.setText(self.var_Rpath)
196 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
196 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
197 No newline at end of file
197
198 No newline at end of file
198
199 @pyqtSignature("") No newline at end of file
199 @pyqtSignature("")
200 def on_txtRpath_editingFinished(self): No newline at end of file
200 def on_txtRpath_editingFinished(self):
201 """ No newline at end of file
201 """
202 Valida la ruta del proyecto No newline at end of file
202 Valida la ruta del proyecto
203 """ No newline at end of file
203 """
204 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada No newline at end of file
204 self.var_Rpath = str(self.txtRpath.text()) #Se carga la variable con la ruta recien editada
205 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
205 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
206 No newline at end of file
206
207 No newline at end of file
207
208 #----------------------------------------------------- Tipo de datos --------------------------------------------------------------- No newline at end of file
208 #----------------------------------------------------- Tipo de datos ---------------------------------------------------------------
209 No newline at end of file
209
210 @pyqtSignature("int") No newline at end of file
210 @pyqtSignature("int")
211 def on_lstDtype_activated(self, index): No newline at end of file
211 def on_lstDtype_activated(self, index):
212 """ No newline at end of file
212 """
213 Permite elegir entre los tipos de archivos No newline at end of file
213 Permite elegir entre los tipos de archivos
214 """ No newline at end of file
214 """
215 self.txtDtype.setReadOnly(True) No newline at end of file
215 self.txtDtype.setReadOnly(True)
216 if index == 0: No newline at end of file
216 if index == 0:
217 self.var_Dtype ='r' No newline at end of file
217 self.var_Dtype ='r'
218 elif index == 1: No newline at end of file
218 elif index == 1:
219 self.var_Dtype ='pdata' No newline at end of file
219 self.var_Dtype ='pdata'
220 elif index == 2: No newline at end of file
220 elif index == 2:
221 self.var_Dtype ='sswma' No newline at end of file
221 self.var_Dtype ='sswma'
222 else : No newline at end of file
222 else :
223 self.var_Dtype ='' No newline at end of file
223 self.var_Dtype =''
224 self.txtDtype.setReadOnly(False) No newline at end of file
224 self.txtDtype.setReadOnly(False)
225 No newline at end of file
225
226 self.txtDtype.setText(self.var_Dtype) No newline at end of file
226 self.txtDtype.setText(self.var_Dtype)
227 functions.load_days(self) #llamada a funcion No newline at end of file
227 functions.load_days(self) #llamada a funcion
228 No newline at end of file
228
229 @pyqtSignature("") No newline at end of file
229 @pyqtSignature("")
230 def on_txtDtype_editingFinished(self): No newline at end of file
230 def on_txtDtype_editingFinished(self):
231 self.var_Dtype=str(self.txtDtype.text()) No newline at end of file
231 self.var_Dtype=str(self.txtDtype.text())
232 functions.load_days(self) #llamada a funcion No newline at end of file
232 functions.load_days(self) #llamada a funcion
233 No newline at end of file
233
234 No newline at end of file
234
235 #----------------------------------------------------- Etiqueta --------------------------------------------------------------- No newline at end of file
235 #----------------------------------------------------- Etiqueta ---------------------------------------------------------------
236 No newline at end of file
236
237 @pyqtSignature("") No newline at end of file
237 @pyqtSignature("")
238 def on_txtElabel_editingFinished(self): No newline at end of file
238 def on_txtElabel_editingFinished(self):
239 self.var_Elabel = str(self.txtElabel.text()) No newline at end of file
239 self.var_Elabel = str(self.txtElabel.text())
240 No newline at end of file
240
241 #----------------------------------------------------- Numero de copias --------------------------------------------------------------- No newline at end of file
241 #----------------------------------------------------- Numero de copias ---------------------------------------------------------------
242 @pyqtSignature("") No newline at end of file
242 @pyqtSignature("")
243 def on_txtCopys_editingFinished(self): No newline at end of file
243 def on_txtCopys_editingFinished(self):
244 self.var_Copys = self.txtCopys.value() No newline at end of file
244 self.var_Copys = self.txtCopys.value()
245 No newline at end of file
245
246 #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- No newline at end of file
246 #----------------------------------------------------- Seleccion del rango de fechas ---------------------------------------------------------------
247 No newline at end of file
247
248 @pyqtSignature("int") #CLOSED No newline at end of file
248 @pyqtSignature("int") #CLOSED
249 def on_lstStartDay_activated(self, index): No newline at end of file
249 def on_lstStartDay_activated(self, index):
250 """ No newline at end of file
250 """
251 Cambia la lista de opciones en lstStopDay No newline at end of file
251 Cambia la lista de opciones en lstStopDay
252 """ No newline at end of file
252 """
253 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file
253 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
254 self.lstStopDay.clear() No newline at end of file
254 self.lstStopDay.clear()
255 No newline at end of file
255
256 for i in self.var_list[index:]: No newline at end of file
256 for i in self.var_list[index:]:
257 self.lstStopDay.addItem(i) No newline at end of file
257 self.lstStopDay.addItem(i)
258 No newline at end of file
258
259 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file
259 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
260 No newline at end of file
260
261 functions.get_sub_list(self) No newline at end of file
261 functions.get_sub_list(self)
262 No newline at end of file
262
263 No newline at end of file
263
264 @pyqtSignature("int") #CLOSED No newline at end of file
264 @pyqtSignature("int") #CLOSED
265 def on_lstStopDay_activated(self, index): No newline at end of file
265 def on_lstStopDay_activated(self, index):
266 """ No newline at end of file
266 """
267 Cambia la lista de opciones en lstStartDay No newline at end of file
267 Cambia la lista de opciones en lstStartDay
268 """ No newline at end of file
268 """
269 var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file
269 var_StartDay_index=self.lstStartDay.currentIndex()
270 var_end_index = self.lstStopDay.count() - index No newline at end of file
270 var_end_index = self.lstStopDay.count() - index
271 self.lstStartDay.clear() No newline at end of file
271 self.lstStartDay.clear()
272 No newline at end of file
272
273 for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file
273 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
274 self.lstStartDay.addItem(i) No newline at end of file
274 self.lstStartDay.addItem(i)
275 No newline at end of file
275
276 self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file
276 self.lstStartDay.setCurrentIndex(var_StartDay_index)
277 No newline at end of file
277
278 functions.get_sub_list(self) No newline at end of file
278 functions.get_sub_list(self)
279 No newline at end of file
279
280 No newline at end of file
280
281 #----------------------------------------------------- Capacidad del dispositivo de grabacion --------------------------------------------------------------- No newline at end of file
281 #----------------------------------------------------- Capacidad del dispositivo de grabacion ---------------------------------------------------------------
282 No newline at end of file
282
283 @pyqtSignature("") No newline at end of file
283 @pyqtSignature("")
284 def on_txtDcapacity_editingFinished(self): No newline at end of file
284 def on_txtDcapacity_editingFinished(self):
285 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
285 self.var_Dcapacity = self.txtDcapacity.value()
286 No newline at end of file
286
287 No newline at end of file
287
288 @pyqtSignature("int") #CLOSED No newline at end of file
288 @pyqtSignature("int") #CLOSED
289 def on_lstDcapacity_activated(self, index): No newline at end of file
289 def on_lstDcapacity_activated(self, index):
290 """ No newline at end of file
290 """
291 Permite elegir el tamaΓ±o del disco No newline at end of file
291 Permite elegir el tamaΓ±o del disco
292 """ No newline at end of file
292 """
293 if index == 0: No newline at end of file
293 if index == 0:
294 var_size=25.0 No newline at end of file
294 var_size=25.0
295 elif index == 1: No newline at end of file
295 elif index == 1:
296 var_size=8.5 No newline at end of file
296 var_size=8.5
297 elif index == 2: No newline at end of file
297 elif index == 2:
298 var_size=4.7 No newline at end of file
298 var_size=4.7
299 elif index == 3: No newline at end of file
299 elif index == 3:
300 var_size=0.7 No newline at end of file
300 var_size=0.7
301 No newline at end of file
301
302 if index != 4: No newline at end of file
302 if index != 4:
303 self.txtDcapacity.setValue(var_size*10**9/1024**2) No newline at end of file
303 self.txtDcapacity.setValue(var_size*10**9/1024**2)
304 self.txtDcapacity.setReadOnly(True) No newline at end of file
304 self.txtDcapacity.setReadOnly(True)
305 else: No newline at end of file
305 else:
306 self.txtDcapacity.setValue(100.0) No newline at end of file
306 self.txtDcapacity.setValue(100.0)
307 self.txtDcapacity.setReadOnly(False) No newline at end of file
307 self.txtDcapacity.setReadOnly(False)
308 No newline at end of file
308
309 self.var_lstDcapacity = self.lstDcapacity.currentIndex() No newline at end of file
309 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
310 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
310 self.var_Dcapacity = self.txtDcapacity.value()
311 No newline at end of file
311
312 #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- No newline at end of file
312 #----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
313 No newline at end of file
313
314 @pyqtSignature("") No newline at end of file
314 @pyqtSignature("")
315 def on_btnTdevA_clicked(self): No newline at end of file
315 def on_btnTdevA_clicked(self):
316 var_dev = str(self.txtDeviceA.text()) No newline at end of file
316 var_dev = str(self.txtDeviceA.text())
317 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
317 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
318 commands.getstatusoutput(var_cmd) No newline at end of file
318 commands.getstatusoutput(var_cmd)
319 No newline at end of file
319
320 @pyqtSignature("") No newline at end of file
320 @pyqtSignature("")
321 def on_btnTdevB_clicked(self): No newline at end of file
321 def on_btnTdevB_clicked(self):
322 var_dev = str(self.txtDeviceB.text()) No newline at end of file
322 var_dev = str(self.txtDeviceB.text())
323 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
323 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
324 commands.getstatusoutput(var_cmd) No newline at end of file
324 commands.getstatusoutput(var_cmd)
325 No newline at end of file
325
326 @pyqtSignature("") No newline at end of file
326 @pyqtSignature("")
327 def on_btnTdevC_clicked(self): No newline at end of file
327 def on_btnTdevC_clicked(self):
328 var_dev = str(self.txtDeviceC.text()) No newline at end of file
328 var_dev = str(self.txtDeviceC.text())
329 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
329 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
330 commands.getstatusoutput(var_cmd) No newline at end of file
330 commands.getstatusoutput(var_cmd)
331 No newline at end of file
331
332 @pyqtSignature("") No newline at end of file
332 @pyqtSignature("")
333 def on_btnTdevD_clicked(self): No newline at end of file
333 def on_btnTdevD_clicked(self):
334 var_dev = str(self.txtDeviceD.text()) No newline at end of file
334 var_dev = str(self.txtDeviceD.text())
335 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
335 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
336 commands.getstatusoutput(var_cmd) No newline at end of file
336 commands.getstatusoutput(var_cmd)
337 No newline at end of file
337
338 No newline at end of file
338
339 #============================================================================== No newline at end of file
339 #==============================================================================
340 # Botones para la generacion de los archivos de configuracion No newline at end of file
340 # Botones para la generacion de los archivos de configuracion
341 #============================================================================== No newline at end of file
341 #==============================================================================
342 No newline at end of file
342
343 #----------------------------------------------------- Generacion de la configuracion usando los parametros --------------------------------------------------------------- No newline at end of file
343 #----------------------------------------------------- Generacion de la configuracion usando los parametros ---------------------------------------------------------------
344 No newline at end of file
344
345 @pyqtSignature("") No newline at end of file
345 @pyqtSignature("")
346 def on_btnGbkp_clicked(self): No newline at end of file
346 def on_btnGbkp_clicked(self):
347 """ No newline at end of file
347 """
348 Generacion de archivos de configuracion usando los parametros No newline at end of file
348 Generacion de archivos de configuracion usando los parametros
349 """ No newline at end of file
349 """
350 No newline at end of file
350
351 if functions.validate_parameters(self) == False: No newline at end of file
351 if functions.validate_parameters(self) == False:
352 return No newline at end of file
352 return
353 No newline at end of file
353
354 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file
354 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
355 list_dirs=['gpath','iso','ppath', 'tmpdata'] No newline at end of file
355 list_dirs=['gpath','iso','ppath', 'tmpdata']
356 bool_make_dirs = functions.make_dirs(list_dirs, self) No newline at end of file
356 bool_make_dirs = functions.make_dirs(list_dirs, self)
357 if bool_make_dirs == False: No newline at end of file
357 if bool_make_dirs == False:
358 return No newline at end of file
358 return
359 No newline at end of file
359
360 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar No newline at end of file
360 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar
361 No newline at end of file
361
362 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat No newline at end of file
362 self.var_Discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat
363 No newline at end of file
363
364 functions.make_files_print(self) # Se crean los archivos .print No newline at end of file
364 functions.make_files_print(self) # Se crean los archivos .print
365 No newline at end of file
365
366 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf No newline at end of file
366 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf
367 No newline at end of file
367
368 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys)) No newline at end of file
368 self.txtInfo.append("Total number of discs for recording: "+str(self.var_Discs * self.var_Copys))
369 No newline at end of file
369
370 #Se bloquean los parametros de configuracion No newline at end of file
370 #Se bloquean los parametros de configuracion
371 functions2.enabled_items1(True, self) No newline at end of file
371 functions2.enabled_items1(True, self)
372 self.var_disc_n = 1 No newline at end of file
372 self.var_disc_n = 1
373 self.var_copy_n = 1 No newline at end of file
373 self.var_copy_n = 1
374 self.bool_first_iso = True No newline at end of file
374 self.bool_first_iso = True
375 self.var_burned_discs = 0 #numero de discos grabados No newline at end of file
375 self.var_burned_discs = 0 #numero de discos grabados
376 No newline at end of file
376
377 No newline at end of file
377
378 #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- No newline at end of file
378 #----------------------------------------------------- Permite reiniciar la configuracion ---------------------------------------------------------------
379 No newline at end of file
379
380 @pyqtSignature("") No newline at end of file
380 @pyqtSignature("")
381 def on_btnRestart_clicked(self): No newline at end of file
381 def on_btnRestart_clicked(self):
382 """ No newline at end of file
382 """
383 Permite que se puedan cambiar los parametros No newline at end of file
383 Permite que se puedan cambiar los parametros
384 """ No newline at end of file
384 """
385 if os.path.isfile("parameters.conf"): No newline at end of file
385 if os.path.isfile("parameters.conf"):
386 os.remove("parameters.conf") No newline at end of file
386 os.remove("parameters.conf")
387 if os.path.isfile("burning.conf"): No newline at end of file
387 if os.path.isfile("burning.conf"):
388 os.remove("burning.conf") No newline at end of file
388 os.remove("burning.conf")
389 No newline at end of file
389
390 functions2.enabled_items1(False, self) No newline at end of file
390 functions2.enabled_items1(False, self)
391 self.btnStartburn.setText("Start Burn") No newline at end of file
391 self.btnStartburn.setText("Start Burn")
392 self.txtInfo.clear() No newline at end of file
392 self.txtInfo.clear()
393 No newline at end of file
393
394 No newline at end of file
394
395 No newline at end of file
395
396 #============================================================================== No newline at end of file
396 #==============================================================================
397 # Acciones de los procesos No newline at end of file
397 # Acciones de los procesos
398 #============================================================================== No newline at end of file
398 #==============================================================================
399 No newline at end of file
399
400 #------------------------------------------------ Funciones del proceso de creacion del iso ------------------------------------------------------ No newline at end of file
400 #------------------------------------------------ Funciones del proceso de creacion del iso ------------------------------------------------------
401 No newline at end of file
401
402 def readOuput_iso(self): No newline at end of file
402 def readOuput_iso(self):
403 self.txtProgress.setText("stdout iso: " + QtCore.QString(self.process_iso.readAllStandardOutput())) No newline at end of file
403 self.txtProgress.setText("stdout iso: " + QtCore.QString(self.process_iso.readAllStandardOutput()))
404 No newline at end of file
404
405 def readError_iso(self): No newline at end of file
405 def readError_iso(self):
406 self.txtProgress.setText("stderr iso: " + QtCore.QString(self.process_iso.readAllStandardError())) No newline at end of file
406 self.txtProgress.setText("stderr iso: " + QtCore.QString(self.process_iso.readAllStandardError()))
407 No newline at end of file
407
408 def finished_iso(self): No newline at end of file
408 def finished_iso(self):
409 self.txtProgress.clear() No newline at end of file
409 self.txtProgress.clear()
410 No newline at end of file
410
411 if not(self.bool_state_burning): No newline at end of file
411 if not(self.bool_state_burning):
412 return No newline at end of file
412 return
413 No newline at end of file
413
414 if self.process_iso.exitCode() == 0: No newline at end of file
414 if self.process_iso.exitCode() == 0:
415 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully\n") No newline at end of file
415 self.txtInfo.append("------Iso file: "+functions.i2s(self.var_disc_n)+" created successfully\n")
416 self.var_step = 1 No newline at end of file
416 self.var_step = 1
417 self.function_burn() No newline at end of file
417 self.function_burn()
418 No newline at end of file
418
419 else: No newline at end of file
419 else:
420 self.txtInfo.append("#####Error creating iso file "+functions.i2s(self.var_disc_n) No newline at end of file
420 self.txtInfo.append("#####Error creating iso file "+functions.i2s(self.var_disc_n)
421 +" , code "+QtCore.QString(self.process_iso.exitCode())) No newline at end of file
421 +" , code "+QtCore.QString(self.process_iso.exitCode()))
422 self.txtInfo.append("Please check the data") No newline at end of file
422 self.txtInfo.append("Please check the data")
423 self.txtInfo.append("FATAL ERROR") No newline at end of file
423 self.txtInfo.append("FATAL ERROR")
424 No newline at end of file
424
425 #----------------------------------------------------- Funciones del proceso de grabado --------------------------------------------------------------- No newline at end of file
425 #----------------------------------------------------- Funciones del proceso de grabado ---------------------------------------------------------------
426 No newline at end of file
426
427 def readOuput_burn(self): No newline at end of file
427 def readOuput_burn(self):
428 self.txtProgress.setText("stdout burn: " + QtCore.QString(self.process_burn.readAllStandardOutput())) No newline at end of file
428 self.txtProgress.setText("stdout burn: " + QtCore.QString(self.process_burn.readAllStandardOutput()))
429 No newline at end of file
429
430 def readError_burn(self): No newline at end of file
430 def readError_burn(self):
431 self.txtProgress.setText("stderr burn: " + QtCore.QString(self.process_burn.readAllStandardError())) No newline at end of file
431 self.txtProgress.setText("stderr burn: " + QtCore.QString(self.process_burn.readAllStandardError()))
432 No newline at end of file
432
433 def finished_burn(self): No newline at end of file
433 def finished_burn(self):
434 self.txtProgress.clear() No newline at end of file
434 self.txtProgress.clear()
435 No newline at end of file
435
436 #Si se paro el proceso manualmente se termina No newline at end of file
436 #Si se paro el proceso manualmente se termina
437 if not(self.bool_state_burning): No newline at end of file
437 if not(self.bool_state_burning):
438 return No newline at end of file
438 return
439 No newline at end of file
439
440 if self.process_burn.exitCode() == 0: No newline at end of file
440 if self.process_burn.exitCode() == 0:
441 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n)) No newline at end of file
441 self.txtInfo.append("-----Complete recording, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
442 functions2.update_message(1, "COMPLETED", self) No newline at end of file
442 functions2.update_message(1, "COMPLETED", self)
443 self.var_step = 2 No newline at end of file
443 self.var_step = 2
444 self.function_check() No newline at end of file
444 self.function_check()
445 No newline at end of file
445
446 else: No newline at end of file
446 else:
447 self.txtInfo.append("#######Error recording, disc: "+functions.i2s(self.var_disc_n)+" copy: " No newline at end of file
447 self.txtInfo.append("#######Error recording, disc: "+functions.i2s(self.var_disc_n)+" copy: "
448 +functions.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode())) No newline at end of file
448 +functions.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_burn.exitCode()))
449 functions2.update_message(1, "ERROR", self) No newline at end of file
449 functions2.update_message(1, "ERROR", self)
450 No newline at end of file
450
451 functions.is_last_disc_and_copy(self) No newline at end of file
451 functions.is_last_disc_and_copy(self)
452 No newline at end of file
452
453 No newline at end of file
453
454 #----------------------------------------------------- Funciones del proceso de verificacion --------------------------------------------------------------- No newline at end of file
454 #----------------------------------------------------- Funciones del proceso de verificacion ---------------------------------------------------------------
455 No newline at end of file
455
456 def readOuput_check(self): No newline at end of file
456 def readOuput_check(self):
457 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_check.readAllStandardOutput())) No newline at end of file
457 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_check.readAllStandardOutput()))
458 No newline at end of file
458
459 def readError_check(self): No newline at end of file
459 def readError_check(self):
460 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_check.readAllStandardError())) No newline at end of file
460 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_check.readAllStandardError()))
461 No newline at end of file
461
462 def finished_check(self): No newline at end of file
462 def finished_check(self):
463 self.txtProgress.clear() No newline at end of file
463 self.txtProgress.clear()
464 No newline at end of file
464
465 if not(self.bool_state_burning): No newline at end of file
465 if not(self.bool_state_burning):
466 return No newline at end of file
466 return
467 No newline at end of file
467
468 if self.process_check.exitCode() == 0: No newline at end of file
468 if self.process_check.exitCode() == 0:
469 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n)) No newline at end of file
469 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_disc_n)+" copy: "+str(self.var_copy_n))
470 functions2.update_message(2, "CHECKED", self) No newline at end of file
470 functions2.update_message(2, "CHECKED", self)
471 No newline at end of file
471
472 else: No newline at end of file
472 else:
473 self.txtInfo.append("#######Error checking, disc: "+functions.i2s(self.var_disc_n)+" copy: " No newline at end of file
473 self.txtInfo.append("#######Error checking, disc: "+functions.i2s(self.var_disc_n)+" copy: "
474 +functions.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode())) No newline at end of file
474 +functions.i2s(self.var_copy_n)+", code "+QtCore.QString(self.process_check.exitCode()))
475 functions2.update_message(2, "ERROR", self) No newline at end of file
475 functions2.update_message(2, "ERROR", self)
476 No newline at end of file
476
477 #borrar el contenido de tmpdata No newline at end of file
477 #borrar el contenido de tmpdata
478 var_tmpdata=self.var_Rpath+"/tmpdata" No newline at end of file
478 var_tmpdata=self.var_Rpath+"/tmpdata"
479 No newline at end of file
479
480 bool_return = functions.remove_dir(var_tmpdata, self) No newline at end of file
480 bool_return = functions.remove_dir(var_tmpdata, self)
481 if not(bool_return): No newline at end of file
481 if not(bool_return):
482 self.txtInfo.append("Error deleting directory: "+var_tmpdata) No newline at end of file
482 self.txtInfo.append("Error deleting directory: "+var_tmpdata)
483 self.bool_state_burning = False No newline at end of file
483 self.bool_state_burning = False
484 return No newline at end of file
484 return
485 No newline at end of file
485
486 bool_return = functions.make_dir(var_tmpdata, self) No newline at end of file
486 bool_return = functions.make_dir(var_tmpdata, self)
487 if not(bool_return): No newline at end of file
487 if not(bool_return):
488 self.txtInfo.append("Error creating directory:"+ var_tmpdata) No newline at end of file
488 self.txtInfo.append("Error creating directory:"+ var_tmpdata)
489 self.bool_state_burning = False No newline at end of file
489 self.bool_state_burning = False
490 return No newline at end of file
490 return
491 No newline at end of file
491
492 functions.is_last_disc_and_copy(self) No newline at end of file
492 functions.is_last_disc_and_copy(self)
493 No newline at end of file
493
494 #----------------------------------------------------- Funciones del proceso de verificacion manual --------------------------------------------------------------- No newline at end of file
494 #----------------------------------------------------- Funciones del proceso de verificacion manual ---------------------------------------------------------------
495 No newline at end of file
495
496 def readOuput_manual_check(self): No newline at end of file
496 def readOuput_manual_check(self):
497 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_manual_check.readAllStandardOutput())) No newline at end of file
497 self.txtProgress.setText("stdout check: " + QtCore.QString(self.process_manual_check.readAllStandardOutput()))
498 No newline at end of file
498
499 def readError_manual_check(self): No newline at end of file
499 def readError_manual_check(self):
500 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_manual_check.readAllStandardError())) No newline at end of file
500 self.txtProgress.setText("stderr check: " + QtCore.QString(self.process_manual_check.readAllStandardError()))
501 No newline at end of file
501
502 def finished_manual_check(self): No newline at end of file
502 def finished_manual_check(self):
503 self.txtProgress.clear() No newline at end of file
503 self.txtProgress.clear()
504 No newline at end of file
504
505 if not(self.bool_state_manual_check): No newline at end of file
505 if not(self.bool_state_manual_check):
506 return No newline at end of file
506 return
507 No newline at end of file
507
508 if self.process_manual_check.exitCode() == 0: No newline at end of file
508 if self.process_manual_check.exitCode() == 0:
509 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_n_check_dirs + 1)) No newline at end of file
509 self.txtInfo.append("--------Complete checking, disc: "+str(self.var_n_check_dirs + 1))
510 functions2.update_message(2, "CHECKED", self, index=self.var_n_check_dirs) No newline at end of file
510 functions2.update_message(2, "CHECKED", self, index=self.var_n_check_dirs)
511 No newline at end of file
511
512 else: No newline at end of file
512 else:
513 self.txtInfo.append("#######Error checking, disc: "+str(self.var_n_check_dirs + 1) No newline at end of file
513 self.txtInfo.append("#######Error checking, disc: "+str(self.var_n_check_dirs + 1)
514 +", code "+QtCore.QString(self.process_manual_check.exitCode())) No newline at end of file
514 +", code "+QtCore.QString(self.process_manual_check.exitCode()))
515 functions2.update_message(2, "ERROR", self, index=self.var_n_check_dirs) No newline at end of file
515 functions2.update_message(2, "ERROR", self, index=self.var_n_check_dirs)
516 No newline at end of file
516
517 #borrar el contenido de tmpdata
517 #borrar el contenido de tmpdata
No newline at end of file
518 var_tmpdata=self.var_TDpath+"/tmpdata" No newline at end of file
518 var_tmpdata=self.var_Rpath+"/tmpdata" No newline at end of file
519 No newline at end of file
519
520 bool_return = functions.remove_dir(var_tmpdata, self) No newline at end of file
520 bool_return = functions.remove_dir(var_tmpdata, self)
521 if not(bool_return): No newline at end of file
521 if not(bool_return):
522 self.txtInfo.append("Error deleting directory: "+var_tmpdata) No newline at end of file
522 self.txtInfo.append("Error deleting directory: "+var_tmpdata)
523 self.bool_state_burning = False No newline at end of file
523 self.bool_state_burning = False
524 return No newline at end of file
524 return
525
525
No newline at end of file
526
526 bool_return = functions.make_dir(var_tmpdata, self)
No newline at end of file
No newline at end of file
527
527 if not(bool_return):
No newline at end of file
No newline at end of file
528 self.var_n_check_dirs +=1
528 self.txtInfo.append("Error creating directory:"+ var_tmpdata)
No newline at end of file
No newline at end of file
529
529 self.bool_state_burning = False
No newline at end of file
No newline at end of file
530 if self.var_n_check_dirs >= len(self.list_check_dirs) : No newline at end of file
530 return
No newline at end of file
531
No newline at end of file
532 if self.var_n_check_dirs >= len(self.list_check_dirs) : No newline at end of file
533 self.bool_state_manual_check = False
531 self.bool_state_manual_check = False
No newline at end of file
532 self.function_manual_check_final()
534 return
No newline at end of file
No newline at end of file
533 return
535
No newline at end of file
No newline at end of file
534
536 self.var_n_check_dirs +=1
No newline at end of file
No newline at end of file
535
537 self.manual_check() No newline at end of file
No newline at end of file
536 self.function_manual_check() No newline at end of file
538 No newline at end of file
537
539 No newline at end of file
538
540 #============================================================================== No newline at end of file
539 #==============================================================================
541 # Botones para el proceso de grabacion No newline at end of file
540 # Botones para el proceso de grabacion
542 #============================================================================== No newline at end of file
541 #==============================================================================
543 No newline at end of file
542
544 #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- No newline at end of file
543 #----------------------------------------------------- Iniciar proceso de grabacion ---------------------------------------------------------------
545 No newline at end of file
544
546 @pyqtSignature("") No newline at end of file
545 @pyqtSignature("")
547 def on_btnStartburn_clicked(self): No newline at end of file
546 def on_btnStartburn_clicked(self):
548 """ No newline at end of file
547 """
549 Se inicia el proceso de grabacion No newline at end of file
548 Se inicia el proceso de grabacion
550 """ No newline at end of file
549 """
551 #Verifica que exista algun dispositivo de grabacion seleccionado No newline at end of file
550 #Verifica que exista algun dispositivo de grabacion seleccionado
552 if not(functions2.selected_devices(self)): No newline at end of file
551 if not(functions2.selected_devices(self)):
553 self.txtInfo.append("There is no recording device selected") No newline at end of file
552 self.txtInfo.append("There is no recording device selected")
554 return No newline at end of file
553 return
555 No newline at end of file
554
556 # #Lista los dispositivos de grabacion a usar No newline at end of file
555 # #Lista los dispositivos de grabacion a usar
557 # for dev in self.var_devices: No newline at end of file
556 # for dev in self.var_devices:
558 # self.txtInfo.append("recording device :"+dev) No newline at end of file
557 # self.txtInfo.append("recording device :"+dev)
559 No newline at end of file
558
560 self.bool_state_burning = True No newline at end of file
559 self.bool_state_burning = True
561 functions2.enabled_items2(True, self) No newline at end of file
560 functions2.enabled_items2(True, self)
562 No newline at end of file
561
563 if self.bool_first_iso == True: No newline at end of file
562 if self.bool_first_iso == True:
564 self.txtInfo.append("BUTTON: on_btnStartburn_clicked") No newline at end of file
563 self.txtInfo.append("BUTTON: on_btnStartburn_clicked")
565 self.var_step = 4 No newline at end of file
564 self.var_step = 4
566 self.function_eject() No newline at end of file
565 self.function_eject()
567 return No newline at end of file
566 return
568 No newline at end of file
567
569 if self.var_step == 0: No newline at end of file
568 if self.var_step == 0:
570 self.function_iso() No newline at end of file
569 self.function_iso()
571 return No newline at end of file
570 return
572 No newline at end of file
571
573 if self.var_step == 1: No newline at end of file
572 if self.var_step == 1:
574 self.function_burn() No newline at end of file
573 self.function_burn()
575 return No newline at end of file
574 return
576 No newline at end of file
575
577 #----------------------------------------------------- Funcion para el grabado --------------------------------------------------------------- No newline at end of file
576 #----------------------------------------------------- Funcion para el grabado ---------------------------------------------------------------
578 No newline at end of file
577
579 def function_iso(self): No newline at end of file
578 def function_iso(self):
580 #Creacion del archivo.iso para la grabacion No newline at end of file
579 #Creacion del archivo.iso para la grabacion
581 if self.var_step == 0: No newline at end of file
580 if self.var_step == 0:
582 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########") No newline at end of file
581 self.txtInfo.append("########## Disc number: "+str(self.var_disc_n)+"##########")
583 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n)) No newline at end of file
582 self.txtInfo.append("------Creating iso file number: "+str(self.var_disc_n))
584 No newline at end of file
583
585 var_cmd = functions.cmd_iso(self) No newline at end of file
584 var_cmd = functions.cmd_iso(self)
586 No newline at end of file
585
587 if self.var_real_show_cmd == True: No newline at end of file
586 if self.var_real_show_cmd == True:
588 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
587 self.txtInfo.append("CMD: "+var_cmd)
589 No newline at end of file
588
590 if self.var_real_iso == False: No newline at end of file
589 if self.var_real_iso == False:
591 self.txtInfo.append('**function_iso') No newline at end of file
590 self.txtInfo.append('**function_iso')
592 var_cmd="echo 'function_iso'" No newline at end of file
591 var_cmd="echo 'function_iso'"
593 No newline at end of file
592
594 self.process_iso.start(var_cmd) No newline at end of file
593 self.process_iso.start(var_cmd)
595 No newline at end of file
594
596 def function_burn(self): No newline at end of file
595 def function_burn(self):
597 #Grabacion de los DVDs No newline at end of file
596 #Grabacion de los DVDs
598 No newline at end of file
597
599 if self.var_step == 1: No newline at end of file
598 if self.var_step == 1:
600 self.txtInfo.append("------Recording disc: "+str(self.var_disc_n)+", copy:"+str(self.var_copy_n)) No newline at end of file
599 self.txtInfo.append("------Recording disc: "+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
601 functions2.update_message(1, "BURNING", self) No newline at end of file
600 functions2.update_message(1, "BURNING", self)
602 No newline at end of file
601
603 var_cmd = functions.cmd_burn(self) No newline at end of file
602 var_cmd = functions.cmd_burn(self)
604 No newline at end of file
603
605 if self.var_real_show_cmd == True: No newline at end of file
604 if self.var_real_show_cmd == True:
606 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
605 self.txtInfo.append("CMD: "+var_cmd)
607 No newline at end of file
606
608 if self.var_real_burn == False: No newline at end of file
607 if self.var_real_burn == False:
609 self.txtInfo.append('**function_burn') No newline at end of file
608 self.txtInfo.append('**function_burn')
610 var_cmd="echo 'function_burn'" No newline at end of file
609 var_cmd="echo 'function_burn'"
611 No newline at end of file
610
612 self.process_burn.start(var_cmd) No newline at end of file
611 self.process_burn.start(var_cmd)
613 No newline at end of file
612
614 def function_check(self): No newline at end of file
613 def function_check(self):
615 #Verificacion de los discos No newline at end of file
614 #Verificacion de los discos
616 if self.var_step == 2: No newline at end of file
615 if self.var_step == 2:
617 self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n)) No newline at end of file
616 self.txtInfo.append("-----------checking disc:"+str(self.var_disc_n)+", copy:"+str(self.var_copy_n))
618 No newline at end of file
617
619 functions2.eject_one_device(self) No newline at end of file
618 functions2.eject_one_device(self)
620 functions2.eject_t_one_device(self) No newline at end of file
619 functions2.eject_t_one_device(self)
621 self.txtInfo.append("Waiting ...") No newline at end of file
620 self.txtInfo.append("Waiting ...")
622 time .sleep(20) No newline at end of file
621 time .sleep(20)
623 No newline at end of file
622
624 functions2.update_message(2, "CHECKING", self) No newline at end of file
623 functions2.update_message(2, "CHECKING", self)
625 No newline at end of file
624
626 dev_sr = functions2.get_dev_sr(self) No newline at end of file
625 dev_sr = functions2.get_dev_sr(self)
627 var_cmd = functions.cmd_check(dev_sr, self) No newline at end of file
626 var_cmd = functions.cmd_check(dev_sr, self)
628 No newline at end of file
627
629 if self.var_real_show_cmd == True: No newline at end of file
628 if self.var_real_show_cmd == True:
630 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
629 self.txtInfo.append("CMD: "+var_cmd)
631 No newline at end of file
630
632 if self.var_real_check == False: No newline at end of file
631 if self.var_real_check == False:
633 self.txtInfo.append('**function_check') No newline at end of file
632 self.txtInfo.append('**function_check')
634 var_cmd="echo 'function_check'" No newline at end of file
633 var_cmd="echo 'function_check'"
635 No newline at end of file
634
636 self.process_check.start(var_cmd) No newline at end of file
635 self.process_check.start(var_cmd)
637 No newline at end of file
636
638 #OK No newline at end of file
637 #OK
639 def function_eject(self): No newline at end of file
638 def function_eject(self):
640 self.txtInfo.append("Ejecting recording devices") No newline at end of file
639 self.txtInfo.append("Ejecting recording devices")
641 self.txtInfo.append("Please insert blank discs") No newline at end of file
640 self.txtInfo.append("Please insert blank discs")
642 No newline at end of file
641
643 if self.var_real_eject == True: No newline at end of file
642 if self.var_real_eject == True:
644 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion No newline at end of file
643 functions2.eject_devices(self) # Expulsa las bandejas de los dispostivos de grabacion
645 else: No newline at end of file
644 else:
646 self.txtInfo.append("**functions2.eject_devices") No newline at end of file
645 self.txtInfo.append("**functions2.eject_devices")
647 No newline at end of file
646
648 self.btnStartburn.setText("Continue") No newline at end of file
647 self.btnStartburn.setText("Continue")
649 self.btnStartburn.setEnabled(True) No newline at end of file
648 self.btnStartburn.setEnabled(True)
650 No newline at end of file
649
651 if self.bool_first_iso == True: No newline at end of file
650 if self.bool_first_iso == True:
652 self.bool_first_iso = False No newline at end of file
651 self.bool_first_iso = False
653 self.var_step = 0 No newline at end of file
652 self.var_step = 0
654 No newline at end of file
653
655 elif self.var_copy_n == 1: No newline at end of file
654 elif self.var_copy_n == 1:
656 self.var_step = 0 No newline at end of file
655 self.var_step = 0
657 No newline at end of file
656
658 else: No newline at end of file
657 else:
659 self.var_step = 1 No newline at end of file
658 self.var_step = 1
660 No newline at end of file
659
661 def function_final(self): No newline at end of file
660 def function_final(self):
662 self.txtInfo.append("Recording process is complete") No newline at end of file
661 self.txtInfo.append("Recording process is complete")
663 if os.path.isfile("parameters.conf"): No newline at end of file
662 if os.path.isfile("parameters.conf"):
664 os.remove("parameters.conf") No newline at end of file
663 os.remove("parameters.conf")
665 if os.path.isfile("burning.conf"): No newline at end of file
664 if os.path.isfile("burning.conf"):
666 os.remove("burning.conf") No newline at end of file
665 os.remove("burning.conf")
667 No newline at end of file
666
668 No newline at end of file
667
669 No newline at end of file
668
670 #----------------------------------------------------- Detener proceso de grabacion --------------------------------------------------------------- No newline at end of file
669 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
671 No newline at end of file
670
672 @pyqtSignature("") No newline at end of file
671 @pyqtSignature("")
673 def on_btnStopburn_clicked(self): No newline at end of file
672 def on_btnStopburn_clicked(self):
674 """ No newline at end of file
673 """
675 Slot documentation goes here. No newline at end of file
674 Slot documentation goes here.
676 """ No newline at end of file
675 """
677 self.bool_state_burning = False No newline at end of file
676 self.bool_state_burning = False
678 No newline at end of file
677
679 if self.var_step == 0: No newline at end of file
678 if self.var_step == 0:
680 self.process_iso.terminate() #Termina el proceso, si puede No newline at end of file
679 self.process_iso.terminate() #Termina el proceso, si puede
681 # self.process_iso.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona No newline at end of file
680 # self.process_iso.kill() #Mata el proceso, no es la forma adecuada, solo usar si terminate() no funciona
682 elif self.var_step == 1: No newline at end of file
681 elif self.var_step == 1:
683 self.process_burn.terminate() No newline at end of file
682 self.process_burn.terminate()
684 elif self.var_step == 2: No newline at end of file
683 elif self.var_step == 2:
685 self.process_check.terminate() No newline at end of file
684 self.process_check.terminate()
686 No newline at end of file
685
687 self.txtInfo.append("Stopped recording") No newline at end of file
686 self.txtInfo.append("Stopped recording")
688 functions2.enabled_items2(False, self) No newline at end of file
687 functions2.enabled_items2(False, self)
689 self.bool_first_iso = True No newline at end of file
688 self.bool_first_iso = True
690 No newline at end of file
689
691 No newline at end of file
690
692 No newline at end of file
691
693 #============================================================================== No newline at end of file
692 #==============================================================================
694 # Proceso verificacion manual No newline at end of file
693 # Proceso verificacion manual
695 #============================================================================== No newline at end of file
694 #==============================================================================
696 No newline at end of file
695
697 No newline at end of file
696
698 #----------------------------------------------------- Proceso de verificaion manual --------------------------------------------------------------- No newline at end of file
697 #----------------------------------------------------- Proceso de verificaion manual ---------------------------------------------------------------
699 No newline at end of file
698
700 No newline at end of file
699
701 @pyqtSignature("") No newline at end of file
700 @pyqtSignature("")
702 def on_btnTDpath_clicked(self): No newline at end of file
701 def on_btnTDpath_clicked(self):
703 """ No newline at end of file
702 """
704 Slot documentation goes here. No newline at end of file
703 Slot documentation goes here.
705 """ No newline at end of file
704 """
706 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) No newline at end of file
705 self.var_TDpath= str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
707 self.txtTDpath.setText(self.var_TDpath) No newline at end of file
706 self.txtTDpath.setText(self.var_TDpath)
708 self.statusTDpath = functions.dir_exists(self.var_TDpath, self) No newline at end of file
707 self.statusTDpath = functions.dir_exists(self.var_TDpath, self)
709 if self.statusTDpath: No newline at end of file
708 if self.statusTDpath:
710 self.btnCHstart.setEnabled(True) No newline at end of file
709 self.btnCHstart.setEnabled(True)
711 No newline at end of file
710
712 No newline at end of file
711
713 @pyqtSignature("") No newline at end of file
712 @pyqtSignature("")
714 def on_btnCHstart_clicked(self): No newline at end of file
713 def on_btnCHstart_clicked(self):
715 """ No newline at end of file
714 """
716 Slot documentation goes here. No newline at end of file
715 Slot documentation goes here.
717 """ No newline at end of file
716 """
718 list_dirs = functions2.mounted_devices() No newline at end of file
717 list_dirs = functions2.mounted_devices()
719 if list_dirs == "FATAL ERROR": No newline at end of file
718 if list_dirs == "FATAL ERROR":
720 self.txtInfo.append("ERROR") No newline at end of file
719 self.txtInfo.append("ERROR")
721 return No newline at end of file
720 return
722 No newline at end of file
721
723 for i in list_dirs: No newline at end of file
722 for i in list_dirs:
724 self.txtInfo.append(i) No newline at end of file
723 self.txtInfo.append(i)
725 No newline at end of file
724
726 self.list_check_dirs = list_dirs #contiene los directorios donde estan montados los discos a verificar No newline at end of file
725 self.list_check_dirs = list_dirs #contiene los directorios donde estan montados los discos a verificar
727 self.var_n_check_dirs = 0 No newline at end of file
726 self.var_n_check_dirs = 0
728 self.bool_state_manual_check = True No newline at end of file
727 self.bool_state_manual_check = True
729 No newline at end of file
728
730 self.btnTDpath.setEnabled(False) #Deshabilito el boton que permite cambiar la ruta de verificacion No newline at end of file
729 self.btnTDpath.setEnabled(False) #Deshabilito el boton que permite cambiar la ruta de verificacion
731 self.btnCHstart.setText("STOP") #Cambio el texto del boton No newline at end of file
730 self.btnCHstart.setText("STOP") #Cambio el texto del boton
731 self.txtInfo.append(self.btnCHstart.text()) No newline at end of file
732 No newline at end of file
732
733 self.function_manual_check() No newline at end of file
733 self.function_manual_check()
734 No newline at end of file
734
735 No newline at end of file
735
736 def function_manual_check(self): No newline at end of file
736 def function_manual_check(self):
737 No newline at end of file
737
738 #Verificacion de los discos No newline at end of file
738 #Verificacion de los discos
739 if self.bool_state_manual_check == True: No newline at end of file
739 if self.bool_state_manual_check == True:
740
740
No newline at end of file
741 self.txtInfo.append("-----------manually checking disc: "+str(self.var_n_check_dirs + 1)
741 self.txtInfo.append("-----------manually checking disc: "+self.var_n_check_dirs
No newline at end of file
No newline at end of file
742 +" directory: "+self.list_check_dirs[self.var_n_check_dirs]) No newline at end of file
742 +" data"+self.list_check_dirs[self.var_n_check_dirs]) No newline at end of file
743 No newline at end of file
743
744 functions2.update_message(2, "CHECKING", self, index=self.var_n_check_dirs) No newline at end of file
744 functions2.update_message(2, "CHECKING", self, index=self.var_n_check_dirs)
745 No newline at end of file
745
746 #Crea la carpeta tmpdata dentro de la ruta elegida
No newline at end of file
747 var_tmpdata=self.var_TDpath+"/tmpdata"
No newline at end of file
748 bool_return = functions.make_dir(var_tmpdata, self)
No newline at end of file
749 if not(bool_return):
No newline at end of file
750 self.txtInfo.append("Error creating directory:"+ var_tmpdata)
No newline at end of file
751 self.bool_state_burning = False
No newline at end of file
752 return
No newline at end of file
753 No newline at end of file
746 var_data_dir = self.list_check_dirs[self.var_n_check_dirs] #Carpeta donde esta montado el disco actual No newline at end of file
754 var_data_dir = self.list_check_dirs[self.var_n_check_dirs] #Carpeta donde esta montado el disco actual
747
755
No newline at end of file
756 var_cmd = functions.cmd_manual_check(var_data_dir, var_tmpdata) No newline at end of file
748 var_cmd = functions.cmd_manual_check(var_data_dir, self.var_TDpath) No newline at end of file
749 No newline at end of file
757
750 if self.var_real_show_cmd == True: No newline at end of file
758 if self.var_real_show_cmd == True:
751 self.txtInfo.append("CMD: "+var_cmd) No newline at end of file
759 self.txtInfo.append("CMD: "+var_cmd)
752 No newline at end of file
760
753 if self.var_real_manual_check == False: No newline at end of file
761 if self.var_real_manual_check == False:
754 self.txtInfo.append('**function_manual_check') No newline at end of file
762 self.txtInfo.append('**function_manual_check')
755 var_cmd="echo 'function_manual_check'" No newline at end of file
763 var_cmd="echo 'function_manual_check'"
756 No newline at end of file
764
757 self.process_manual_check.start(var_cmd) No newline at end of file
765 self.process_manual_check.start(var_cmd)
758 No newline at end of file
766
767
No newline at end of file
768 def function_manual_check_final(self):
No newline at end of file
769 self.txtInfo.append("Manual check process is complete")
No newline at end of file
770 self.btnCHstart.setText("START") #Cambio el texto del boton
No newline at end of file
771
No newline at end of file
772 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now