##// END OF EJS Templates
redefiniendo parte grabacion
ralonso -
r56:57
parent child
Show More
@@ -130,12 +130,8
130 130 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w")
131 131 #Se añade la lista de archivos a grabar en el DVD al archivo .dat
132 132 for line in var_files_list_2:
133 var_tmp_path=(line.split(self.var_Dpath)[1]).split('/')
134 var_tmp_path2="/"
135 for l in range(0, len(var_tmp_path)-1):
136 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
137 var_file.write(var_tmp_path2+'=')
138 var_file.write(line+'\n')
133 var_tmp_path=line.split(self.var_Dpath)[1][:-13]
134 var_file.write(var_tmp_path+'='+line+'\n')
139 135 var_file.close()
140 136
141 137 var_tmp = var_size_i #Se asigna a la variable el tamaño del archivo actual
@@ -147,14 +143,10
147 143 var_file = open(var_Rpath_ppath+"/"+self.var_Elabel+"_"+i2s(var_n)+".dat","w")
148 144 #Se añade la lista de archivos a grabar en el DVD al archivo .dat
149 145 for line in var_files_list_2:
150 var_tmp_path=(line.split(self.var_Dpath)[1]).split('/')
151 var_tmp_path2="/"
152 for l in range(0, len(var_tmp_path)-1):
153 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
154 var_file.write(var_tmp_path2+'=')
155 var_file.write(line+'\n')
146 var_tmp_path=line.split(self.var_Dpath)[1][:-13]
147 var_file.write(var_tmp_path+'='+line+'\n')
156 148 var_file.close()
157
149
158 150 return var_n
159 151
160 152
@@ -190,7 +182,7
190 182 if var_first_folder == '/':
191 183 var_folder = self.var_Elabel
192 184 else:
193 var_folder = var_first_folder.split('/')[1]
185 var_folder = var_first_folder.split('/')[-2]
194 186
195 187 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
196 188 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
@@ -205,7 +197,7
205 197 if var_first_folder == '/':
206 198 var_folder = self.txtElabel.text()
207 199 else:
208 var_folder = var_first_folder.split('/')[1]
200 var_folder = var_first_folder.split('/')[-2]
209 201
210 202 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
211 203 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
@@ -6,19 +6,7
6 6 import os
7 7 import subprocess
8 8 import commands
9
10
11 def set_parameters(self):
12 """
13 Se usa para inicializar ciertos parametros para pruebas
14 """
15 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS')
16 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager')
17 self.txtElabel.setText('EW_DRIFTS_pruebas')
18 self.lstDcapacity.setCurrentIndex(4)
19 self.txtDcapacity.setValue(250.0)
20 self.txtDcapacity.setReadOnly(False)
21
9
22 10
23 11 def detect_devices(self):
24 12 """
@@ -60,18 +48,20
60 48 self.chkDevD.setChecked(False)
61 49 self.chkDevD.setEnabled(False)
62 50
63 def enabled_items1(var_bool, self):
64 self.tabParameters.setEnabled(not(var_bool))
65 self.lstDcapacity.setEnabled(not(var_bool))
66 self.txtDcapacity.setEnabled(not(var_bool))
67 self.btnGbkp.setEnabled(not(var_bool))
68 self.btnRestart.setEnabled(var_bool)
69 self.btnStartburn.setEnabled(var_bool)
51 def set_parameters_test(self):
52 """
53 Se usa para inicializar ciertos parametros para pruebas
54 """
55 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS')
56 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager')
57 self.txtElabel.setText('EW_DRIFTS_pruebas')
58 self.lstDcapacity.setCurrentIndex(4)
59 self.txtDcapacity.setValue(250.0)
60 self.txtDcapacity.setReadOnly(False)
70 61
71 62
72 63 def make_parameters_conf(self):
73 64 var_file = open("parameters.conf","w")
74
75 65 var_file.write(self.var_Dpath+"\n") #0
76 66 var_file.write(self.var_Rpath+"\n") #1
77 67 var_file.write(str(self.var_lstDtype)+"\n") #2
@@ -80,14 +70,13
80 70 var_file.write(str(self.var_Copys)+"\n") #5
81 71 var_file.write(str(self.var_lstDcapacity)+"\n") #6
82 72 var_file.write(str(self.var_Dcapacity)+"\n") #7
83
73 var_file.write(str(self.var_n_discs)) #8
84 74 var_file.close()
85 75
86 76
87 77 def get_parameters_conf(self):
88 78 var_file = open("parameters.conf","r")
89 79 lines = var_file.readlines()
90
91 80 self.txtDpath.setText(lines[0][:-1]) #0
92 81 self.txtRpath.setText(lines[1][:-1]) #1
93 82 self.lstDtype.setCurrentIndex(int(lines[2])) #2
@@ -95,17 +84,32
95 84 self.txtElabel.setText(lines[4][:-1]) #4
96 85 self.txtCopys.setValue(int(lines[5][:-1])) #5
97 86 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6
98 self.txtDcapacity.setValue(float(lines[7]))
99
87 self.txtDcapacity.setValue(float(lines[7])) #7
88 self.var_n_discs = int(lines[8]) # 8
100 89 var_file.close()
101 90
91
102 92 def set_vars(self):
103 self.var_Dpath = self.txtDpath.text()
104 self.var_Rpath = self.txtRpath.text()
105 self.var_lstDtype = self.lstDtype.currentIndex()
106 self.var_Dtype = self.txtDtype.text()
107 self.var_Elabel = self.txtElabel.text()
108 self.var_Copys = self.txtCopys.value()
109 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
110 self.var_Dcapacity = self.txtDcapacity.value()
111
93 self.var_Dpath = self.txtDpath.text() #0
94 self.var_Rpath = self.txtRpath.text() #1
95 self.var_lstDtype = self.lstDtype.currentIndex() #2
96 self.var_Dtype = self.txtDtype.text() #3
97 self.var_Elabel = self.txtElabel.text() #4
98 self.var_Copys = self.txtCopys.value() #5
99 self.var_lstDcapacity = self.lstDcapacity.currentIndex() #6
100 self.var_Dcapacity = self.txtDcapacity.value() #7
101
102
103 def enabled_items1(var_bool, self):
104 self.tabParameters.setEnabled(not(var_bool))
105 self.lstDcapacity.setEnabled(not(var_bool))
106 self.txtDcapacity.setEnabled(not(var_bool))
107 self.btnGbkp.setEnabled(not(var_bool))
108 self.btnRestart.setEnabled(var_bool)
109 self.btnStartburn.setEnabled(var_bool)
110
111
112 def enabled_items2(var_bool, self):
113 self.btnRestart.setEnabled(not(var_bool))
114 self.btnStartburn.setEnabled(not(var_bool))
115 self.btnStopburn.setEnabled(var_bool)
@@ -12,7 +12,7
12 12 from subprocess import *
13 13 import sys
14 14 import os
15 import subprocess
15 #import subprocess
16 16 import commands
17 17 from functions import functions
18 18 from functions import functions2
@@ -32,23 +32,23
32 32
33 33 functions2.detect_devices(self) #busca los dispositivos de grabacion
34 34
35 self.var_n_discs=0
36 self.var_list=[]
37 self.var_sublist=[]
38
35 39 #Revisa si existe el archivo de confirguracion
36 40 if os.path.isfile("parameters.conf"):
37 41 self.txtInfo.append("Archivo de configuracion encontrado")
38 42 functions2.get_parameters_conf(self)
43 self.txtInfo.append("El proyecto creara "+str(self.var_n_discs)+" DVDs")
39 44 else:
40 45 self.txtInfo.append("Elija los parametros de configuracion")
41 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas
46 functions2.set_parameters_test(self) #Establece ciertos parametros, para pruebas
42 47
43 48 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
44 49
45 50 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
46 51 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
47
48 self.var_n_discs=0
49 self.var_list=[]
50 self.var_sublist=[]
51
52 52 functions.load_days(self)
53 53
54 54 self.var_process = QtCore.QProcess()
@@ -56,21 +56,22
56 56 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError)
57 57 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished)
58 58
59
60 def write(self, txt):
61 self.txtInfo.append(str(txt))
62
63
64 #----------------------------------------------------- Funciones del proceso ---------------------------------------------------------------
65
59 66 def readOuput(self):
60 67 self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
61 68
62
63 69 def readError(self):
64 70 self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
65 71
66
67 72 def finished(self):
68 self.txtInfo.append("proceso terminado finished()")
69 print self.var_process.exitCode()
70
71
72 def write(self, txt):
73 self.txtInfo.append(str(txt))
73 self.txtInfo.append("proceso terminado finished() "+QtCore.QString(self.var_process.exitCode()))
74
74 75
75 76 #----------------------------------------------------- Obtencion de las ruta de los datos ---------------------------------------------------------------
76 77
@@ -268,14 +269,14
268 269 """
269 270 Se inicia el proceso de grabacion
270 271 """
271 self.btnRestart.setEnabled(False)
272 self.btnStartburn.setEnabled(False)
273 self.btnStopburn.setEnabled(True)
272 functions2.enabled_items2(True, self)
274 273
275 274 sys.stdout = self
276 275 #sys.stderr = self
277 276 print "stdout_!!!"
278 277
278
279
279 280 #Inicializando variables
280 281 var_Rpath_ppath=self.var_Rpath+"/ppath"
281 282 var_Rpath_iso=self.var_Rpath+"/iso"
@@ -288,9 +289,7
288 289 var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel
289 290 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
290 291
291 # self.process.start(var_cmd)
292 292 self.var_process.start(var_cmd)
293 # self.var_process.waitForFinished()
294 293 self.txtInfo.append("ejecutandose")
295 294
296 295
@@ -305,13 +304,6
305 304 # var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
306 305 # self.txtInfo.append(var_cmd)
307 306 #
308 # var_output=commands.getstatusoutput(str(var_cmd))[0]
309 # self.txtInfo.append(str(var_output))
310
311 #os.system(str(var_cmd))
312 #p = subprocess.Popen(str('ls /'), shell=True, stdout=self)
313 #os.waitpid(p.pid, 0)
314 ####self.txtInfo.append(str(p.pid))
315 307
316 308
317 309 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
@@ -321,10 +313,8
321 313 """
322 314 Slot documentation goes here.
323 315 """
324 self.var_process.terminate()
325 self.btnRestart.setEnabled(True)
326 self.btnStartburn.setEnabled(True)
327 self.btnStopburn.setEnabled(False)
316 self.var_process.terminate() #Termina el proceso, si puede
317 functions2.enabled_items2(False, self)
328 318
329 319
330 320 #----------------------------------------------------- Testeo de las unidades de grabacion ---------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now