@@ -1,421 +1,421 | |||
|
1 | 1 | # -*- coding: utf-8 -*- No newline at end of file |
|
2 | 2 | No newline at end of file |
|
3 | 3 | """ No newline at end of file |
|
4 | 4 | Module implementing MainWindow. No newline at end of file |
|
5 | 5 | """ No newline at end of file |
|
6 | 6 | No newline at end of file |
|
7 | 7 | from PyQt4.QtGui import QMainWindow No newline at end of file |
|
8 | 8 | from PyQt4.QtCore import pyqtSignature No newline at end of file |
|
9 | 9 | from Ui_MainWindow import Ui_MainWindow No newline at end of file |
|
10 | 10 | from PyQt4 import QtGui No newline at end of file |
|
11 | 11 | from subprocess import * No newline at end of file |
|
12 | 12 | import sys No newline at end of file |
|
13 | 13 | import os No newline at end of file |
|
14 | 14 | import subprocess No newline at end of file |
|
15 | 15 | import commands No newline at end of file |
|
16 | 16 | No newline at end of file |
|
17 | 17 | class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file |
|
18 | 18 | """ No newline at end of file |
|
19 | 19 | Class documentation goes here. No newline at end of file |
|
20 | 20 | """ No newline at end of file |
|
21 | 21 | No newline at end of file |
|
22 | 22 | def __init__(self, parent = None): No newline at end of file |
|
23 | 23 | QMainWindow.__init__(self, parent) No newline at end of file |
|
24 | 24 | self.setupUi(self) No newline at end of file |
|
25 | 25 | self.setupUi2() No newline at end of file |
|
26 | 26 | No newline at end of file |
|
27 | 27 | #redirige salida estandar No newline at end of file |
|
28 | 28 | sys.stdout = self No newline at end of file |
|
29 | 29 | No newline at end of file |
|
30 | 30 | No newline at end of file |
|
31 | 31 | def setupUi2(self): No newline at end of file |
|
32 | 32 | """ No newline at end of file |
|
33 | 33 | Se usa para inicializar ciertos parametros para pruebas No newline at end of file |
|
34 | 34 | """ No newline at end of file |
|
35 | 35 | self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS') No newline at end of file |
|
36 | 36 | self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba2_jro_backup_manager') No newline at end of file |
|
37 | 37 | self.txtElabel.setText('EW_DRIFTS') No newline at end of file |
|
38 | 38 | self.statusDpath = False No newline at end of file |
|
39 | 39 | self.statusRpath = False No newline at end of file |
|
40 | 40 | No newline at end of file |
|
41 | 41 | No newline at end of file |
|
42 | 42 | #Deteccion de los dispositvos de grabacion No newline at end of file |
|
43 | 43 | No newline at end of file |
|
44 | 44 | #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ? No newline at end of file |
|
45 | 45 | var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'" No newline at end of file |
|
46 | 46 | var_output = commands.getstatusoutput(var_cmd) No newline at end of file |
|
47 | 47 | if var_output[0] != 0: No newline at end of file |
|
48 | 48 | self.txtInfo.setText("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output)) No newline at end of file |
|
49 | 49 | else: No newline at end of file |
|
50 | 50 | self.txtInfo.append("dispositivos encontrados") No newline at end of file |
|
51 | 51 | var_devices = var_output[1].split('\n') No newline at end of file |
|
52 | 52 | No newline at end of file |
|
53 | 53 | var_tmp=[] No newline at end of file |
|
54 | 54 | for i in range(0, 4): No newline at end of file |
|
55 | 55 | if i < len(var_devices): No newline at end of file |
|
56 | 56 | var_len = len(var_devices[i]) No newline at end of file |
|
57 | 57 | var_tmp.append(var_devices[i][1:var_len - 1]) No newline at end of file |
|
58 | 58 | else: No newline at end of file |
|
59 | 59 | var_tmp.append('') No newline at end of file |
|
60 | 60 | No newline at end of file |
|
61 | 61 | #Se escriben los dispostivos correspodientes, si existen No newline at end of file |
|
62 | 62 | self.txtDeviceA.setText(str(var_tmp[0])) No newline at end of file |
|
63 | 63 | self.txtDeviceB.setText(str(var_tmp[1])) No newline at end of file |
|
64 | 64 | self.txtDeviceC.setText(str(var_tmp[2])) No newline at end of file |
|
65 | 65 | self.txtDeviceD.setText(str(var_tmp[3])) No newline at end of file |
|
66 | 66 | #Se desactivan los que no existen No newline at end of file |
|
67 | 67 | if len(var_tmp[0]) == 0 : No newline at end of file |
|
68 | 68 | self.chkDevA.setChecked(False) No newline at end of file |
|
69 | 69 | self.chkDevA.setEnabled(False) No newline at end of file |
|
70 | 70 | if len(var_tmp[1]) == 0 : No newline at end of file |
|
71 | 71 | self.chkDevB.setChecked(False) No newline at end of file |
|
72 | 72 | self.chkDevB.setEnabled(False) No newline at end of file |
|
73 | 73 | if len(var_tmp[2]) == 0 : No newline at end of file |
|
74 | 74 | self.chkDevC.setChecked(False) No newline at end of file |
|
75 | 75 | self.chkDevC.setEnabled(False) No newline at end of file |
|
76 | 76 | if len(var_tmp[3]) == 0 : No newline at end of file |
|
77 | 77 | self.chkDevD.setChecked(False) No newline at end of file |
|
78 | 78 | self.chkDevD.setEnabled(False) No newline at end of file |
|
79 | 79 | No newline at end of file |
|
80 | 80 | No newline at end of file |
|
81 | 81 | def write(self, txt): No newline at end of file |
|
82 | 82 | """ No newline at end of file |
|
83 | 83 | Escribe la salida estandar eb txtInfo No newline at end of file |
|
84 | 84 | """ No newline at end of file |
|
85 | 85 | self.txtInfo.append(str(txt)) No newline at end of file |
|
86 | 86 | No newline at end of file |
|
87 | 87 | No newline at end of file |
|
88 | 88 | @pyqtSignature("") No newline at end of file |
|
89 | 89 | def on_btnDpath_clicked(self): No newline at end of file |
|
90 | 90 | """ No newline at end of file |
|
91 | 91 | Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file |
|
92 | 92 | """ No newline at end of file |
|
93 | 93 | var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) No newline at end of file |
|
94 | 94 | self.txtDpath.setText(var_Dpath) No newline at end of file |
|
95 | 95 | No newline at end of file |
|
96 | 96 | #llamada a funcion No newline at end of file |
|
97 | 97 | self.on_txtDpath_editingFinished() No newline at end of file |
|
98 | 98 | No newline at end of file |
|
99 | 99 | No newline at end of file |
|
100 | 100 | @pyqtSignature("") No newline at end of file |
|
101 | 101 | def on_btnRpath_clicked(self): No newline at end of file |
|
102 | 102 | """ No newline at end of file |
|
103 | 103 | Permite seleccionar graficamente el direcorio del proyecto No newline at end of file |
|
104 | 104 | """ No newline at end of file |
|
105 | 105 | var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) No newline at end of file |
|
106 | 106 | self.txtRpath.setText(var_Rpath) No newline at end of file |
|
107 | 107 | No newline at end of file |
|
108 | 108 | #llamada a funcion No newline at end of file |
|
109 | 109 | self.on_txtRpath_editingFinished() No newline at end of file |
|
110 | 110 | No newline at end of file |
|
111 | 111 | No newline at end of file |
|
112 | 112 | @pyqtSignature("") No newline at end of file |
|
113 | 113 | def on_txtDpath_editingFinished(self): No newline at end of file |
|
114 | 114 | """ No newline at end of file |
|
115 | 115 | Permite buscar los archivos de extension seleccionada en la ruta de de datos No newline at end of file |
|
116 | 116 | y cargar los valores para el rango de tiempo a ser grabado No newline at end of file |
|
117 | 117 | """ No newline at end of file |
|
118 | 118 | No newline at end of file |
|
119 | 119 | #Usando el modulo "subprocess", eric4 pide seleccion del tipo de subproceso (padre o hijo) No newline at end of file |
|
120 | 120 | #por ello se prefiere usar el modulo "commands" No newline at end of file |
|
121 | 121 | #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE) No newline at end of file |
|
122 | 122 | #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE) No newline at end of file |
|
123 | 123 | #output_p2= p2.communicate()[0] No newline at end of file |
|
124 | 124 | #self.txtInfo.setText(output_p2) No newline at end of file |
|
125 | 125 | No newline at end of file |
|
126 | 126 | #Se carga la variable con la ruta de datos No newline at end of file |
|
127 | 127 | var_Dpath=self.txtDpath.text() No newline at end of file |
|
128 | 128 | No newline at end of file |
|
129 | 129 | #Se verifica que la ruta exista y sea un directorio No newline at end of file |
|
130 | 130 | var_cmd="test -d "+str(var_Dpath) No newline at end of file |
|
131 | 131 | var_output=commands.getstatusoutput(var_cmd)[0] No newline at end of file |
|
132 | 132 | if var_output != 0: No newline at end of file |
|
133 | 133 | self.statusDpath = False No newline at end of file |
|
134 | 134 | self.txtInfo.setText("Ruta no valida, output_error:" + str(var_output)) No newline at end of file |
|
135 | 135 | return No newline at end of file |
|
136 | 136 | else: No newline at end of file |
|
137 | 137 | self.statusDpath = True No newline at end of file |
|
138 | 138 | self.txtInfo.append("Ruta valida, sin error:" + str(var_Dpath)) No newline at end of file |
|
139 | 139 | No newline at end of file |
|
140 | 140 | #Se buscan los archivos del tipo especificado No newline at end of file |
|
141 | 141 | var_Dtype=self.txtDtype.text() No newline at end of file |
|
142 | 142 | var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq" No newline at end of file |
|
143 | 143 | output_p2=commands.getstatusoutput(var_cmd)[1] No newline at end of file |
|
144 | 144 | No newline at end of file |
|
145 | 145 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) No newline at end of file |
|
146 | 146 | self.var_list=[] No newline at end of file |
|
147 | 147 | for i in range(0, (len(output_p2)+1)/8): No newline at end of file |
|
148 | 148 | self.var_list.append(output_p2[8*i:8*(i+1)-1]) No newline at end of file |
|
149 | 149 | No newline at end of file |
|
150 | 150 | self.lstStartDay.clear() No newline at end of file |
|
151 | 151 | self.lstStopDay.clear() No newline at end of file |
|
152 | 152 | No newline at end of file |
|
153 | 153 | for i in self.var_list: No newline at end of file |
|
154 | 154 | self.lstStartDay.addItem(i) No newline at end of file |
|
155 | 155 | self.lstStopDay.addItem(i) No newline at end of file |
|
156 | 156 | No newline at end of file |
|
157 | 157 | self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) No newline at end of file |
|
158 | 158 | No newline at end of file |
|
159 | 159 | No newline at end of file |
|
160 | 160 | @pyqtSignature("") No newline at end of file |
|
161 | 161 | def on_txtRpath_editingFinished(self): No newline at end of file |
|
162 | 162 | """ No newline at end of file |
|
163 | 163 | Valida la ruta del proyecto No newline at end of file |
|
164 | 164 | """ No newline at end of file |
|
165 | 165 | #Se carga la variable con la ruta del proyecto No newline at end of file |
|
166 | 166 | var_Rpath=self.txtRpath.text() No newline at end of file |
|
167 | 167 | No newline at end of file |
|
168 | 168 | #Se verifica que la ruta exista y sea un directorio No newline at end of file |
|
169 | 169 | var_cmd="test -d "+str(var_Rpath) No newline at end of file |
|
170 | 170 | var_output=commands.getstatusoutput(var_cmd)[0] No newline at end of file |
|
171 | 171 | if var_output != 0: No newline at end of file |
|
172 | 172 | self.statusRpath = False No newline at end of file |
|
173 | 173 | self.txtInfo.append("Ruta no valida, output_error:" + str(var_output)) No newline at end of file |
|
174 | 174 | return No newline at end of file |
|
175 | 175 | else: No newline at end of file |
|
176 | 176 | self.statusRpath = True No newline at end of file |
|
177 | 177 | self.txtInfo.append("Ruta valida, sin error:" + str(var_Rpath)) No newline at end of file |
|
178 | 178 | No newline at end of file |
|
179 | 179 | No newline at end of file |
|
180 | 180 | @pyqtSignature("int") No newline at end of file |
|
181 | 181 | def on_lstDtype_activated(self, index): No newline at end of file |
|
182 | 182 | """ No newline at end of file |
|
183 | 183 | Permite elegir entre los tipos de archivos No newline at end of file |
|
184 | 184 | """ No newline at end of file |
|
185 | 185 | if index == 0: No newline at end of file |
|
186 | 186 | var_type='r' No newline at end of file |
|
187 | 187 | elif index == 1: No newline at end of file |
|
188 | 188 | var_type='pdata' No newline at end of file |
|
189 | 189 | elif index == 2: No newline at end of file |
|
190 | 190 | var_type='sswma' No newline at end of file |
|
191 | 191 | No newline at end of file |
|
192 | 192 | if index != 3: No newline at end of file |
|
193 | 193 | self.txtDtype.setText(var_type) No newline at end of file |
|
194 | 194 | self.txtDtype.setReadOnly(True) No newline at end of file |
|
195 | 195 | self.on_txtDpath_editingFinished() No newline at end of file |
|
196 | 196 | else: No newline at end of file |
|
197 | 197 | self.txtDtype.setText('') No newline at end of file |
|
198 | 198 | self.txtDtype.setReadOnly(False) No newline at end of file |
|
199 | 199 | No newline at end of file |
|
200 | 200 | No newline at end of file |
|
201 | 201 | @pyqtSignature("") No newline at end of file |
|
202 | 202 | def on_txtDtype_editingFinished(self): No newline at end of file |
|
203 | 203 | """ No newline at end of file |
|
204 | 204 | Se activa cuando el tipo de archivo es ingresado manualmente No newline at end of file |
|
205 | 205 | """ No newline at end of file |
|
206 | 206 | #llamada a funcion No newline at end of file |
|
207 | 207 | self.on_txtDpath_editingFinished() No newline at end of file |
|
208 | 208 | No newline at end of file |
|
209 | 209 | No newline at end of file |
|
210 | 210 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
211 | 211 | def on_lstStartDay_activated(self, index): No newline at end of file |
|
212 | 212 | """ No newline at end of file |
|
213 | 213 | Cambia la lista de opciones en lstStopDay No newline at end of file |
|
214 | 214 | """ No newline at end of file |
|
215 | 215 | var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file |
|
216 | 216 | self.lstStopDay.clear() No newline at end of file |
|
217 | 217 | No newline at end of file |
|
218 | 218 | for i in self.var_list[index:]: No newline at end of file |
|
219 | 219 | self.lstStopDay.addItem(i) No newline at end of file |
|
220 | 220 | No newline at end of file |
|
221 | 221 | self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file |
|
222 | 222 | No newline at end of file |
|
223 | 223 | No newline at end of file |
|
224 | 224 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
225 | 225 | def on_lstStopDay_activated(self, index): No newline at end of file |
|
226 | 226 | """ No newline at end of file |
|
227 | 227 | Cambia la lista de opciones en lstStartDay No newline at end of file |
|
228 | 228 | """ No newline at end of file |
|
229 | 229 | var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file |
|
230 | 230 | var_end_index = self.lstStopDay.count() - index No newline at end of file |
|
231 | 231 | self.lstStartDay.clear() No newline at end of file |
|
232 | 232 | No newline at end of file |
|
233 | 233 | for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file |
|
234 | 234 | self.lstStartDay.addItem(i) No newline at end of file |
|
235 | 235 | No newline at end of file |
|
236 | 236 | self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file |
|
237 | 237 | No newline at end of file |
|
238 | 238 | No newline at end of file |
|
239 | 239 | @pyqtSignature("int") #CLOSED No newline at end of file |
|
240 | 240 | def on_lstDcapacity_activated(self, index): No newline at end of file |
|
241 | 241 | """ No newline at end of file |
|
242 | 242 | Permite elegir el tamaΓ±o del disco No newline at end of file |
|
243 | 243 | """ No newline at end of file |
|
244 | 244 | if index == 0: No newline at end of file |
|
245 | 245 | var_size=25.0 No newline at end of file |
|
246 | 246 | elif index == 1: No newline at end of file |
|
247 | 247 | var_size=8.5 No newline at end of file |
|
248 | 248 | elif index == 2: No newline at end of file |
|
249 | 249 | var_size=4.7 No newline at end of file |
|
250 | 250 | elif index == 3: No newline at end of file |
|
251 | 251 | var_size=0.7 No newline at end of file |
|
252 | 252 | No newline at end of file |
|
253 | 253 | if index != 4: No newline at end of file |
|
254 | 254 | self.txtDcapacity.setText(str(var_size*10**9/1024**2)) No newline at end of file |
|
255 | 255 | self.txtDcapacity.setReadOnly(True) No newline at end of file |
|
256 | 256 | else: No newline at end of file |
|
257 | 257 | self.txtDcapacity.setText('') No newline at end of file |
|
258 | 258 | self.txtDcapacity.setReadOnly(False) No newline at end of file |
|
259 | 259 | No newline at end of file |
|
260 | 260 | No newline at end of file |
|
261 | 261 | @pyqtSignature("") No newline at end of file |
|
262 | 262 | def on_btnGbkp_clicked(self): No newline at end of file |
|
263 | 263 | """ No newline at end of file |
|
264 | 264 | Cuando se presiona el boton btnGbkp No newline at end of file |
|
265 | 265 | """ No newline at end of file |
|
266 | 266 | No newline at end of file |
|
267 | 267 | #Verifica que las rutas sean validas No newline at end of file |
|
268 | 268 | if self.statusDpath == False or self.statusRpath == False: No newline at end of file |
|
269 | 269 | if self.statusDpath == False: No newline at end of file |
|
270 | 270 | self.txtInfo.append("Ruta de datos no valida") No newline at end of file |
|
271 | 271 | if self.statusRpath == False: No newline at end of file |
|
272 | 272 | self.txtInfo.append("Ruta de proyecto no valida") No newline at end of file |
|
273 | 273 | return No newline at end of file |
|
274 | 274 | No newline at end of file |
|
275 | 275 | #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file |
|
276 | 276 | var_Rpath=self.txtRpath.text() No newline at end of file |
|
277 | 277 | var_dirs='/{gpath,iso,ppath}' No newline at end of file |
|
278 | 278 | var_cmd="mkdir -p "+str(var_Rpath)+str(var_dirs) No newline at end of file |
|
279 | 279 | var_output=commands.getstatusoutput(var_cmd)[0] No newline at end of file |
|
280 | 280 | if var_output != 0: No newline at end of file |
|
281 | 281 | self.txtInfo.append("No se pudieron crear los directorios, output_error:" + str(var_output)) No newline at end of file |
|
282 | 282 | return No newline at end of file |
|
283 | 283 | else: No newline at end of file |
|
284 | 284 | self.txtInfo.append('Carpetas creadas correctamente') No newline at end of file |
|
285 | 285 | No newline at end of file |
|
286 | 286 | #Cargando variables con los parametros No newline at end of file |
|
287 | 287 | var_Dpath=self.txtDpath.text() No newline at end of file |
|
288 | 288 | var_Rpath=self.txtRpath.text() No newline at end of file |
|
289 | 289 | var_Rpath_ppath=var_Rpath+"/ppath" #Ruta de los archivos a grabar No newline at end of file |
|
290 | 290 | var_sublist=[] No newline at end of file |
|
291 | 291 | for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]: No newline at end of file |
|
292 | 292 | var_sublist.append(i) No newline at end of file |
|
293 | 293 | if len(var_sublist) == 0: No newline at end of file |
|
294 | 294 | self.txtInfo.append("No existen archivos encontrados") No newline at end of file |
|
295 | 295 | return No newline at end of file |
|
296 | 296 | #self.txtInfo.append('elementos: '+str(len(var_sublist))) No newline at end of file |
|
297 | 297 | No newline at end of file |
|
298 | 298 | No newline at end of file |
|
299 | 299 | var_Dtype=self.txtDtype.text() No newline at end of file |
|
300 | 300 | var_Dcapacity=float(self.txtDcapacity.text())*1024 #tamaΓ±o en KB No newline at end of file |
|
301 | 301 | No newline at end of file |
|
302 | 302 | #Busca los archivos con los parametros de busqueda No newline at end of file |
|
303 | 303 | var_files_list=[] No newline at end of file |
|
304 | 304 | for var_doy in var_sublist: |
|
305 | No newline at end of file | |
|
305 | var_cmd="find " + str(var_Dpath) + " -name ?"+var_doy+"???."+ str(var_Dtype) No newline at end of file | |
|
306 | 306 | var_output=commands.getstatusoutput(var_cmd)[1] No newline at end of file |
|
307 | 307 | for var_file in var_output.split(): No newline at end of file |
|
308 | 308 | var_files_list.append(var_file) #Almacena cada archivo en la lista No newline at end of file |
|
309 | 309 | No newline at end of file |
|
310 | 310 | # No newline at end of file |
|
311 | 311 | #Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD No newline at end of file |
|
312 | 312 | # No newline at end of file |
|
313 | 313 | var_n=0 #Se usa para contar el numero de archivos a grabar en el DVD No newline at end of file |
|
314 | 314 | # var_n_files=0 No newline at end of file |
|
315 | 315 | var_tmp=0 # No newline at end of file |
|
316 | 316 | var_files_list_2=[] No newline at end of file |
|
317 | 317 | No newline at end of file |
|
318 | 318 | for i in var_files_list: #Se asignan en i los archivos de la lista No newline at end of file |
|
319 | 319 | var_size_i=os.path.getsize(i)/1024+1 #tamaΓ±o en KB del archivo de la lista, se suma 1 KB para evitar problemas al momento de sumar No newline at end of file |
|
320 | 320 | var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista No newline at end of file |
|
321 | 321 | No newline at end of file |
|
322 | 322 | #Si el tamaΓ±o acumulado es mayor que el de el DVD No newline at end of file |
|
323 | 323 | if var_tmp > var_Dcapacity: No newline at end of file |
|
324 | 324 | var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real No newline at end of file |
|
325 | 325 | #se crea un archivo con numeral en el sufijo y extension .dat No newline at end of file |
|
326 | 326 | var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n)+".dat","w") No newline at end of file |
|
327 | 327 | #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat No newline at end of file |
|
328 | 328 | for line in var_files_list_2: No newline at end of file |
|
329 | 329 | var_file.write(line.split(var_Dpath)[1]+'=') No newline at end of file |
|
330 | 330 | var_file.write(line+'\n') No newline at end of file |
|
331 | 331 | var_file.close() No newline at end of file |
|
332 | 332 | No newline at end of file |
|
333 | 333 | # var_n_files += len(var_files_list_2) No newline at end of file |
|
334 | 334 | var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual No newline at end of file |
|
335 | 335 | var_files_list_2=[] No newline at end of file |
|
336 | 336 | var_files_list_2.append(i) No newline at end of file |
|
337 | 337 | var_n += 1 No newline at end of file |
|
338 | 338 | No newline at end of file |
|
339 | 339 | else: No newline at end of file |
|
340 | 340 | var_files_list_2.append(i) No newline at end of file |
|
341 | 341 | No newline at end of file |
|
342 | 342 | #muestra info No newline at end of file |
|
343 | 343 | self.txtInfo.append(str(len(var_files_list_2))+" size:"+str(var_tmp)) No newline at end of file |
|
344 | 344 | No newline at end of file |
|
345 | 345 | var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n)+".dat","w") No newline at end of file |
|
346 | 346 | for line in var_files_list_2: No newline at end of file |
|
347 | 347 | var_file.write(line.split(var_Dpath)[1]+'=') No newline at end of file |
|
348 | 348 | var_file.write(line+'\n') No newline at end of file |
|
349 | 349 | var_file.close() No newline at end of file |
|
350 | 350 | No newline at end of file |
|
351 | 351 | # var_n_files += len(var_files_list_2) No newline at end of file |
|
352 | 352 | No newline at end of file |
|
353 | 353 | #Se deshabilita el Tab Parameters y el boton btnGbkp No newline at end of file |
|
354 | 354 | self.tabParameters.setEnabled(False) No newline at end of file |
|
355 | 355 | self.btnGbkp.setEnabled(False) No newline at end of file |
|
356 | 356 | No newline at end of file |
|
357 | 357 | No newline at end of file |
|
358 | 358 | @pyqtSignature("") No newline at end of file |
|
359 | 359 | def on_btnStartburn_clicked(self): No newline at end of file |
|
360 | 360 | """ No newline at end of file |
|
361 | 361 | Slot documentation goes here. No newline at end of file |
|
362 | 362 | """ No newline at end of file |
|
363 | 363 | sys.stdout = self No newline at end of file |
|
364 | 364 | #sys.stderr = self No newline at end of file |
|
365 | 365 | print "stdout_!!!" No newline at end of file |
|
366 | 366 | var_Rpath=self.txtRpath.text() No newline at end of file |
|
367 | 367 | var_Rpath_ppath=var_Rpath+"/ppath" No newline at end of file |
|
368 | 368 | var_Rpath_iso=var_Rpath+"/iso" No newline at end of file |
|
369 | 369 | No newline at end of file |
|
370 | 370 | var_label=self.txtElabel.text() No newline at end of file |
|
371 | 371 | No newline at end of file |
|
372 | 372 | file_iso=var_Rpath_iso+'/2.iso' No newline at end of file |
|
373 | 373 | file_dat=var_Rpath_ppath+'/EW_DRIFTS_1.dat' No newline at end of file |
|
374 | 374 | No newline at end of file |
|
375 | 375 | var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' No newline at end of file |
|
376 | 376 | var_cmd += ' -A '+var_label+' -V '+var_label No newline at end of file |
|
377 | 377 | var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso No newline at end of file |
|
378 | 378 | self.txtInfo.append(var_cmd) No newline at end of file |
|
379 | 379 | No newline at end of file |
|
380 | 380 | #var_output=commands.getstatusoutput(str(var_cmd))[1] No newline at end of file |
|
381 | 381 | #self.txtInfo.append(var_output) No newline at end of file |
|
382 | 382 | No newline at end of file |
|
383 | 383 | #os.system(str(var_cmd)) No newline at end of file |
|
384 | 384 | #p = subprocess.Popen(str('ls /'), shell=True, stdout=self) No newline at end of file |
|
385 | 385 | #os.waitpid(p.pid, 0) No newline at end of file |
|
386 | 386 | ####self.txtInfo.append(str(p.pid)) No newline at end of file |
|
387 | 387 | No newline at end of file |
|
388 | 388 | #timer.time = 10 No newline at end of file |
|
389 | 389 | #timer.init() No newline at end of file |
|
390 | 390 | No newline at end of file |
|
391 | 391 | @pyqtSignature("") No newline at end of file |
|
392 | 392 | def on_btnRestart_clicked(self): No newline at end of file |
|
393 | 393 | """ No newline at end of file |
|
394 | 394 | Slot documentation goes here. No newline at end of file |
|
395 | 395 | """ No newline at end of file |
|
396 | 396 | self.tabParameters.setEnabled(True) No newline at end of file |
|
397 | 397 | self.btnGbkp.setEnabled(True) No newline at end of file |
|
398 | 398 | No newline at end of file |
|
399 | 399 | @pyqtSignature("") No newline at end of file |
|
400 | 400 | def on_btnTdevA_clicked(self): No newline at end of file |
|
401 | 401 | var_dev = str(self.txtDeviceA.text()) No newline at end of file |
|
402 | 402 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
403 | 403 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
404 | 404 | No newline at end of file |
|
405 | 405 | @pyqtSignature("") No newline at end of file |
|
406 | 406 | def on_btnTdevB_clicked(self): No newline at end of file |
|
407 | 407 | var_dev = str(self.txtDeviceB.text()) No newline at end of file |
|
408 | 408 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
409 | 409 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
410 | 410 | No newline at end of file |
|
411 | 411 | @pyqtSignature("") No newline at end of file |
|
412 | 412 | def on_btnTdevC_clicked(self): No newline at end of file |
|
413 | 413 | var_dev = str(self.txtDeviceC.text()) No newline at end of file |
|
414 | 414 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
415 | 415 | commands.getstatusoutput(var_cmd) No newline at end of file |
|
416 | 416 | No newline at end of file |
|
417 | 417 | @pyqtSignature("") No newline at end of file |
|
418 | 418 | def on_btnTdevD_clicked(self): No newline at end of file |
|
419 | 419 | var_dev = str(self.txtDeviceD.text()) No newline at end of file |
|
420 | 420 | var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file |
|
421 | 421 | commands.getstatusoutput(var_cmd) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now