##// END OF EJS Templates
***
ralonso -
r20:21
parent child
Show More
@@ -196,14 +196,14
196 196 @pyqtSignature("")
197 197 def on_btnGbkp_clicked(self):
198 198 """
199 Slot documentation goes here.
200 """
199 Cuando se presiona el boton Generate Bkp
200 """
201
202 #CREA LAS CARPETAS "COMENTADO TEMPORALMENTE"
201 203 var_dirs='/{gpath,iso,ppath}'
202 204 var_Rpath=self.txtRpath.text()
203 205 var_cmd="mkdir "+str(var_Rpath)+str(var_dirs)
204 206 self.txtInfo.append(var_cmd)
205
206 #CREA LAS CARPETAS "COMENTADO TEMPORALMENTE"
207 207 #var_output=commands.getstatusoutput(var_cmd)[0]
208 208 #if var_output != 0:
209 209 # self.txtInfo.setText("No se pudieron crear los directorios, output_error:" + str(var_output))
@@ -228,11 +228,51
228 228 for var_file in var_output.split():
229 229 var_files_list.append(var_file)
230 230
231 self.txtInfo.append('Lista de archivos')
231 var_Dcapacity=float(self.txtDcapacity.text())*1024 #tamaño en KB
232 self.txtInfo.append(str(var_Dcapacity))
233
234 # self.txtInfo.append('Lista de archivos')
235 # var_n=0
236 # for i in var_files_list:
237 #self.txtInfo.append(str(os.path.getsize(i)/1024)+'KB')
238 #self.txtInfo.append(i)
239 #var_n += 1
240 #self.txtInfo.append(str(var_n))
241
242 #lista de archivos a grabar en archivos .
243
244 #Ruta de los archivos a grabar
245 var_Rpath_ppath=var_Rpath=self.txtRpath.text()+"/ppath"
246
247 var_n=0
248 var_n_files=0
249 var_tmp=0
250 var_files_list_2=[]
251 self.txtInfo.append(str(len(var_files_list)))
232 252
233 253 for i in var_files_list:
234 self.txtInfo.append(str(os.path.getsize(i)))
235 self.txtInfo.append(i)
236
237
238
254 var_size_i=os.path.getsize(i)/1024+1 #tamaño en KB, se suma 1 KB para evitar problemas al momento de sumar
255 var_tmp += var_size_i
256
257 if var_tmp > var_Dcapacity:
258 var_tmp -= var_size_i #se quita el tamaño sumado para mostrar el tamaño real
259 self.txtInfo.append(str(len(var_files_list_2))+" size:"+str(var_tmp))
260
261 var_file = open(self.txtElabel.text()+"_"+str(var_n),"w")
262 for line in var_files_list_2:
263 var_file.write(line)
264 var_file.close()
265
266 var_n_files += len(var_files_list_2)
267 var_tmp = var_size_i
268 var_files_list_2=[]
269 var_files_list_2.append(i)
270 var_n += 1
271
272 else:
273 var_files_list_2.append(i)
274
275 self.txtInfo.append(str(len(var_files_list_2))+" size:"+str(var_tmp))
276
277 var_n_files += len(var_files_list_2)
278 self.txtInfo.append(str(var_n_files))
@@ -17,6 +17,9
17 17 <layout class="QVBoxLayout" name="verticalLayout_3">
18 18 <item>
19 19 <widget class="QTabWidget" name="tabWidget">
20 <property name="enabled">
21 <bool>true</bool>
22 </property>
20 23 <property name="sizePolicy">
21 24 <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
22 25 <horstretch>0</horstretch>
@@ -27,6 +30,9
27 30 <number>0</number>
28 31 </property>
29 32 <widget class="QWidget" name="tabParameters">
33 <property name="enabled">
34 <bool>true</bool>
35 </property>
30 36 <attribute name="title">
31 37 <string>Parameters</string>
32 38 </attribute>
@@ -193,6 +199,9
193 199 </layout>
194 200 </widget>
195 201 <widget class="QWidget" name="tabDconfig">
202 <property name="enabled">
203 <bool>true</bool>
204 </property>
196 205 <property name="sizePolicy">
197 206 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
198 207 <horstretch>0</horstretch>
@@ -654,7 +663,7
654 663 <x>0</x>
655 664 <y>0</y>
656 665 <width>593</width>
657 <height>20</height>
666 <height>25</height>
658 667 </rect>
659 668 </property>
660 669 <widget class="QMenu" name="menuFile">
General Comments 0
You need to be logged in to leave comments. Login now