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