@@ -196,14 +196,14 | |||||
196 | @pyqtSignature("") |
|
196 | @pyqtSignature("") | |
197 | def on_btnGbkp_clicked(self): |
|
197 | def on_btnGbkp_clicked(self): | |
198 | """ |
|
198 | """ | |
199 | Slot documentation goes here. |
|
199 | Cuando se presiona el boton Generate Bkp | |
200 | """ |
|
200 | """ | |
|
201 | ||||
|
202 | #CREA LAS CARPETAS "COMENTADO TEMPORALMENTE" | |||
201 | var_dirs='/{gpath,iso,ppath}' |
|
203 | var_dirs='/{gpath,iso,ppath}' | |
202 | var_Rpath=self.txtRpath.text() |
|
204 | var_Rpath=self.txtRpath.text() | |
203 | var_cmd="mkdir "+str(var_Rpath)+str(var_dirs) |
|
205 | var_cmd="mkdir "+str(var_Rpath)+str(var_dirs) | |
204 | self.txtInfo.append(var_cmd) |
|
206 | self.txtInfo.append(var_cmd) | |
205 |
|
||||
206 | #CREA LAS CARPETAS "COMENTADO TEMPORALMENTE" |
|
|||
207 | #var_output=commands.getstatusoutput(var_cmd)[0] |
|
207 | #var_output=commands.getstatusoutput(var_cmd)[0] | |
208 | #if var_output != 0: |
|
208 | #if var_output != 0: | |
209 | # self.txtInfo.setText("No se pudieron crear los directorios, output_error:" + str(var_output)) |
|
209 | # self.txtInfo.setText("No se pudieron crear los directorios, output_error:" + str(var_output)) | |
@@ -228,11 +228,51 | |||||
228 | for var_file in var_output.split(): |
|
228 | for var_file in var_output.split(): | |
229 | var_files_list.append(var_file) |
|
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 | for i in var_files_list: |
|
253 | for i in var_files_list: | |
234 | self.txtInfo.append(str(os.path.getsize(i))) |
|
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 | |
235 | self.txtInfo.append(i) |
|
255 | var_tmp += var_size_i | |
236 |
|
256 | |||
237 |
|
257 | if var_tmp > var_Dcapacity: | ||
238 |
|
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 | <layout class="QVBoxLayout" name="verticalLayout_3"> |
|
17 | <layout class="QVBoxLayout" name="verticalLayout_3"> | |
18 | <item> |
|
18 | <item> | |
19 | <widget class="QTabWidget" name="tabWidget"> |
|
19 | <widget class="QTabWidget" name="tabWidget"> | |
|
20 | <property name="enabled"> | |||
|
21 | <bool>true</bool> | |||
|
22 | </property> | |||
20 | <property name="sizePolicy"> |
|
23 | <property name="sizePolicy"> | |
21 | <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> |
|
24 | <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> | |
22 | <horstretch>0</horstretch> |
|
25 | <horstretch>0</horstretch> | |
@@ -27,6 +30,9 | |||||
27 | <number>0</number> |
|
30 | <number>0</number> | |
28 | </property> |
|
31 | </property> | |
29 | <widget class="QWidget" name="tabParameters"> |
|
32 | <widget class="QWidget" name="tabParameters"> | |
|
33 | <property name="enabled"> | |||
|
34 | <bool>true</bool> | |||
|
35 | </property> | |||
30 | <attribute name="title"> |
|
36 | <attribute name="title"> | |
31 | <string>Parameters</string> |
|
37 | <string>Parameters</string> | |
32 | </attribute> |
|
38 | </attribute> | |
@@ -193,6 +199,9 | |||||
193 | </layout> |
|
199 | </layout> | |
194 | </widget> |
|
200 | </widget> | |
195 | <widget class="QWidget" name="tabDconfig"> |
|
201 | <widget class="QWidget" name="tabDconfig"> | |
|
202 | <property name="enabled"> | |||
|
203 | <bool>true</bool> | |||
|
204 | </property> | |||
196 | <property name="sizePolicy"> |
|
205 | <property name="sizePolicy"> | |
197 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> |
|
206 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
198 | <horstretch>0</horstretch> |
|
207 | <horstretch>0</horstretch> | |
@@ -654,7 +663,7 | |||||
654 | <x>0</x> |
|
663 | <x>0</x> | |
655 | <y>0</y> |
|
664 | <y>0</y> | |
656 | <width>593</width> |
|
665 | <width>593</width> | |
657 |
<height>2 |
|
666 | <height>25</height> | |
658 | </rect> |
|
667 | </rect> | |
659 | </property> |
|
668 | </property> | |
660 | <widget class="QMenu" name="menuFile"> |
|
669 | <widget class="QMenu" name="menuFile"> |
General Comments 0
You need to be logged in to leave comments.
Login now