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