##// END OF EJS Templates
OK_probado_con_/...
ralonso -
r53:54
parent child
Show More
@@ -32,14 +32,12
32
32
33 #Se verifica que la ruta exista y sea un directorio
33 #Se verifica que la ruta exista y sea un directorio
34 def dir_exists(var_dir, self):
34 def dir_exists(var_dir, self):
35 var_cmd="test -d "+str(var_dir)
35 if os.path.isdir(var_dir):
36 var_output=commands.getstatusoutput(var_cmd)[0]
37 if var_output != 0:
38 self.txtInfo.append("Ruta no valida, output_error:" + str(var_output))
39 return False
40 else:
41 self.txtInfo.append("Ruta valida, sin error:" + str(var_dir))
36 self.txtInfo.append("Ruta valida, sin error:" + str(var_dir))
42 return True
37 return True
38 else:
39 self.txtInfo.append("Ruta no valida, output_error:" + str(var_dir))
40 return False
43
41
44
42
45 #Se buscan los archivos del tipo especificado
43 #Se buscan los archivos del tipo especificado
@@ -12,13 +12,9
12 """
12 """
13 Se usa para inicializar ciertos parametros para pruebas
13 Se usa para inicializar ciertos parametros para pruebas
14 """
14 """
15 #self.txtDpath.setText('/home/ricardoar/optional/STORAGE/Data/RAW_EXP/JASMET/')
16 #self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba1_jro_backup_manager/')
17 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS/')
15 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS/')
18 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager/')
16 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager/')
19 self.txtElabel.setText('EW_DRIFTS')
17 self.txtElabel.setText('EW_DRIFTS_pruebas')
20 self.statusDpath = True
21 self.statusRpath = True
22 self.lstDcapacity.setCurrentIndex(4)
18 self.lstDcapacity.setCurrentIndex(4)
23 self.txtDcapacity.setValue(250.0)
19 self.txtDcapacity.setValue(250.0)
24 self.txtDcapacity.setReadOnly(False)
20 self.txtDcapacity.setReadOnly(False)
@@ -72,6 +68,7
72 self.btnRestart.setEnabled(var_bool)
68 self.btnRestart.setEnabled(var_bool)
73 self.btnStartburn.setEnabled(var_bool)
69 self.btnStartburn.setEnabled(var_bool)
74
70
71
75 def make_parameters_conf(self):
72 def make_parameters_conf(self):
76 var_file = open("parameters.conf","w")
73 var_file = open("parameters.conf","w")
77
74
@@ -102,3 +99,13
102
99
103 var_file.close()
100 var_file.close()
104
101
102 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
@@ -30,52 +30,44
30
30
31 def setupUi2(self):
31 def setupUi2(self):
32
32
33 #sys.stdout = self
33 functions2.detect_devices(self) #busca los dispositivos de grabacion
34
34
35 var_tmp = os.path.isfile("parameters.conf")
35 #Revisa si existe el archivo de confirguracion
36
36 if os.path.isfile("parameters.conf"):
37 if var_tmp == True:
38 self.txtInfo.append("Archivo de configuracion encontrado")
37 self.txtInfo.append("Archivo de configuracion encontrado")
39 functions2.get_parameters_conf(self)
38 functions2.get_parameters_conf(self)
40
41 else:
39 else:
42 self.txtInfo.append("Elija los parametros de configuracion")
40 self.txtInfo.append("Elija los parametros de configuracion")
43
41 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas
44 self.statusDpath = False
42
45 self.statusRpath = False
43 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
46
44
47 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas
45 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
48
46 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
49 self.var_Dpath = self.txtDpath.text()
50 self.var_Rpath = self.txtRpath.text()
51 self.var_lstDtype = self.lstDtype.currentIndex()
52 self.var_Dtype = self.txtDtype.text()
53 self.var_Elabel = self.txtElabel.text()
54 self.var_Copys = self.txtCopys.value()
55 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
56 self.var_Dcapacity = self.txtDcapacity.value()
57
47
58 self.var_n_discs=0
48 self.var_n_discs=0
59 self.var_list=[]
49 self.var_list=[]
60 self.var_sublist=[]
50 self.var_sublist=[]
61
51
62 functions2.detect_devices(self) #busca los dispositivos de grabacion
52 functions.load_days(self)
63 functions.load_days(self)
64
53
65 self.var_process = QtCore.QProcess()
54 self.var_process = QtCore.QProcess()
66 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput)
55 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput)
67 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError)
56 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError)
68 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished1)
57 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished)
69
58
70 def readOuput(self):
59 def readOuput(self):
71 self.txtSburn.append("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
60 self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
61
72
62
73 def readError(self):
63 def readError(self):
74 self.txtSburn.append("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
64 self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
75
65
76 def finished1(self):
66
67 def finished(self):
77 self.txtInfo.append("proceso terminado finished()")
68 self.txtInfo.append("proceso terminado finished()")
78 print self.var_process.exitCode()
69 print self.var_process.exitCode()
70
79
71
80 def write(self, txt):
72 def write(self, txt):
81 self.txtInfo.append(str(txt))
73 self.txtInfo.append(str(txt))
General Comments 0
You need to be logged in to leave comments. Login now