@@ -25,8 +25,6 | |||||
25 | def setupUi2(self): |
|
25 | def setupUi2(self): | |
26 | print 'hi' |
|
26 | print 'hi' | |
27 |
|
27 | |||
28 |
|
||||
29 |
|
||||
30 | @pyqtSignature("") |
|
28 | @pyqtSignature("") | |
31 | def on_btnDpath_clicked(self): |
|
29 | def on_btnDpath_clicked(self): | |
32 | """ |
|
30 | """ | |
@@ -48,7 +46,6 | |||||
48 |
|
46 | |||
49 | @pyqtSignature("") |
|
47 | @pyqtSignature("") | |
50 | def on_txtDpath_editingFinished(self): |
|
48 | def on_txtDpath_editingFinished(self): | |
51 |
|
||||
52 |
|
49 | |||
53 | #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo) |
|
50 | #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo) | |
54 | #por ello se prefiere usar el modulo "commands" |
|
51 | #por ello se prefiere usar el modulo "commands" | |
@@ -57,35 +54,40 | |||||
57 | #output_p2= p2.communicate()[0] |
|
54 | #output_p2= p2.communicate()[0] | |
58 | #self.txtInfo.setText(output_p2) |
|
55 | #self.txtInfo.setText(output_p2) | |
59 |
|
56 | |||
|
57 | var_Dpath=self.txtDpath.text() | |||
60 |
|
58 | |||
61 | var_Dpath=self.txtDpath.text() |
|
59 | #Se verifica que la ruta exista y sea un directorio | |
62 | var_cmd="test -d "+str(var_Dpath) |
|
60 | var_cmd="test -d "+str(var_Dpath) | |
63 | var_output=commands.getstatusoutput(var_cmd)[0] |
|
61 | var_output=commands.getstatusoutput(var_cmd)[0] | |
64 | if var_output != 0: |
|
62 | if var_output != 0: | |
65 | self.txtInfo.setText(str(var_output)) |
|
63 | self.txtInfo.setText("Ruta no valida, output_error:" + str(var_output)) | |
66 | return |
|
64 | return | |
67 |
|
65 | |||
68 |
|
66 | #Se buscan los archivos del tipo especificado | ||
69 | var_Dtype=self.txtDtype.text() |
|
67 | var_Dtype=self.txtDtype.text() | |
70 | var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq" |
|
68 | var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq" | |
71 | output_p2=commands.getstatusoutput(var_cmd)[1] |
|
69 | output_p2=commands.getstatusoutput(var_cmd)[1] | |
72 |
|
70 | |||
|
71 | #INFO: Muestra los dias que se encontraron | |||
73 | self.txtInfo.setText(output_p2) |
|
72 | self.txtInfo.setText(output_p2) | |
74 |
|
73 | |||
75 | var_list=[] |
|
74 | #Se cargan las listas para seleccionar StartDay y StopDay | |
|
75 | self.var_list=[] | |||
76 | for i in range(0, (len(output_p2)+1)/8): |
|
76 | for i in range(0, (len(output_p2)+1)/8): | |
77 | var_list.append(output_p2[8*i:8*(i+1)-1]) |
|
77 | self.var_list.append(output_p2[8*i:8*(i+1)-1]) | |
78 |
|
78 | |||
79 | self.lstStartDay.clear() |
|
79 | self.lstStartDay.clear() | |
80 | self.lstStopDay.clear() |
|
80 | self.lstStopDay.clear() | |
81 |
|
81 | |||
82 | for i in var_list: |
|
82 | for i in self.var_list: | |
83 | self.lstStartDay.addItem(i) |
|
83 | self.lstStartDay.addItem(i) | |
84 | self.lstStopDay.addItem(i) |
|
84 | self.lstStopDay.addItem(i) | |
|
85 | ||||
|
86 | self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) | |||
85 |
|
87 | |||
86 | self.txtInfo.setText(str(self.lstStartDay.count())) |
|
88 | #INFO: Muestra cuantos dias se encontraron | |
87 |
self. |
|
89 | # self.txtInfo.setText(str(self.lstStartDay.count())) | |
88 |
|
90 | |||
89 | @pyqtSignature("int") |
|
91 | @pyqtSignature("int") | |
90 | def on_lstDtype_activated(self, index): |
|
92 | def on_lstDtype_activated(self, index): | |
91 | """ |
|
93 | """ | |
@@ -101,6 +103,7 | |||||
101 | if index != 3: |
|
103 | if index != 3: | |
102 | self.txtDtype.setText(var_type) |
|
104 | self.txtDtype.setText(var_type) | |
103 | self.txtDtype.setReadOnly(True) |
|
105 | self.txtDtype.setReadOnly(True) | |
|
106 | self.on_txtDpath_editingFinished() | |||
104 | else: |
|
107 | else: | |
105 | self.txtDtype.setText('') |
|
108 | self.txtDtype.setText('') | |
106 | self.txtDtype.setReadOnly(False) |
|
109 | self.txtDtype.setReadOnly(False) | |
@@ -111,3 +114,35 | |||||
111 | Se activa cuando el tipo de archivo es ingresado manualmente |
|
114 | Se activa cuando el tipo de archivo es ingresado manualmente | |
112 | """ |
|
115 | """ | |
113 | self.on_txtDpath_editingFinished() |
|
116 | self.on_txtDpath_editingFinished() | |
|
117 | ||||
|
118 | @pyqtSignature("int") | |||
|
119 | def on_lstStartDay_activated(self, index): | |||
|
120 | """ | |||
|
121 | Slot documentation goes here. | |||
|
122 | """ | |||
|
123 | self.txtInfo.setText(str(index)) | |||
|
124 | var_StopDay_index=self.lstStopDay.currentIndex() | |||
|
125 | var_StopDay_index -= index | |||
|
126 | ||||
|
127 | self.lstStopDay.clear() | |||
|
128 | ||||
|
129 | for i in self.var_list[index:]: | |||
|
130 | self.lstStopDay.addItem(i) | |||
|
131 | ||||
|
132 | self.lstStopDay.setCurrentIndex(var_StopDay_index) | |||
|
133 | ||||
|
134 | @pyqtSignature("int") | |||
|
135 | def on_lstStopDay_activated(self, index): | |||
|
136 | """ | |||
|
137 | Slot documentation goes here. | |||
|
138 | """ | |||
|
139 | self.txtInfo.setText(str(index)) | |||
|
140 | var_StartDay_index=self.lstStartDay.currentIndex() | |||
|
141 | ||||
|
142 | self.lstStartDay.clear() | |||
|
143 | ||||
|
144 | for i in self.var_list[:index+1]: | |||
|
145 | self.lstStartDay.addItem(i) | |||
|
146 | ||||
|
147 | self.lstStartDay.setCurrentIndex(var_StartDay_index) | |||
|
148 | self.txtInfo.append(str(var_StartDay_index)) |
@@ -154,7 +154,11 | |||||
154 | <widget class="QLineEdit" name="txtElabel"/> |
|
154 | <widget class="QLineEdit" name="txtElabel"/> | |
155 | </item> |
|
155 | </item> | |
156 | <item> |
|
156 | <item> | |
157 |
<widget class="QLineEdit" name="txtCopys" |
|
157 | <widget class="QLineEdit" name="txtCopys"> | |
|
158 | <property name="text"> | |||
|
159 | <string>0</string> | |||
|
160 | </property> | |||
|
161 | </widget> | |||
158 | </item> |
|
162 | </item> | |
159 | </layout> |
|
163 | </layout> | |
160 | </item> |
|
164 | </item> |
@@ -2,7 +2,7 | |||||
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/ricardoar/principal/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' |
|
3 | # Form implementation generated from reading ui file '/home/ricardoar/principal/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' | |
4 | # |
|
4 | # | |
5 |
# Created: Mon Apr 26 1 |
|
5 | # Created: Mon Apr 26 11:25:08 2010 | |
6 | # by: PyQt4 UI code generator 4.7.2 |
|
6 | # by: PyQt4 UI code generator 4.7.2 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
@@ -480,6 +480,7 | |||||
480 | self.chkMST.setText(QtGui.QApplication.translate("MainWindow", "MST-ISR Data", None, QtGui.QApplication.UnicodeUTF8)) |
|
480 | self.chkMST.setText(QtGui.QApplication.translate("MainWindow", "MST-ISR Data", None, QtGui.QApplication.UnicodeUTF8)) | |
481 | self.lblElabel.setText(QtGui.QApplication.translate("MainWindow", "Exp. Label at device", None, QtGui.QApplication.UnicodeUTF8)) |
|
481 | self.lblElabel.setText(QtGui.QApplication.translate("MainWindow", "Exp. Label at device", None, QtGui.QApplication.UnicodeUTF8)) | |
482 | self.lblCopys.setText(QtGui.QApplication.translate("MainWindow", "Copys", None, QtGui.QApplication.UnicodeUTF8)) |
|
482 | self.lblCopys.setText(QtGui.QApplication.translate("MainWindow", "Copys", None, QtGui.QApplication.UnicodeUTF8)) | |
|
483 | self.txtCopys.setText(QtGui.QApplication.translate("MainWindow", "0", None, QtGui.QApplication.UnicodeUTF8)) | |||
483 | self.lblStartDay.setText(QtGui.QApplication.translate("MainWindow", "Start Day:", None, QtGui.QApplication.UnicodeUTF8)) |
|
484 | self.lblStartDay.setText(QtGui.QApplication.translate("MainWindow", "Start Day:", None, QtGui.QApplication.UnicodeUTF8)) | |
484 | self.lblStopDay.setText(QtGui.QApplication.translate("MainWindow", "Stop Day:", None, QtGui.QApplication.UnicodeUTF8)) |
|
485 | self.lblStopDay.setText(QtGui.QApplication.translate("MainWindow", "Stop Day:", None, QtGui.QApplication.UnicodeUTF8)) | |
485 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabParameters), QtGui.QApplication.translate("MainWindow", "Parameters", None, QtGui.QApplication.UnicodeUTF8)) |
|
486 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabParameters), QtGui.QApplication.translate("MainWindow", "Parameters", None, QtGui.QApplication.UnicodeUTF8)) |
General Comments 0
You need to be logged in to leave comments.
Login now