@@ -0,0 +1,6 | |||
|
1 | #Usando el modulo "subprocess", eric4 pide seleccion del tipo de subproceso (padre o hijo) | |
|
2 | #por ello se prefiere usar el modulo "commands" | |
|
3 | #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE) | |
|
4 | #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE) | |
|
5 | #output_p2= p2.communicate()[0] | |
|
6 | #self.txtInfo.setText(output_p2) |
@@ -59,8 +59,9 | |||
|
59 | 59 | |
|
60 | 60 | #Si no se encuentra ningun archivo |
|
61 | 61 | if len(output) == 0: |
|
62 | self.btnGbkp.setEnabled(False) | |
|
63 | return | |
|
62 | self.txtInfo.append("No se encontraron archivos") | |
|
63 | self.btnGbkp.setEnabled(False) | |
|
64 | return | |
|
64 | 65 | |
|
65 | 66 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) |
|
66 | 67 | for i in range(0, (len(output)+1)/8): |
@@ -72,5 +73,20 | |||
|
72 | 73 | self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) |
|
73 | 74 | |
|
74 | 75 | self.btnGbkp.setEnabled(True) |
|
76 | ||
|
77 | ||
|
78 | #Verifica que los parametros | |
|
79 | def validate_parameters(self): | |
|
80 | #Verifica que las rutas sean validas | |
|
81 | if self.statusRpath == False: | |
|
82 | self.txtInfo.append("Ruta de proyecto no valida") | |
|
83 | return False | |
|
75 | 84 | |
|
85 | #Verifica la etiqueta | |
|
86 | if len(self.var_Elabel) == 0: | |
|
87 | self.txtInfo.append("Debe ingresar el nombre de la etiqueta") | |
|
88 | return False | |
|
89 | ||
|
90 | return True | |
|
76 | 91 | |
|
92 |
@@ -37,6 +37,7 | |||
|
37 | 37 | self.var_Dtype = self.txtDtype.text() |
|
38 | 38 | self.var_Elabel = self.txtElabel.text() |
|
39 | 39 | self.var_Copys = self.txtCopys.value() |
|
40 | self.var_Dcapacity = self.txtDcapacity.value() | |
|
40 | 41 | |
|
41 | 42 | self.var_n_files=0 |
|
42 | 43 | self.var_list=[] |
@@ -115,13 +116,24 | |||
|
115 | 116 | |
|
116 | 117 | @pyqtSignature("") |
|
117 | 118 | def on_txtDtype_editingFinished(self): |
|
118 | """ | |
|
119 | Se activa cuando el tipo de archivo es ingresado manualmente | |
|
120 | """ | |
|
121 | 119 | self.var_Dtype=self.txtDtype.text() |
|
122 | #llamada a funcion | |
|
123 | self.on_txtDpath_editingFinished() | |
|
124 | ||
|
120 | functions.load_days(self) #llamada a funcion | |
|
121 | ||
|
122 | ||
|
123 | @pyqtSignature("") | |
|
124 | def on_txtElabel_editingFinished(self): | |
|
125 | self.var_Elabel = self.txtElabel.text() | |
|
126 | ||
|
127 | ||
|
128 | @pyqtSignature("") | |
|
129 | def on_txtCopys_editingFinished(self): | |
|
130 | self.var_Copys = self.txtCopys.value() | |
|
131 | ||
|
132 | ||
|
133 | @pyqtSignature("") | |
|
134 | def on_txtDcapacity_editingFinished(self): | |
|
135 | self.var_Dcapacity = self.txtDcapacity.value() | |
|
136 | ||
|
125 | 137 | |
|
126 | 138 | @pyqtSignature("int") #CLOSED |
|
127 | 139 | def on_lstStartDay_activated(self, index): |
@@ -167,10 +179,10 | |||
|
167 | 179 | var_size=0.7 |
|
168 | 180 | |
|
169 | 181 | if index != 4: |
|
170 |
self.txtDcapacity.set |
|
|
182 | self.txtDcapacity.setValue(var_size*10**9/1024**2) | |
|
171 | 183 | self.txtDcapacity.setReadOnly(True) |
|
172 | 184 | else: |
|
173 |
self.txtDcapacity.set |
|
|
185 | self.txtDcapacity.setValue(100.0) | |
|
174 | 186 | self.txtDcapacity.setReadOnly(False) |
|
175 | 187 | |
|
176 | 188 | |
@@ -180,23 +192,15 | |||
|
180 | 192 | Cuando se presiona el boton btnGbkp |
|
181 | 193 | """ |
|
182 | 194 | |
|
183 | #Verifica que las rutas sean validas | |
|
184 | if self.statusDpath == False or self.statusRpath == False: | |
|
185 | if self.statusDpath == False: | |
|
186 | self.txtInfo.append("Ruta de datos no valida") | |
|
187 | if self.statusRpath == False: | |
|
188 | self.txtInfo.append("Ruta de proyecto no valida") | |
|
195 | if functions.validate_parameters(self) == False: | |
|
189 | 196 | return |
|
190 | 197 | |
|
191 | 198 | #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente |
|
192 | var_Rpath=self.txtRpath.text() | |
|
193 | 199 | list_dirs=['gpath', 'iso', 'ppath'] |
|
194 | functions.make_dirs(var_Rpath, list_dirs, self) | |
|
200 | functions.make_dirs(self.var_Rpath, list_dirs, self) | |
|
195 | 201 | |
|
196 | 202 | #Cargando variables con los parametros |
|
197 | var_Dpath=self.txtDpath.text() | |
|
198 | var_Rpath=self.txtRpath.text() | |
|
199 | var_Rpath_ppath=var_Rpath+"/ppath" #Ruta de los archivos a grabar | |
|
203 | var_Rpath_ppath=self.var_Rpath+"/ppath" #Ruta de los archivos a grabar | |
|
200 | 204 | var_sublist=[] |
|
201 | 205 | for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]: |
|
202 | 206 | var_sublist.append(i) |
@@ -212,7 +216,7 | |||
|
212 | 216 | #Busca los archivos con los parametros de busqueda |
|
213 | 217 | var_files_list=[] |
|
214 | 218 | for var_doy in var_sublist: |
|
215 | var_cmd="find " + str(var_Dpath) + " -name ?"+var_doy+"???."+ str(var_Dtype) + " |sort" | |
|
219 | var_cmd="find " + str(self.var_Dpath) + " -name ?"+var_doy+"???."+ str(var_Dtype) + " |sort" | |
|
216 | 220 | var_output=commands.getstatusoutput(var_cmd)[1] |
|
217 | 221 | for var_file in var_output.split(): |
|
218 | 222 | var_files_list.append(var_file) #Almacena cada archivo en la lista |
@@ -235,7 +239,7 | |||
|
235 | 239 | var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat","w") |
|
236 | 240 | #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat |
|
237 | 241 | for line in var_files_list_2: |
|
238 | var_tmp_path=(line.split(var_Dpath)[1]).split('/') | |
|
242 | var_tmp_path=(line.split(self.var_Dpath)[1]).split('/') | |
|
239 | 243 | var_tmp_path2="/" |
|
240 | 244 | for l in range(0, len(var_tmp_path)-1): |
|
241 | 245 | var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/" |
@@ -252,7 +256,7 | |||
|
252 | 256 | var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat","w") |
|
253 | 257 | #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat |
|
254 | 258 | for line in var_files_list_2: |
|
255 | var_tmp_path=(line.split(var_Dpath)[1]).split('/') | |
|
259 | var_tmp_path=(line.split(self.var_Dpath)[1]).split('/') | |
|
256 | 260 | var_tmp_path2="/" |
|
257 | 261 | for l in range(0, len(var_tmp_path)-1): |
|
258 | 262 | var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/" |
@@ -324,7 +328,10 | |||
|
324 | 328 | |
|
325 | 329 | #Se deshabilita el Tab Parameters y el boton btnGbkp |
|
326 | 330 | self.tabParameters.setEnabled(False) |
|
327 |
self. |
|
|
331 | self.lstDcapacity.setEnabled(False) | |
|
332 | self.txtDcapacity.setEnabled(False) | |
|
333 | self.btnGbkp.setEnabled(False) | |
|
334 | self.btnRestart.setEnabled(True) | |
|
328 | 335 | |
|
329 | 336 | |
|
330 | 337 | @pyqtSignature("") |
@@ -333,7 +340,10 | |||
|
333 | 340 | Slot documentation goes here. |
|
334 | 341 | """ |
|
335 | 342 | self.tabParameters.setEnabled(True) |
|
343 | self.lstDcapacity.setEnabled(True) | |
|
344 | self.txtDcapacity.setEnabled(True) | |
|
336 | 345 | self.btnGbkp.setEnabled(True) |
|
346 | self.btnRestart.setEnabled(False) | |
|
337 | 347 | |
|
338 | 348 | |
|
339 | 349 | @pyqtSignature("") |
@@ -404,3 +414,5 | |||
|
404 | 414 | var_dev = str(self.txtDeviceD.text()) |
|
405 | 415 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev |
|
406 | 416 | commands.getstatusoutput(var_cmd) |
|
417 | ||
|
418 |
@@ -500,7 +500,7 | |||
|
500 | 500 | </sizepolicy> |
|
501 | 501 | </property> |
|
502 | 502 | <property name="text"> |
|
503 | <string>Device Capacity</string> | |
|
503 | <string>Device Capacity (MB)</string> | |
|
504 | 504 | </property> |
|
505 | 505 | </widget> |
|
506 | 506 | </item> |
@@ -557,12 +557,24 | |||
|
557 | 557 | </widget> |
|
558 | 558 | </item> |
|
559 | 559 | <item> |
|
560 |
<widget class="Q |
|
|
561 |
<property name=" |
|
|
562 | <string>4482.26928711</string> | |
|
560 | <widget class="QDoubleSpinBox" name="txtDcapacity"> | |
|
561 | <property name="sizePolicy"> | |
|
562 | <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> | |
|
563 | <horstretch>0</horstretch> | |
|
564 | <verstretch>0</verstretch> | |
|
565 | </sizepolicy> | |
|
563 | 566 | </property> |
|
564 | 567 | <property name="readOnly"> |
|
565 | 568 | <bool>true</bool> |
|
569 | </property> | |
|
570 | <property name="minimum"> | |
|
571 | <double>100.000000000000000</double> | |
|
572 | </property> | |
|
573 | <property name="maximum"> | |
|
574 | <double>99999.990000000005239</double> | |
|
575 | </property> | |
|
576 | <property name="value"> | |
|
577 | <double>4482.270000000000437</double> | |
|
566 | 578 | </property> |
|
567 | 579 | </widget> |
|
568 | 580 | </item> |
@@ -832,7 +844,6 | |||
|
832 | 844 | <tabstop>chkSequentially</tabstop> |
|
833 | 845 | <tabstop>chkSalert</tabstop> |
|
834 | 846 | <tabstop>lstDcapacity</tabstop> |
|
835 | <tabstop>txtDcapacity</tabstop> | |
|
836 | 847 | <tabstop>chkPSgraphic</tabstop> |
|
837 | 848 | <tabstop>lineEdit_17</tabstop> |
|
838 | 849 | <tabstop>txtSTATUSa</tabstop> |
@@ -2,7 +2,7 | |||
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' |
|
4 | 4 | # |
|
5 |
# Created: |
|
|
5 | # Created: Mon May 17 00:37:27 2010 | |
|
6 | 6 | # by: PyQt4 UI code generator 4.7.2 |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
@@ -312,8 +312,16 | |||
|
312 | 312 | self.lstDcapacity.addItem("") |
|
313 | 313 | self.lstDcapacity.addItem("") |
|
314 | 314 | self.horizontalLayout_10.addWidget(self.lstDcapacity) |
|
315 |
self.txtDcapacity = QtGui.Q |
|
|
315 | self.txtDcapacity = QtGui.QDoubleSpinBox(self.tabDconfig) | |
|
316 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) | |
|
317 | sizePolicy.setHorizontalStretch(0) | |
|
318 | sizePolicy.setVerticalStretch(0) | |
|
319 | sizePolicy.setHeightForWidth(self.txtDcapacity.sizePolicy().hasHeightForWidth()) | |
|
320 | self.txtDcapacity.setSizePolicy(sizePolicy) | |
|
316 | 321 | self.txtDcapacity.setReadOnly(True) |
|
322 | self.txtDcapacity.setMinimum(100.0) | |
|
323 | self.txtDcapacity.setMaximum(99999.99) | |
|
324 | self.txtDcapacity.setProperty("value", 4482.27) | |
|
317 | 325 | self.txtDcapacity.setObjectName("txtDcapacity") |
|
318 | 326 | self.horizontalLayout_10.addWidget(self.txtDcapacity) |
|
319 | 327 | self.chkPSgraphic = QtGui.QCheckBox(self.tabDconfig) |
@@ -482,8 +490,7 | |||
|
482 | 490 | MainWindow.setTabOrder(self.chkSimultaneously, self.chkSequentially) |
|
483 | 491 | MainWindow.setTabOrder(self.chkSequentially, self.chkSalert) |
|
484 | 492 | MainWindow.setTabOrder(self.chkSalert, self.lstDcapacity) |
|
485 |
MainWindow.setTabOrder(self.lstDcapacity, self. |
|
|
486 | MainWindow.setTabOrder(self.txtDcapacity, self.chkPSgraphic) | |
|
493 | MainWindow.setTabOrder(self.lstDcapacity, self.chkPSgraphic) | |
|
487 | 494 | MainWindow.setTabOrder(self.chkPSgraphic, self.lineEdit_17) |
|
488 | 495 | MainWindow.setTabOrder(self.lineEdit_17, self.txtSTATUSa) |
|
489 | 496 | MainWindow.setTabOrder(self.txtSTATUSa, self.txtSTATUSb) |
@@ -542,14 +549,13 | |||
|
542 | 549 | self.lblBprocess.setText(QtGui.QApplication.translate("MainWindow", "Burning process", None, QtGui.QApplication.UnicodeUTF8)) |
|
543 | 550 | self.chkSimultaneously.setText(QtGui.QApplication.translate("MainWindow", "Simultaneously", None, QtGui.QApplication.UnicodeUTF8)) |
|
544 | 551 | self.chkSequentially.setText(QtGui.QApplication.translate("MainWindow", "Sequentially", None, QtGui.QApplication.UnicodeUTF8)) |
|
545 | self.lblDcapacity.setText(QtGui.QApplication.translate("MainWindow", "Device Capacity", None, QtGui.QApplication.UnicodeUTF8)) | |
|
552 | self.lblDcapacity.setText(QtGui.QApplication.translate("MainWindow", "Device Capacity (MB)", None, QtGui.QApplication.UnicodeUTF8)) | |
|
546 | 553 | self.chkSalert.setText(QtGui.QApplication.translate("MainWindow", "Sound Alert", None, QtGui.QApplication.UnicodeUTF8)) |
|
547 | 554 | self.lstDcapacity.setItemText(0, QtGui.QApplication.translate("MainWindow", "BluRay [25.0 GB]", None, QtGui.QApplication.UnicodeUTF8)) |
|
548 | 555 | self.lstDcapacity.setItemText(1, QtGui.QApplication.translate("MainWindow", "DVD2 [8.5 GB]", None, QtGui.QApplication.UnicodeUTF8)) |
|
549 | 556 | self.lstDcapacity.setItemText(2, QtGui.QApplication.translate("MainWindow", "DVD1 [4.7 GB]", None, QtGui.QApplication.UnicodeUTF8)) |
|
550 | 557 | self.lstDcapacity.setItemText(3, QtGui.QApplication.translate("MainWindow", "CD [0.7 GB]", None, QtGui.QApplication.UnicodeUTF8)) |
|
551 | 558 | self.lstDcapacity.setItemText(4, QtGui.QApplication.translate("MainWindow", "Other [? GB]", None, QtGui.QApplication.UnicodeUTF8)) |
|
552 | self.txtDcapacity.setText(QtGui.QApplication.translate("MainWindow", "4482.26928711", None, QtGui.QApplication.UnicodeUTF8)) | |
|
553 | 559 | self.chkPSgraphic.setText(QtGui.QApplication.translate("MainWindow", "PS Graphic", None, QtGui.QApplication.UnicodeUTF8)) |
|
554 | 560 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabDconfig), QtGui.QApplication.translate("MainWindow", "Device Config.", None, QtGui.QApplication.UnicodeUTF8)) |
|
555 | 561 | self.lblSTATUS.setText(QtGui.QApplication.translate("MainWindow", "STATUS", None, QtGui.QApplication.UnicodeUTF8)) |
General Comments 0
You need to be logged in to leave comments.
Login now