##// END OF EJS Templates
***
ralonso -
r11:12
parent child
Show More
@@ -25,8 +25,6
25 25 def setupUi2(self):
26 26 print 'hi'
27 27
28
29
30 28 @pyqtSignature("")
31 29 def on_btnDpath_clicked(self):
32 30 """
@@ -48,7 +46,6
48 46
49 47 @pyqtSignature("")
50 48 def on_txtDpath_editingFinished(self):
51
52 49
53 50 #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo)
54 51 #por ello se prefiere usar el modulo "commands"
@@ -57,35 +54,40
57 54 #output_p2= p2.communicate()[0]
58 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 60 var_cmd="test -d "+str(var_Dpath)
63 61 var_output=commands.getstatusoutput(var_cmd)[0]
64 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 64 return
67 65
68
66 #Se buscan los archivos del tipo especificado
69 67 var_Dtype=self.txtDtype.text()
70 68 var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
71 69 output_p2=commands.getstatusoutput(var_cmd)[1]
72 70
71 #INFO: Muestra los dias que se encontraron
73 72 self.txtInfo.setText(output_p2)
74
75 var_list=[]
73
74 #Se cargan las listas para seleccionar StartDay y StopDay
75 self.var_list=[]
76 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 79 self.lstStartDay.clear()
80 80 self.lstStopDay.clear()
81 81
82 for i in var_list:
82 for i in self.var_list:
83 83 self.lstStartDay.addItem(i)
84 84 self.lstStopDay.addItem(i)
85
86 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
85 87
86 self.txtInfo.setText(str(self.lstStartDay.count()))
87 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
88
88 #INFO: Muestra cuantos dias se encontraron
89 # self.txtInfo.setText(str(self.lstStartDay.count()))
90
89 91 @pyqtSignature("int")
90 92 def on_lstDtype_activated(self, index):
91 93 """
@@ -101,6 +103,7
101 103 if index != 3:
102 104 self.txtDtype.setText(var_type)
103 105 self.txtDtype.setReadOnly(True)
106 self.on_txtDpath_editingFinished()
104 107 else:
105 108 self.txtDtype.setText('')
106 109 self.txtDtype.setReadOnly(False)
@@ -111,3 +114,35
111 114 Se activa cuando el tipo de archivo es ingresado manualmente
112 115 """
113 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 154 <widget class="QLineEdit" name="txtElabel"/>
155 155 </item>
156 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 162 </item>
159 163 </layout>
160 164 </item>
@@ -2,7 +2,7
2 2
3 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 10:36:51 2010
5 # Created: Mon Apr 26 11:25:08 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!
@@ -480,6 +480,7
480 480 self.chkMST.setText(QtGui.QApplication.translate("MainWindow", "MST-ISR Data", None, QtGui.QApplication.UnicodeUTF8))
481 481 self.lblElabel.setText(QtGui.QApplication.translate("MainWindow", "Exp. Label at device", None, QtGui.QApplication.UnicodeUTF8))
482 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 484 self.lblStartDay.setText(QtGui.QApplication.translate("MainWindow", "Start Day:", None, QtGui.QApplication.UnicodeUTF8))
484 485 self.lblStopDay.setText(QtGui.QApplication.translate("MainWindow", "Stop Day:", None, QtGui.QApplication.UnicodeUTF8))
485 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