##// END OF EJS Templates
descripcion por bloques
ralonso -
r54:55
parent child
Show More
@@ -1,111 +1,111
1 # -*- coding: utf-8 -*- No newline at end of file
1 # -*- coding: utf-8 -*-
2 No newline at end of file
2
3 No newline at end of file
3
4 from subprocess import * No newline at end of file
4 from subprocess import *
5 import sys No newline at end of file
5 import sys
6 import os No newline at end of file
6 import os
7 import subprocess No newline at end of file
7 import subprocess
8 import commands No newline at end of file
8 import commands
9 No newline at end of file
9
10 No newline at end of file
10
11 def set_parameters(self): No newline at end of file
11 def set_parameters(self):
12 """ No newline at end of file
12 """
13 Se usa para inicializar ciertos parametros para pruebas No newline at end of file
13 Se usa para inicializar ciertos parametros para pruebas
14 """
14 """
No newline at end of file
15 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS')
15 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS/')
No newline at end of file
No newline at end of file
16 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager') No newline at end of file
16 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager/') No newline at end of file
17 self.txtElabel.setText('EW_DRIFTS_pruebas') No newline at end of file
17 self.txtElabel.setText('EW_DRIFTS_pruebas')
18 self.lstDcapacity.setCurrentIndex(4) No newline at end of file
18 self.lstDcapacity.setCurrentIndex(4)
19 self.txtDcapacity.setValue(250.0) No newline at end of file
19 self.txtDcapacity.setValue(250.0)
20 self.txtDcapacity.setReadOnly(False) No newline at end of file
20 self.txtDcapacity.setReadOnly(False)
21 No newline at end of file
21
22 No newline at end of file
22
23 def detect_devices(self): No newline at end of file
23 def detect_devices(self):
24 """ No newline at end of file
24 """
25 Deteccion de los dispositvos de grabacion No newline at end of file
25 Deteccion de los dispositvos de grabacion
26 """ No newline at end of file
26 """
27 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ? No newline at end of file
27 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ?
28 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'" No newline at end of file
28 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'"
29 var_output = commands.getstatusoutput(var_cmd) No newline at end of file
29 var_output = commands.getstatusoutput(var_cmd)
30 if var_output[0] != 0: No newline at end of file
30 if var_output[0] != 0:
31 self.txtInfo.append("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output)) No newline at end of file
31 self.txtInfo.append("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output))
32 else: No newline at end of file
32 else:
33 self.txtInfo.append("dispositivos encontrados") No newline at end of file
33 self.txtInfo.append("dispositivos encontrados")
34 var_devices = var_output[1].split('\n') No newline at end of file
34 var_devices = var_output[1].split('\n')
35 No newline at end of file
35
36 var_tmp=[] No newline at end of file
36 var_tmp=[]
37 for i in range(0, 4): No newline at end of file
37 for i in range(0, 4):
38 if i < len(var_devices): No newline at end of file
38 if i < len(var_devices):
39 var_len = len(var_devices[i]) No newline at end of file
39 var_len = len(var_devices[i])
40 var_tmp.append(var_devices[i][1:var_len - 1]) No newline at end of file
40 var_tmp.append(var_devices[i][1:var_len - 1])
41 else: No newline at end of file
41 else:
42 var_tmp.append('') No newline at end of file
42 var_tmp.append('')
43 No newline at end of file
43
44 #Se escriben los dispostivos correspodientes, si existen No newline at end of file
44 #Se escriben los dispostivos correspodientes, si existen
45 self.txtDeviceA.setText(str(var_tmp[0])) No newline at end of file
45 self.txtDeviceA.setText(str(var_tmp[0]))
46 self.txtDeviceB.setText(str(var_tmp[1])) No newline at end of file
46 self.txtDeviceB.setText(str(var_tmp[1]))
47 self.txtDeviceC.setText(str(var_tmp[2])) No newline at end of file
47 self.txtDeviceC.setText(str(var_tmp[2]))
48 self.txtDeviceD.setText(str(var_tmp[3])) No newline at end of file
48 self.txtDeviceD.setText(str(var_tmp[3]))
49 #Se desactivan los que no existen No newline at end of file
49 #Se desactivan los que no existen
50 if len(var_tmp[0]) == 0 : No newline at end of file
50 if len(var_tmp[0]) == 0 :
51 self.chkDevA.setChecked(False) No newline at end of file
51 self.chkDevA.setChecked(False)
52 self.chkDevA.setEnabled(False) No newline at end of file
52 self.chkDevA.setEnabled(False)
53 if len(var_tmp[1]) == 0 : No newline at end of file
53 if len(var_tmp[1]) == 0 :
54 self.chkDevB.setChecked(False) No newline at end of file
54 self.chkDevB.setChecked(False)
55 self.chkDevB.setEnabled(False) No newline at end of file
55 self.chkDevB.setEnabled(False)
56 if len(var_tmp[2]) == 0 : No newline at end of file
56 if len(var_tmp[2]) == 0 :
57 self.chkDevC.setChecked(False) No newline at end of file
57 self.chkDevC.setChecked(False)
58 self.chkDevC.setEnabled(False) No newline at end of file
58 self.chkDevC.setEnabled(False)
59 if len(var_tmp[3]) == 0 : No newline at end of file
59 if len(var_tmp[3]) == 0 :
60 self.chkDevD.setChecked(False) No newline at end of file
60 self.chkDevD.setChecked(False)
61 self.chkDevD.setEnabled(False) No newline at end of file
61 self.chkDevD.setEnabled(False)
62 No newline at end of file
62
63 def enabled_items1(var_bool, self): No newline at end of file
63 def enabled_items1(var_bool, self):
64 self.tabParameters.setEnabled(not(var_bool)) No newline at end of file
64 self.tabParameters.setEnabled(not(var_bool))
65 self.lstDcapacity.setEnabled(not(var_bool)) No newline at end of file
65 self.lstDcapacity.setEnabled(not(var_bool))
66 self.txtDcapacity.setEnabled(not(var_bool)) No newline at end of file
66 self.txtDcapacity.setEnabled(not(var_bool))
67 self.btnGbkp.setEnabled(not(var_bool)) No newline at end of file
67 self.btnGbkp.setEnabled(not(var_bool))
68 self.btnRestart.setEnabled(var_bool) No newline at end of file
68 self.btnRestart.setEnabled(var_bool)
69 self.btnStartburn.setEnabled(var_bool) No newline at end of file
69 self.btnStartburn.setEnabled(var_bool)
70 No newline at end of file
70
71 No newline at end of file
71
72 def make_parameters_conf(self): No newline at end of file
72 def make_parameters_conf(self):
73 var_file = open("parameters.conf","w") No newline at end of file
73 var_file = open("parameters.conf","w")
74 No newline at end of file
74
75 var_file.write(self.var_Dpath+"\n") #0 No newline at end of file
75 var_file.write(self.var_Dpath+"\n") #0
76 var_file.write(self.var_Rpath+"\n") #1 No newline at end of file
76 var_file.write(self.var_Rpath+"\n") #1
77 var_file.write(str(self.var_lstDtype)+"\n") #2 No newline at end of file
77 var_file.write(str(self.var_lstDtype)+"\n") #2
78 var_file.write(self.var_Dtype+"\n") #3 No newline at end of file
78 var_file.write(self.var_Dtype+"\n") #3
79 var_file.write(self.var_Elabel+"\n") #4 No newline at end of file
79 var_file.write(self.var_Elabel+"\n") #4
80 var_file.write(str(self.var_Copys)+"\n") #5 No newline at end of file
80 var_file.write(str(self.var_Copys)+"\n") #5
81 var_file.write(str(self.var_lstDcapacity)+"\n") #6 No newline at end of file
81 var_file.write(str(self.var_lstDcapacity)+"\n") #6
82 var_file.write(str(self.var_Dcapacity)+"\n") #7 No newline at end of file
82 var_file.write(str(self.var_Dcapacity)+"\n") #7
83 No newline at end of file
83
84 var_file.close() No newline at end of file
84 var_file.close()
85 No newline at end of file
85
86 No newline at end of file
86
87 def get_parameters_conf(self): No newline at end of file
87 def get_parameters_conf(self):
88 var_file = open("parameters.conf","r") No newline at end of file
88 var_file = open("parameters.conf","r")
89 lines = var_file.readlines() No newline at end of file
89 lines = var_file.readlines()
90 No newline at end of file
90
91 self.txtDpath.setText(lines[0][:-1]) #0 No newline at end of file
91 self.txtDpath.setText(lines[0][:-1]) #0
92 self.txtRpath.setText(lines[1][:-1]) #1 No newline at end of file
92 self.txtRpath.setText(lines[1][:-1]) #1
93 self.lstDtype.setCurrentIndex(int(lines[2])) #2 No newline at end of file
93 self.lstDtype.setCurrentIndex(int(lines[2])) #2
94 self.txtDtype.setText(lines[3][:-1]) #3 No newline at end of file
94 self.txtDtype.setText(lines[3][:-1]) #3
95 self.txtElabel.setText(lines[4][:-1]) #4 No newline at end of file
95 self.txtElabel.setText(lines[4][:-1]) #4
96 self.txtCopys.setValue(int(lines[5][:-1])) #5 No newline at end of file
96 self.txtCopys.setValue(int(lines[5][:-1])) #5
97 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6 No newline at end of file
97 self.lstDcapacity.setCurrentIndex(int(lines[6])) #6
98 self.txtDcapacity.setValue(float(lines[7])) No newline at end of file
98 self.txtDcapacity.setValue(float(lines[7]))
99 No newline at end of file
99
100 var_file.close() No newline at end of file
100 var_file.close()
101 No newline at end of file
101
102 def set_vars(self): No newline at end of file
102 def set_vars(self):
103 self.var_Dpath = self.txtDpath.text() No newline at end of file
103 self.var_Dpath = self.txtDpath.text()
104 self.var_Rpath = self.txtRpath.text() No newline at end of file
104 self.var_Rpath = self.txtRpath.text()
105 self.var_lstDtype = self.lstDtype.currentIndex() No newline at end of file
105 self.var_lstDtype = self.lstDtype.currentIndex()
106 self.var_Dtype = self.txtDtype.text() No newline at end of file
106 self.var_Dtype = self.txtDtype.text()
107 self.var_Elabel = self.txtElabel.text() No newline at end of file
107 self.var_Elabel = self.txtElabel.text()
108 self.var_Copys = self.txtCopys.value() No newline at end of file
108 self.var_Copys = self.txtCopys.value()
109 self.var_lstDcapacity = self.lstDcapacity.currentIndex() No newline at end of file
109 self.var_lstDcapacity = self.lstDcapacity.currentIndex()
110 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
110 self.var_Dcapacity = self.txtDcapacity.value()
111 No newline at end of file
111
@@ -1,328 +1,353
1 # -*- coding: utf-8 -*- No newline at end of file
1 # -*- coding: utf-8 -*-
2 No newline at end of file
2
3 """ No newline at end of file
3 """
4 Module implementing MainWindow. No newline at end of file
4 Module implementing MainWindow.
5 """ No newline at end of file
5 """
6 No newline at end of file
6
7 from PyQt4.QtGui import QMainWindow No newline at end of file
7 from PyQt4.QtGui import QMainWindow
8 from PyQt4.QtCore import pyqtSignature No newline at end of file
8 from PyQt4.QtCore import pyqtSignature
9 from PyQt4 import QtCore No newline at end of file
9 from PyQt4 import QtCore
10 from Ui_MainWindow import Ui_MainWindow No newline at end of file
10 from Ui_MainWindow import Ui_MainWindow
11 from PyQt4 import QtGui No newline at end of file
11 from PyQt4 import QtGui
12 from subprocess import * No newline at end of file
12 from subprocess import *
13 import sys No newline at end of file
13 import sys
14 import os No newline at end of file
14 import os
15 import subprocess No newline at end of file
15 import subprocess
16 import commands No newline at end of file
16 import commands
17 from functions import functions No newline at end of file
17 from functions import functions
18 from functions import functions2 No newline at end of file
18 from functions import functions2
19 No newline at end of file
19
20 class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file
20 class MainWindow(QMainWindow, Ui_MainWindow):
21 """ No newline at end of file
21 """
22 Class documentation goes here. No newline at end of file
22 Class documentation goes here.
23 """ No newline at end of file
23 """
24 No newline at end of file
24
25 def __init__(self, parent = None): No newline at end of file
25 def __init__(self, parent = None):
26 QMainWindow.__init__(self, parent) No newline at end of file
26 QMainWindow.__init__(self, parent)
27 self.setupUi(self) No newline at end of file
27 self.setupUi(self)
28 self.setupUi2() No newline at end of file
28 self.setupUi2()
29 #sys.stdout = self #redirige salida estandar No newline at end of file
29 #sys.stdout = self #redirige salida estandar
30 No newline at end of file
30
31 def setupUi2(self): No newline at end of file
31 def setupUi2(self):
32 No newline at end of file
32
33 functions2.detect_devices(self) #busca los dispositivos de grabacion No newline at end of file
33 functions2.detect_devices(self) #busca los dispositivos de grabacion
34 No newline at end of file
34
35 #Revisa si existe el archivo de confirguracion No newline at end of file
35 #Revisa si existe el archivo de confirguracion
36 if os.path.isfile("parameters.conf"): No newline at end of file
36 if os.path.isfile("parameters.conf"):
37 self.txtInfo.append("Archivo de configuracion encontrado") No newline at end of file
37 self.txtInfo.append("Archivo de configuracion encontrado")
38 functions2.get_parameters_conf(self) No newline at end of file
38 functions2.get_parameters_conf(self)
39 else: No newline at end of file
39 else:
40 self.txtInfo.append("Elija los parametros de configuracion") No newline at end of file
40 self.txtInfo.append("Elija los parametros de configuracion")
41 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas No newline at end of file
41 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas
42 No newline at end of file
42
43 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados No newline at end of file
43 functions2.set_vars(self) #Carga las variables de la clase con los parametros seleccionados
44 No newline at end of file
44
45 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
45 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
46 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
46 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
47 No newline at end of file
47
48 self.var_n_discs=0 No newline at end of file
48 self.var_n_discs=0
49 self.var_list=[] No newline at end of file
49 self.var_list=[]
50 self.var_sublist=[] No newline at end of file
50 self.var_sublist=[]
51 No newline at end of file
51
52 functions.load_days(self) No newline at end of file
52 functions.load_days(self)
53 No newline at end of file
53
54 self.var_process = QtCore.QProcess() No newline at end of file
54 self.var_process = QtCore.QProcess()
55 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput) No newline at end of file
55 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardOutput()'), self.readOuput)
56 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError) No newline at end of file
56 self.connect(self.var_process, QtCore.SIGNAL('readyReadStandardError()'), self.readError)
57 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished) No newline at end of file
57 self.connect(self.var_process, QtCore.SIGNAL('finished(int,QProcess::ExitStatus)'), self.finished)
58 No newline at end of file
58
59 def readOuput(self): No newline at end of file
59 def readOuput(self):
60 self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput())) No newline at end of file
60 self.txtSburn.insertPlainText("stdout: " + QtCore.QString(self.var_process.readAllStandardOutput()))
61 No newline at end of file
61
62 No newline at end of file
62
63 def readError(self): No newline at end of file
63 def readError(self):
64 self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError())) No newline at end of file
64 self.txtSburn.insertPlainText("stderr: " + QtCore.QString(self.var_process.readAllStandardError()))
65 No newline at end of file
65
66 No newline at end of file
66
67 def finished(self): No newline at end of file
67 def finished(self):
68 self.txtInfo.append("proceso terminado finished()") No newline at end of file
68 self.txtInfo.append("proceso terminado finished()")
69 print self.var_process.exitCode() No newline at end of file
69 print self.var_process.exitCode()
70 No newline at end of file
70
71 No newline at end of file
71
72 def write(self, txt): No newline at end of file
72 def write(self, txt):
73 self.txtInfo.append(str(txt)) No newline at end of file
73 self.txtInfo.append(str(txt))
74 No newline at end of file
74
75 #----------------------------------------------------- Obtencion de las ruta de los datos --------------------------------------------------------------- No newline at end of file
75 No newline at end of file
76
76 @pyqtSignature("") No newline at end of file
77 @pyqtSignature("")
77 def on_btnDpath_clicked(self): No newline at end of file
78 def on_btnDpath_clicked(self):
78 """ No newline at end of file
79 """
79 Permite seleccionar graficamente el direcorio de los datos a grabar No newline at end of file
80 Permite seleccionar graficamente el direcorio de los datos a grabar
80 """ No newline at end of file
81 """
81 self.var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) No newline at end of file
82 self.var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
82 self.txtDpath.setText(self.var_Dpath)
83 self.txtDpath.setText(self.var_Dpath)
No newline at end of file
84 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
83 self.on_txtDpath_editingFinished() #llamada a funcion
No newline at end of file
No newline at end of file
85 functions.load_days(self) No newline at end of file
84
No newline at end of file
85
No newline at end of file
86 @pyqtSignature("")
No newline at end of file
87 def on_btnRpath_clicked(self):
No newline at end of file
88 """
No newline at end of file
89 Permite seleccionar graficamente el direcorio del proyecto
No newline at end of file
90 """
No newline at end of file
91 self.var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
No newline at end of file
92 self.txtRpath.setText(self.var_Rpath)
No newline at end of file
93 self.on_txtRpath_editingFinished() #llamada a funcion No newline at end of file
94 No newline at end of file
86
95 No newline at end of file
87
96 @pyqtSignature("") No newline at end of file
88 @pyqtSignature("")
97 def on_txtDpath_editingFinished(self): No newline at end of file
89 def on_txtDpath_editingFinished(self):
98 """
90 """
No newline at end of file
91 Carga la ruta editada y verifica que sea correcta y carga la lista de dias No newline at end of file
99 Permite buscar los archivos de extension seleccionada en la ruta de de datos
No newline at end of file
100 y cargar los valores para el rango de tiempo a ser grabado No newline at end of file
101 """ No newline at end of file
92 """
102 self.var_Dpath=self.txtDpath.text() #Se carga la variable con la ruta recien editada No newline at end of file
93 self.var_Dpath=self.txtDpath.text() #Se carga la variable con la ruta recien editada
103 self.statusDpath = functions.dir_exists(self.var_Dpath, self) No newline at end of file
94 self.statusDpath = functions.dir_exists(self.var_Dpath, self)
104 functions.load_days(self) No newline at end of file
95 functions.load_days(self)
105 No newline at end of file
96
106 No newline at end of file
97
98 #----------------------------------------------------- Obtencion de las ruta del proyecto ---------------------------------------------------------------
No newline at end of file
99
No newline at end of file
100 @pyqtSignature("")
No newline at end of file
101 def on_btnRpath_clicked(self):
No newline at end of file
102 """
No newline at end of file
103 Permite seleccionar graficamente el direcorio del proyecto
No newline at end of file
104 """
No newline at end of file
105 self.var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
No newline at end of file
106 self.txtRpath.setText(self.var_Rpath)
No newline at end of file
107 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
No newline at end of file
108
No newline at end of file
109 No newline at end of file
107 @pyqtSignature("") No newline at end of file
110 @pyqtSignature("")
108 def on_txtRpath_editingFinished(self): No newline at end of file
111 def on_txtRpath_editingFinished(self):
109 """ No newline at end of file
112 """
110 Valida la ruta del proyecto No newline at end of file
113 Valida la ruta del proyecto
111 """ No newline at end of file
114 """
112 self.var_Rpath=self.txtRpath.text() #Se carga la variable con la ruta recien editada No newline at end of file
115 self.var_Rpath=self.txtRpath.text() #Se carga la variable con la ruta recien editada
113 self.statusRpath = functions.dir_exists(self.var_Rpath, self) No newline at end of file
116 self.statusRpath = functions.dir_exists(self.var_Rpath, self)
114 No newline at end of file
117
115 No newline at end of file
118
119 #----------------------------------------------------- Tipo de datos ---------------------------------------------------------------
No newline at end of file
120 No newline at end of file
116 @pyqtSignature("int") No newline at end of file
121 @pyqtSignature("int")
117 def on_lstDtype_activated(self, index): No newline at end of file
122 def on_lstDtype_activated(self, index):
118 """ No newline at end of file
123 """
119 Permite elegir entre los tipos de archivos No newline at end of file
124 Permite elegir entre los tipos de archivos
120 """ No newline at end of file
125 """
121 self.txtDtype.setReadOnly(True) No newline at end of file
126 self.txtDtype.setReadOnly(True)
122 if index == 0:
127 if index == 0:
No newline at end of file
128 self.var_Dtype ='r' No newline at end of file
123 var_type='r' No newline at end of file
124 elif index == 1:
129 elif index == 1:
No newline at end of file
130 self.var_Dtype ='pdata' No newline at end of file
125 var_type='pdata' No newline at end of file
126 elif index == 2:
131 elif index == 2:
No newline at end of file
132 self.var_Dtype ='sswma' No newline at end of file
127 var_type='sswma' No newline at end of file
128 else :
133 else :
No newline at end of file
134 self.var_Dtype ='' No newline at end of file
129 var_type='' No newline at end of file
130 self.txtDtype.setReadOnly(False) No newline at end of file
135 self.txtDtype.setReadOnly(False)
131
136
No newline at end of file
137 self.txtDtype.setText(self.var_Dtype)
132 self.txtDtype.setText(var_type)
No newline at end of file
No newline at end of file
138 functions.load_days(self) #llamada a funcion No newline at end of file
133 self.on_txtDtype_editingFinished()
No newline at end of file
134 No newline at end of file
135 No newline at end of file
139
136 @pyqtSignature("") No newline at end of file
140 @pyqtSignature("")
137 def on_txtDtype_editingFinished(self): No newline at end of file
141 def on_txtDtype_editingFinished(self):
138 self.var_Dtype=self.txtDtype.text() No newline at end of file
142 self.var_Dtype=self.txtDtype.text()
139 functions.load_days(self) #llamada a funcion No newline at end of file
143 functions.load_days(self) #llamada a funcion
140 No newline at end of file
144
141 No newline at end of file
145
146 #----------------------------------------------------- Etiqueta ---------------------------------------------------------------
No newline at end of file
147 No newline at end of file
142 @pyqtSignature("") No newline at end of file
148 @pyqtSignature("")
143 def on_txtElabel_editingFinished(self): No newline at end of file
149 def on_txtElabel_editingFinished(self):
144 self.var_Elabel = self.txtElabel.text() No newline at end of file
150 self.var_Elabel = self.txtElabel.text()
145
151
No newline at end of file
152 #----------------------------------------------------- Numero de copias --------------------------------------------------------------- No newline at end of file
146 No newline at end of file
147 @pyqtSignature("") No newline at end of file
153 @pyqtSignature("")
148 def on_txtCopys_editingFinished(self): No newline at end of file
154 def on_txtCopys_editingFinished(self):
149 self.var_Copys = self.txtCopys.value() No newline at end of file
155 self.var_Copys = self.txtCopys.value()
150
156
No newline at end of file
157 #----------------------------------------------------- Seleccion del rango de fechas --------------------------------------------------------------- No newline at end of file
151
No newline at end of file
152 @pyqtSignature("")
No newline at end of file
153 def on_txtDcapacity_editingFinished(self):
No newline at end of file
154 self.var_Dcapacity = self.txtDcapacity.value()
No newline at end of file
155 No newline at end of file
156 No newline at end of file
158
157 @pyqtSignature("int") #CLOSED No newline at end of file
159 @pyqtSignature("int") #CLOSED
158 def on_lstStartDay_activated(self, index): No newline at end of file
160 def on_lstStartDay_activated(self, index):
159 """ No newline at end of file
161 """
160 Cambia la lista de opciones en lstStopDay No newline at end of file
162 Cambia la lista de opciones en lstStopDay
161 """ No newline at end of file
163 """
162 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex() No newline at end of file
164 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
163 self.lstStopDay.clear() No newline at end of file
165 self.lstStopDay.clear()
164 No newline at end of file
166
165 for i in self.var_list[index:]: No newline at end of file
167 for i in self.var_list[index:]:
166 self.lstStopDay.addItem(i) No newline at end of file
168 self.lstStopDay.addItem(i)
167 No newline at end of file
169
168 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index) No newline at end of file
170 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
169 No newline at end of file
171
170 functions.get_sub_list(self) No newline at end of file
172 functions.get_sub_list(self)
171 No newline at end of file
173
172 No newline at end of file
174
173 @pyqtSignature("int") #CLOSED No newline at end of file
175 @pyqtSignature("int") #CLOSED
174 def on_lstStopDay_activated(self, index): No newline at end of file
176 def on_lstStopDay_activated(self, index):
175 """ No newline at end of file
177 """
176 Cambia la lista de opciones en lstStartDay No newline at end of file
178 Cambia la lista de opciones en lstStartDay
177 """ No newline at end of file
179 """
178 var_StartDay_index=self.lstStartDay.currentIndex() No newline at end of file
180 var_StartDay_index=self.lstStartDay.currentIndex()
179 var_end_index = self.lstStopDay.count() - index No newline at end of file
181 var_end_index = self.lstStopDay.count() - index
180 self.lstStartDay.clear() No newline at end of file
182 self.lstStartDay.clear()
181 No newline at end of file
183
182 for i in self.var_list[:len(self.var_list) - var_end_index + 1]: No newline at end of file
184 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
183 self.lstStartDay.addItem(i) No newline at end of file
185 self.lstStartDay.addItem(i)
184 No newline at end of file
186
185 self.lstStartDay.setCurrentIndex(var_StartDay_index) No newline at end of file
187 self.lstStartDay.setCurrentIndex(var_StartDay_index)
186 No newline at end of file
188
187 functions.get_sub_list(self) No newline at end of file
189 functions.get_sub_list(self)
190
No newline at end of file
191
No newline at end of file
192 #----------------------------------------------------- Capacidad del dispositivo de grabacion ---------------------------------------------------------------
No newline at end of file
193
No newline at end of file
194 @pyqtSignature("")
No newline at end of file
195 def on_txtDcapacity_editingFinished(self):
No newline at end of file
196 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
188 No newline at end of file
197
189 No newline at end of file
198
190 @pyqtSignature("int") #CLOSED No newline at end of file
199 @pyqtSignature("int") #CLOSED
191 def on_lstDcapacity_activated(self, index): No newline at end of file
200 def on_lstDcapacity_activated(self, index):
192 """ No newline at end of file
201 """
193 Permite elegir el tamaΓ±o del disco No newline at end of file
202 Permite elegir el tamaΓ±o del disco
194 """ No newline at end of file
203 """
195 if index == 0: No newline at end of file
204 if index == 0:
196 var_size=25.0 No newline at end of file
205 var_size=25.0
197 elif index == 1: No newline at end of file
206 elif index == 1:
198 var_size=8.5 No newline at end of file
207 var_size=8.5
199 elif index == 2: No newline at end of file
208 elif index == 2:
200 var_size=4.7 No newline at end of file
209 var_size=4.7
201 elif index == 3: No newline at end of file
210 elif index == 3:
202 var_size=0.7 No newline at end of file
211 var_size=0.7
203 No newline at end of file
212
204 if index != 4: No newline at end of file
213 if index != 4:
205 self.txtDcapacity.setValue(var_size*10**9/1024**2) No newline at end of file
214 self.txtDcapacity.setValue(var_size*10**9/1024**2)
206 self.txtDcapacity.setReadOnly(True) No newline at end of file
215 self.txtDcapacity.setReadOnly(True)
207 else: No newline at end of file
216 else:
208 self.txtDcapacity.setValue(100.0) No newline at end of file
217 self.txtDcapacity.setValue(100.0)
209 self.txtDcapacity.setReadOnly(False) No newline at end of file
218 self.txtDcapacity.setReadOnly(False)
210 No newline at end of file
219
211 self.var_Dcapacity = self.txtDcapacity.value() No newline at end of file
220 self.var_Dcapacity = self.txtDcapacity.value()
212 No newline at end of file
221
213 No newline at end of file
222
223 #==============================================================================
No newline at end of file
224 # Botones para la generacion de los archivos de configuracion y el proceso de grabacion
No newline at end of file
225 #==============================================================================
No newline at end of file
226
No newline at end of file
227 #----------------------------------------------------- Generacion de la configuracion usando los parametros ---------------------------------------------------------------
No newline at end of file
228 No newline at end of file
214 @pyqtSignature("") No newline at end of file
229 @pyqtSignature("")
215 def on_btnGbkp_clicked(self): No newline at end of file
230 def on_btnGbkp_clicked(self):
216 """
231 """
No newline at end of file
232 Generacion de archivos de configuracion usando los parametros No newline at end of file
217 Cuando se presiona el boton btnGbkp No newline at end of file
218 """ No newline at end of file
233 """
219 No newline at end of file
234
220 if functions.validate_parameters(self) == False: No newline at end of file
235 if functions.validate_parameters(self) == False:
221 return No newline at end of file
236 return
222 No newline at end of file
237
223 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente No newline at end of file
238 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
224 list_dirs=['gpath','iso','ppath'] No newline at end of file
239 list_dirs=['gpath','iso','ppath']
225 bool_make_dirs = functions.make_dirs(list_dirs, self) No newline at end of file
240 bool_make_dirs = functions.make_dirs(list_dirs, self)
226 if bool_make_dirs == False: No newline at end of file
241 if bool_make_dirs == False:
227 return No newline at end of file
242 return
228 No newline at end of file
243
229 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar No newline at end of file
244 var_files_list = functions.list_files(self) #Se obtiene la lista de archivos a grabar
230 self.var_n_discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat No newline at end of file
245 self.var_n_discs = functions.make_files_dat(var_files_list, self) #Se crean los archivos .dat
231 functions.make_files_print(self) # Se crean los archivos .print No newline at end of file
246 functions.make_files_print(self) # Se crean los archivos .print
232 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf No newline at end of file
247 functions2.make_parameters_conf(self) # se crea el archivo parameters.conf
233
248
No newline at end of file
249 #Se bloquean los parametros de configuracion No newline at end of file
234 #Se deshabilitan los parametros de configuracion No newline at end of file
235 functions2.enabled_items1(True, self) No newline at end of file
250 functions2.enabled_items1(True, self)
251
No newline at end of file
252
No newline at end of file
253 #----------------------------------------------------- Permite reiniciar la configuracion --------------------------------------------------------------- No newline at end of file
236 No newline at end of file
254
237 @pyqtSignature("") No newline at end of file
255 @pyqtSignature("")
238 def on_btnRestart_clicked(self): No newline at end of file
256 def on_btnRestart_clicked(self):
239 """ No newline at end of file
257 """
240 Permite que se puedan cambiar los parametros No newline at end of file
258 Permite que se puedan cambiar los parametros
241 """ No newline at end of file
259 """
242 functions2.enabled_items1(False, self) No newline at end of file
260 functions2.enabled_items1(False, self)
243 os.remove("parameters.conf") No newline at end of file
261 os.remove("parameters.conf")
244 No newline at end of file
262
263
No newline at end of file
264 #----------------------------------------------------- Iniciar proceso de grabacion --------------------------------------------------------------- No newline at end of file
245 No newline at end of file
265
246 @pyqtSignature("") No newline at end of file
266 @pyqtSignature("")
247 def on_btnStartburn_clicked(self): No newline at end of file
267 def on_btnStartburn_clicked(self):
248 """ No newline at end of file
268 """
249 Se inicia el proceso de grabacion No newline at end of file
269 Se inicia el proceso de grabacion
250 """ No newline at end of file
270 """
251 self.btnRestart.setEnabled(False) No newline at end of file
271 self.btnRestart.setEnabled(False)
252 self.btnStartburn.setEnabled(False) No newline at end of file
272 self.btnStartburn.setEnabled(False)
253 self.btnStopburn.setEnabled(True) No newline at end of file
273 self.btnStopburn.setEnabled(True)
254 No newline at end of file
274
255 sys.stdout = self No newline at end of file
275 sys.stdout = self
256 #sys.stderr = self No newline at end of file
276 #sys.stderr = self
257 print "stdout_!!!" No newline at end of file
277 print "stdout_!!!"
258 No newline at end of file
278
259 #Inicializando variables No newline at end of file
279 #Inicializando variables
260 var_Rpath_ppath=self.var_Rpath+"/ppath" No newline at end of file
280 var_Rpath_ppath=self.var_Rpath+"/ppath"
261 var_Rpath_iso=self.var_Rpath+"/iso" No newline at end of file
281 var_Rpath_iso=self.var_Rpath+"/iso"
262 No newline at end of file
282
263 var_n=1 No newline at end of file
283 var_n=1
264 file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso" No newline at end of file
284 file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso"
265 file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat" No newline at end of file
285 file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat"
266 No newline at end of file
286
267 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' No newline at end of file
287 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
268 var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel No newline at end of file
288 var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel
269 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso No newline at end of file
289 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
270 No newline at end of file
290
271 # self.process.start(var_cmd) No newline at end of file
291 # self.process.start(var_cmd)
272 self.var_process.start(var_cmd) No newline at end of file
292 self.var_process.start(var_cmd)
273 # self.var_process.waitForFinished() No newline at end of file
293 # self.var_process.waitForFinished()
274 self.txtInfo.append("ejecutandose") No newline at end of file
294 self.txtInfo.append("ejecutandose")
275 No newline at end of file
295
276 No newline at end of file
296
277 # # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps No newline at end of file
297 # # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps
278 # for var_n in range(1, self.var_n_discs+1): No newline at end of file
298 # for var_n in range(1, self.var_n_discs+1):
279 # self.txtInfo.append(str(var_n)) No newline at end of file
299 # self.txtInfo.append(str(var_n))
280 # file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso" No newline at end of file
300 # file_iso=var_Rpath_iso+"/"+functions.i2s(var_n)+".iso"
281 # file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat" No newline at end of file
301 # file_dat=var_Rpath_ppath+"/"+self.var_Elabel+"_"+functions.i2s(var_n)+".dat"
282 # No newline at end of file
302 #
283 # var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r ' No newline at end of file
303 # var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
284 # var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel No newline at end of file
304 # var_cmd += ' -A '+self.var_Elabel+' -V '+self.var_Elabel
285 # var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso No newline at end of file
305 # var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
286 # self.txtInfo.append(var_cmd) No newline at end of file
306 # self.txtInfo.append(var_cmd)
287 # No newline at end of file
307 #
288 # var_output=commands.getstatusoutput(str(var_cmd))[0] No newline at end of file
308 # var_output=commands.getstatusoutput(str(var_cmd))[0]
289 # self.txtInfo.append(str(var_output)) No newline at end of file
309 # self.txtInfo.append(str(var_output))
290 No newline at end of file
310
291 #os.system(str(var_cmd)) No newline at end of file
311 #os.system(str(var_cmd))
292 #p = subprocess.Popen(str('ls /'), shell=True, stdout=self) No newline at end of file
312 #p = subprocess.Popen(str('ls /'), shell=True, stdout=self)
293 #os.waitpid(p.pid, 0) No newline at end of file
313 #os.waitpid(p.pid, 0)
294 ####self.txtInfo.append(str(p.pid)) No newline at end of file
314 ####self.txtInfo.append(str(p.pid))
295 No newline at end of file
315
296 No newline at end of file
316
317 #----------------------------------------------------- Detener proceso de grabacion ---------------------------------------------------------------
No newline at end of file
318 No newline at end of file
297 @pyqtSignature("") No newline at end of file
319 @pyqtSignature("")
298 def on_btnStopburn_clicked(self): No newline at end of file
320 def on_btnStopburn_clicked(self):
299 """ No newline at end of file
321 """
300 Slot documentation goes here. No newline at end of file
322 Slot documentation goes here.
301 """ No newline at end of file
323 """
302 self.btnRestart.setEnabled(True) No newline at end of file
324 self.btnRestart.setEnabled(True)
303 self.btnStartburn.setEnabled(True) No newline at end of file
325 self.btnStartburn.setEnabled(True)
304 self.btnStopburn.setEnabled(False) No newline at end of file
326 self.btnStopburn.setEnabled(False)
327
No newline at end of file
328
No newline at end of file
329 #----------------------------------------------------- Testeo de las unidades de grabacion --------------------------------------------------------------- No newline at end of file
305 No newline at end of file
330
306 @pyqtSignature("") No newline at end of file
331 @pyqtSignature("")
307 def on_btnTdevA_clicked(self): No newline at end of file
332 def on_btnTdevA_clicked(self):
308 var_dev = str(self.txtDeviceA.text()) No newline at end of file
333 var_dev = str(self.txtDeviceA.text())
309 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
334 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
310 commands.getstatusoutput(var_cmd) No newline at end of file
335 commands.getstatusoutput(var_cmd)
311 No newline at end of file
336
312 @pyqtSignature("") No newline at end of file
337 @pyqtSignature("")
313 def on_btnTdevB_clicked(self): No newline at end of file
338 def on_btnTdevB_clicked(self):
314 var_dev = str(self.txtDeviceB.text()) No newline at end of file
339 var_dev = str(self.txtDeviceB.text())
315 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
340 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
316 commands.getstatusoutput(var_cmd) No newline at end of file
341 commands.getstatusoutput(var_cmd)
317 No newline at end of file
342
318 @pyqtSignature("") No newline at end of file
343 @pyqtSignature("")
319 def on_btnTdevC_clicked(self): No newline at end of file
344 def on_btnTdevC_clicked(self):
320 var_dev = str(self.txtDeviceC.text()) No newline at end of file
345 var_dev = str(self.txtDeviceC.text())
321 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
346 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
322 commands.getstatusoutput(var_cmd) No newline at end of file
347 commands.getstatusoutput(var_cmd)
323 No newline at end of file
348
324 @pyqtSignature("") No newline at end of file
349 @pyqtSignature("")
325 def on_btnTdevD_clicked(self): No newline at end of file
350 def on_btnTdevD_clicked(self):
326 var_dev = str(self.txtDeviceD.text()) No newline at end of file
351 var_dev = str(self.txtDeviceD.text())
327 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev No newline at end of file
352 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
328 commands.getstatusoutput(var_cmd) No newline at end of file
353 commands.getstatusoutput(var_cmd)
General Comments 0
You need to be logged in to leave comments. Login now