##// END OF EJS Templates
implementacion de funciones:...
ralonso -
r39:40
parent child
Show More
@@ -1,8 +1,31
1 #import sys
1 #import sys
2 #from subprocess import *
2 #from subprocess import *
3
3
4 #class BKmanager:
4 #class BKmanager:
5 # def __init__(self):
5 # def __init__(self):
6
6 from subprocess import *
7 import sys
8 import os
9 import subprocess
10 import commands
11
12 #Entero a cadena agregando ceros delante
13 def i2s(var_n, var_length=4):
14 var_n2=str(var_n)
15 while len(var_n2) < var_length:
16 var_n2 = "0"+var_n2
17 return var_n2
18
7
19
8
20
21 def make_dirs(var_path, list_dirs, self):
22
23 var_cmd="mkdir -p "+str(var_path)
24 for var_dir in list_dirs:
25 var_output=commands.getstatusoutput(var_cmd+'/'+var_dir)[0]
26 print var_cmd+'/'+var_dir
27 if var_output != 0:
28 self.txtInfo.append("Error al crear el directorio "+var_dir+", output_error:" + str(var_output))
29 return
30 else:
31 self.txtInfo.append('Carpetas creadas correctamente')
@@ -1,159 +1,159
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE Project SYSTEM "Project-4.6.dtd">
2 <!DOCTYPE Project SYSTEM "Project-4.6.dtd">
3 <!-- eric4 project file for project jro_backup_manager -->
3 <!-- eric4 project file for project jro_backup_manager -->
4 <!-- Saved: 2010-04-14, 15:28:43 -->
4 <!-- Saved: 2010-05-16, 11:21:24 -->
5 <!-- Copyright (C) 2010 , -->
5 <!-- Copyright (C) 2010 , -->
6 <Project version="4.6">
6 <Project version="4.6">
7 <Language>en</Language>
7 <Language>en</Language>
8 <ProgLanguage mixed="0">Python</ProgLanguage>
8 <ProgLanguage mixed="0">Python</ProgLanguage>
9 <ProjectType>Qt4</ProjectType>
9 <ProjectType>Qt4</ProjectType>
10 <Description></Description>
10 <Description></Description>
11 <Version>0.1</Version>
11 <Version>0.1</Version>
12 <Author></Author>
12 <Author></Author>
13 <Email></Email>
13 <Email></Email>
14 <Sources>
14 <Sources>
15 <Source>__init__.py</Source>
15 <Source>__init__.py</Source>
16 <Source>ui/Ui_MainWindow.py</Source>
16 <Source>ui/Ui_MainWindow.py</Source>
17 <Source>ui/MainWindow.py</Source>
17 <Source>ui/MainWindow.py</Source>
18 <Source>main.py</Source>
18 <Source>main.py</Source>
19 <Source>ui/__init__.py</Source>
19 <Source>ui/__init__.py</Source>
20 <Source>functions/__init__.py</Source>
20 <Source>functions/__init__.py</Source>
21 <Source>functions/functions.py</Source>
21 <Source>functions/functions.py</Source>
22 </Sources>
22 </Sources>
23 <Forms>
23 <Forms>
24 <Form>ui/MainWindow.ui</Form>
24 <Form>ui/MainWindow.ui</Form>
25 </Forms>
25 </Forms>
26 <Translations>
26 <Translations>
27 </Translations>
27 </Translations>
28 <Resources>
28 <Resources>
29 </Resources>
29 </Resources>
30 <Interfaces>
30 <Interfaces>
31 </Interfaces>
31 </Interfaces>
32 <Others>
32 <Others>
33 </Others>
33 </Others>
34 <MainScript>main.py</MainScript>
34 <MainScript>main.py</MainScript>
35 <Vcs>
35 <Vcs>
36 <VcsType>Subversion</VcsType>
36 <VcsType>Subversion</VcsType>
37 <VcsOptions>
37 <VcsOptions>
38 <dict>
38 <dict>
39 <key>
39 <key>
40 <string>add</string>
40 <string>add</string>
41 </key>
41 </key>
42 <value>
42 <value>
43 <list>
43 <list>
44 <string></string>
44 <string></string>
45 </list>
45 </list>
46 </value>
46 </value>
47 <key>
47 <key>
48 <string>checkout</string>
48 <string>checkout</string>
49 </key>
49 </key>
50 <value>
50 <value>
51 <list>
51 <list>
52 <string></string>
52 <string></string>
53 </list>
53 </list>
54 </value>
54 </value>
55 <key>
55 <key>
56 <string>commit</string>
56 <string>commit</string>
57 </key>
57 </key>
58 <value>
58 <value>
59 <list>
59 <list>
60 <string></string>
60 <string></string>
61 </list>
61 </list>
62 </value>
62 </value>
63 <key>
63 <key>
64 <string>diff</string>
64 <string>diff</string>
65 </key>
65 </key>
66 <value>
66 <value>
67 <list>
67 <list>
68 <string></string>
68 <string></string>
69 </list>
69 </list>
70 </value>
70 </value>
71 <key>
71 <key>
72 <string>export</string>
72 <string>export</string>
73 </key>
73 </key>
74 <value>
74 <value>
75 <list>
75 <list>
76 <string></string>
76 <string></string>
77 </list>
77 </list>
78 </value>
78 </value>
79 <key>
79 <key>
80 <string>global</string>
80 <string>global</string>
81 </key>
81 </key>
82 <value>
82 <value>
83 <list>
83 <list>
84 <string></string>
84 <string></string>
85 </list>
85 </list>
86 </value>
86 </value>
87 <key>
87 <key>
88 <string>history</string>
88 <string>history</string>
89 </key>
89 </key>
90 <value>
90 <value>
91 <list>
91 <list>
92 <string></string>
92 <string></string>
93 </list>
93 </list>
94 </value>
94 </value>
95 <key>
95 <key>
96 <string>log</string>
96 <string>log</string>
97 </key>
97 </key>
98 <value>
98 <value>
99 <list>
99 <list>
100 <string></string>
100 <string></string>
101 </list>
101 </list>
102 </value>
102 </value>
103 <key>
103 <key>
104 <string>remove</string>
104 <string>remove</string>
105 </key>
105 </key>
106 <value>
106 <value>
107 <list>
107 <list>
108 <string></string>
108 <string></string>
109 </list>
109 </list>
110 </value>
110 </value>
111 <key>
111 <key>
112 <string>status</string>
112 <string>status</string>
113 </key>
113 </key>
114 <value>
114 <value>
115 <list>
115 <list>
116 <string></string>
116 <string></string>
117 </list>
117 </list>
118 </value>
118 </value>
119 <key>
119 <key>
120 <string>tag</string>
120 <string>tag</string>
121 </key>
121 </key>
122 <value>
122 <value>
123 <list>
123 <list>
124 <string></string>
124 <string></string>
125 </list>
125 </list>
126 </value>
126 </value>
127 <key>
127 <key>
128 <string>update</string>
128 <string>update</string>
129 </key>
129 </key>
130 <value>
130 <value>
131 <list>
131 <list>
132 <string></string>
132 <string></string>
133 </list>
133 </list>
134 </value>
134 </value>
135 </dict>
135 </dict>
136 </VcsOptions>
136 </VcsOptions>
137 <VcsOtherData>
137 <VcsOtherData>
138 <dict>
138 <dict>
139 <key>
139 <key>
140 <string>standardLayout</string>
140 <string>standardLayout</string>
141 </key>
141 </key>
142 <value>
142 <value>
143 <bool>True</bool>
143 <bool>True</bool>
144 </value>
144 </value>
145 </dict>
145 </dict>
146 </VcsOtherData>
146 </VcsOtherData>
147 </Vcs>
147 </Vcs>
148 <FiletypeAssociations>
148 <FiletypeAssociations>
149 <FiletypeAssociation pattern="*.ui" type="FORMS" />
149 <FiletypeAssociation pattern="*.ui" type="FORMS" />
150 <FiletypeAssociation pattern="*.idl" type="INTERFACES" />
150 <FiletypeAssociation pattern="*.idl" type="INTERFACES" />
151 <FiletypeAssociation pattern="*.qm" type="TRANSLATIONS" />
151 <FiletypeAssociation pattern="*.qm" type="TRANSLATIONS" />
152 <FiletypeAssociation pattern="*.ptl" type="SOURCES" />
152 <FiletypeAssociation pattern="*.ptl" type="SOURCES" />
153 <FiletypeAssociation pattern="*.pyw" type="SOURCES" />
153 <FiletypeAssociation pattern="*.pyw" type="SOURCES" />
154 <FiletypeAssociation pattern="*.ui.h" type="FORMS" />
154 <FiletypeAssociation pattern="*.ui.h" type="FORMS" />
155 <FiletypeAssociation pattern="*.ts" type="TRANSLATIONS" />
155 <FiletypeAssociation pattern="*.ts" type="TRANSLATIONS" />
156 <FiletypeAssociation pattern="*.py" type="SOURCES" />
156 <FiletypeAssociation pattern="*.py" type="SOURCES" />
157 <FiletypeAssociation pattern="*.qrc" type="RESOURCES" />
157 <FiletypeAssociation pattern="*.qrc" type="RESOURCES" />
158 </FiletypeAssociations>
158 </FiletypeAssociations>
159 </Project> No newline at end of file
159 </Project>
@@ -1,512 +1,488
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 """
3 """
4 Module implementing MainWindow.
4 Module implementing MainWindow.
5 """
5 """
6
6
7 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtGui import QMainWindow
8 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignature
9 from Ui_MainWindow import Ui_MainWindow
9 from Ui_MainWindow import Ui_MainWindow
10 from PyQt4 import QtGui
10 from PyQt4 import QtGui
11 from subprocess import *
11 from subprocess import *
12 import sys
12 import sys
13 import os
13 import os
14 import subprocess
14 import subprocess
15 import commands
15 import commands
16 from functions import functions
16
17
17 class MainWindow(QMainWindow, Ui_MainWindow):
18 class MainWindow(QMainWindow, Ui_MainWindow):
18 """
19 """
19 Class documentation goes here.
20 Class documentation goes here.
20 """
21 """
21
22
22 def __init__(self, parent = None):
23 def __init__(self, parent = None):
23 QMainWindow.__init__(self, parent)
24 QMainWindow.__init__(self, parent)
24 self.setupUi(self)
25 self.setupUi(self)
25 self.setupUi2()
26 self.setupUi2()
26
27
27 #redirige salida estandar
28 #redirige salida estandar
28 sys.stdout = self
29 sys.stdout = self
29
30
30
31
31 def setupUi2(self):
32 def setupUi2(self):
32 """
33 """
33 Se usa para inicializar ciertos parametros para pruebas
34 Se usa para inicializar ciertos parametros para pruebas
34 """
35 """
35 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/Data/RAW_EXP/JASMET/')
36 #self.txtDpath.setText('/home/ricardoar/optional/STORAGE/Data/RAW_EXP/JASMET/')
36 self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba1_jro_backup_manager/')
37 #self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba1_jro_backup_manager/')
37 self.txtElabel.setText('JASMET')
38 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS/')
39 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager/')
40 self.txtElabel.setText('EW_DRIFTS')
38 self.statusDpath = True
41 self.statusDpath = True
39 self.statusRpath = True
42 self.statusRpath = True
40 self.var_n_files=0
43 self.var_n_files=0
41 # self.statusDpath = False
44 # self.statusDpath = False
42 # self.statusRpath = False
45 # self.statusRpath = False
43
46
44
47
45 #
48 #
46 #Deteccion de los dispositvos de grabacion
49 #Deteccion de los dispositvos de grabacion
47 #
50 #
48 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ?
51 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ΒΏ?
49 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'"
52 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'"
50 var_output = commands.getstatusoutput(var_cmd)
53 var_output = commands.getstatusoutput(var_cmd)
51 if var_output[0] != 0:
54 if var_output[0] != 0:
52 self.txtInfo.setText("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output))
55 self.txtInfo.setText("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output))
53 else:
56 else:
54 self.txtInfo.append("dispositivos encontrados")
57 self.txtInfo.append("dispositivos encontrados")
55 var_devices = var_output[1].split('\n')
58 var_devices = var_output[1].split('\n')
56
59
57 var_tmp=[]
60 var_tmp=[]
58 for i in range(0, 4):
61 for i in range(0, 4):
59 if i < len(var_devices):
62 if i < len(var_devices):
60 var_len = len(var_devices[i])
63 var_len = len(var_devices[i])
61 var_tmp.append(var_devices[i][1:var_len - 1])
64 var_tmp.append(var_devices[i][1:var_len - 1])
62 else:
65 else:
63 var_tmp.append('')
66 var_tmp.append('')
64
67
65 #Se escriben los dispostivos correspodientes, si existen
68 #Se escriben los dispostivos correspodientes, si existen
66 self.txtDeviceA.setText(str(var_tmp[0]))
69 self.txtDeviceA.setText(str(var_tmp[0]))
67 self.txtDeviceB.setText(str(var_tmp[1]))
70 self.txtDeviceB.setText(str(var_tmp[1]))
68 self.txtDeviceC.setText(str(var_tmp[2]))
71 self.txtDeviceC.setText(str(var_tmp[2]))
69 self.txtDeviceD.setText(str(var_tmp[3]))
72 self.txtDeviceD.setText(str(var_tmp[3]))
70 #Se desactivan los que no existen
73 #Se desactivan los que no existen
71 if len(var_tmp[0]) == 0 :
74 if len(var_tmp[0]) == 0 :
72 self.chkDevA.setChecked(False)
75 self.chkDevA.setChecked(False)
73 self.chkDevA.setEnabled(False)
76 self.chkDevA.setEnabled(False)
74 if len(var_tmp[1]) == 0 :
77 if len(var_tmp[1]) == 0 :
75 self.chkDevB.setChecked(False)
78 self.chkDevB.setChecked(False)
76 self.chkDevB.setEnabled(False)
79 self.chkDevB.setEnabled(False)
77 if len(var_tmp[2]) == 0 :
80 if len(var_tmp[2]) == 0 :
78 self.chkDevC.setChecked(False)
81 self.chkDevC.setChecked(False)
79 self.chkDevC.setEnabled(False)
82 self.chkDevC.setEnabled(False)
80 if len(var_tmp[3]) == 0 :
83 if len(var_tmp[3]) == 0 :
81 self.chkDevD.setChecked(False)
84 self.chkDevD.setChecked(False)
82 self.chkDevD.setEnabled(False)
85 self.chkDevD.setEnabled(False)
83
86
84
87
85 def write(self, txt):
88 def write(self, txt):
86 """
89 """
87 Escribe la salida estandar eb txtInfo
90 Escribe la salida estandar eb txtInfo
88 """
91 """
89 self.txtInfo.append(str(txt))
92 self.txtInfo.append(str(txt))
90
93
91
94
92 @pyqtSignature("")
95 @pyqtSignature("")
93 def on_btnDpath_clicked(self):
96 def on_btnDpath_clicked(self):
94 """
97 """
95 Permite seleccionar graficamente el direcorio de los datos a grabar
98 Permite seleccionar graficamente el direcorio de los datos a grabar
96 """
99 """
97 var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
100 var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
98 self.txtDpath.setText(var_Dpath)
101 self.txtDpath.setText(var_Dpath)
99
102
100 #llamada a funcion
103 #llamada a funcion
101 self.on_txtDpath_editingFinished()
104 self.on_txtDpath_editingFinished()
102
105
103
106
104 @pyqtSignature("")
107 @pyqtSignature("")
105 def on_btnRpath_clicked(self):
108 def on_btnRpath_clicked(self):
106 """
109 """
107 Permite seleccionar graficamente el direcorio del proyecto
110 Permite seleccionar graficamente el direcorio del proyecto
108 """
111 """
109 var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
112 var_Rpath = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
110 self.txtRpath.setText(var_Rpath)
113 self.txtRpath.setText(var_Rpath)
111
114
112 #llamada a funcion
115 #llamada a funcion
113 self.on_txtRpath_editingFinished()
116 self.on_txtRpath_editingFinished()
114
117
115
118
116 @pyqtSignature("")
119 @pyqtSignature("")
117 def on_txtDpath_editingFinished(self):
120 def on_txtDpath_editingFinished(self):
118 """
121 """
119 Permite buscar los archivos de extension seleccionada en la ruta de de datos
122 Permite buscar los archivos de extension seleccionada en la ruta de de datos
120 y cargar los valores para el rango de tiempo a ser grabado
123 y cargar los valores para el rango de tiempo a ser grabado
121 """
124 """
122
125
123 #Usando el modulo "subprocess", eric4 pide seleccion del tipo de subproceso (padre o hijo)
126 #Usando el modulo "subprocess", eric4 pide seleccion del tipo de subproceso (padre o hijo)
124 #por ello se prefiere usar el modulo "commands"
127 #por ello se prefiere usar el modulo "commands"
125 #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE)
128 #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE)
126 #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE)
129 #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE)
127 #output_p2= p2.communicate()[0]
130 #output_p2= p2.communicate()[0]
128 #self.txtInfo.setText(output_p2)
131 #self.txtInfo.setText(output_p2)
129
132
130 #Se carga la variable con la ruta de datos
133 #Se carga la variable con la ruta de datos
131 var_Dpath=self.txtDpath.text()
134 var_Dpath=self.txtDpath.text()
132
135
133 #Se verifica que la ruta exista y sea un directorio
136 #Se verifica que la ruta exista y sea un directorio
134 var_cmd="test -d "+str(var_Dpath)
137 var_cmd="test -d "+str(var_Dpath)
135 var_output=commands.getstatusoutput(var_cmd)[0]
138 var_output=commands.getstatusoutput(var_cmd)[0]
136 if var_output != 0:
139 if var_output != 0:
137 self.statusDpath = False
140 self.statusDpath = False
138 self.txtInfo.setText("Ruta no valida, output_error:" + str(var_output))
141 self.txtInfo.setText("Ruta no valida, output_error:" + str(var_output))
139 return
142 return
140 else:
143 else:
141 self.statusDpath = True
144 self.statusDpath = True
142 self.txtInfo.append("Ruta valida, sin error:" + str(var_Dpath))
145 self.txtInfo.append("Ruta valida, sin error:" + str(var_Dpath))
143
146
144 #Se buscan los archivos del tipo especificado
147 #Se buscan los archivos del tipo especificado
145 var_Dtype=self.txtDtype.text()
148 var_Dtype=self.txtDtype.text()
146 var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
149 var_cmd="find " + str(var_Dpath) + " -name *."+ str(var_Dtype) +" | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
147 output_p2=commands.getstatusoutput(var_cmd)[1]
150 output_p2=commands.getstatusoutput(var_cmd)[1]
148
151
149 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
152 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
150 self.var_list=[]
153 self.var_list=[]
151 for i in range(0, (len(output_p2)+1)/8):
154 for i in range(0, (len(output_p2)+1)/8):
152 self.var_list.append(output_p2[8*i:8*(i+1)-1])
155 self.var_list.append(output_p2[8*i:8*(i+1)-1])
153
156
154 self.lstStartDay.clear()
157 self.lstStartDay.clear()
155 self.lstStopDay.clear()
158 self.lstStopDay.clear()
156
159
157 for i in self.var_list:
160 for i in self.var_list:
158 self.lstStartDay.addItem(i)
161 self.lstStartDay.addItem(i)
159 self.lstStopDay.addItem(i)
162 self.lstStopDay.addItem(i)
160
163
161 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
164 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
162
165
163
166
164 @pyqtSignature("")
167 @pyqtSignature("")
165 def on_txtRpath_editingFinished(self):
168 def on_txtRpath_editingFinished(self):
166 """
169 """
167 Valida la ruta del proyecto
170 Valida la ruta del proyecto
168 """
171 """
169 #Se carga la variable con la ruta del proyecto
172 #Se carga la variable con la ruta del proyecto
170 var_Rpath=self.txtRpath.text()
173 var_Rpath=self.txtRpath.text()
171
174
172 #Se verifica que la ruta exista y sea un directorio
175 #Se verifica que la ruta exista y sea un directorio
173 var_cmd="test -d "+str(var_Rpath)
176 var_cmd="test -d "+str(var_Rpath)
174 var_output=commands.getstatusoutput(var_cmd)[0]
177 var_output=commands.getstatusoutput(var_cmd)[0]
175 if var_output != 0:
178 if var_output != 0:
176 self.statusRpath = False
179 self.statusRpath = False
177 self.txtInfo.append("Ruta no valida, output_error:" + str(var_output))
180 self.txtInfo.append("Ruta no valida, output_error:" + str(var_output))
178 return
181 return
179 else:
182 else:
180 self.statusRpath = True
183 self.statusRpath = True
181 self.txtInfo.append("Ruta valida, sin error:" + str(var_Rpath))
184 self.txtInfo.append("Ruta valida, sin error:" + str(var_Rpath))
182
185
183
186
184 @pyqtSignature("int")
187 @pyqtSignature("int")
185 def on_lstDtype_activated(self, index):
188 def on_lstDtype_activated(self, index):
186 """
189 """
187 Permite elegir entre los tipos de archivos
190 Permite elegir entre los tipos de archivos
188 """
191 """
189 if index == 0:
192 if index == 0:
190 var_type='r'
193 var_type='r'
191 elif index == 1:
194 elif index == 1:
192 var_type='pdata'
195 var_type='pdata'
193 elif index == 2:
196 elif index == 2:
194 var_type='sswma'
197 var_type='sswma'
195
198
196 if index != 3:
199 if index != 3:
197 self.txtDtype.setText(var_type)
200 self.txtDtype.setText(var_type)
198 self.txtDtype.setReadOnly(True)
201 self.txtDtype.setReadOnly(True)
199 self.on_txtDpath_editingFinished()
202 self.on_txtDpath_editingFinished()
200 else:
203 else:
201 self.txtDtype.setText('')
204 self.txtDtype.setText('')
202 self.txtDtype.setReadOnly(False)
205 self.txtDtype.setReadOnly(False)
203
206
204
207
205 @pyqtSignature("")
208 @pyqtSignature("")
206 def on_txtDtype_editingFinished(self):
209 def on_txtDtype_editingFinished(self):
207 """
210 """
208 Se activa cuando el tipo de archivo es ingresado manualmente
211 Se activa cuando el tipo de archivo es ingresado manualmente
209 """
212 """
210 #llamada a funcion
213 #llamada a funcion
211 self.on_txtDpath_editingFinished()
214 self.on_txtDpath_editingFinished()
212
215
213
216
214 @pyqtSignature("int") #CLOSED
217 @pyqtSignature("int") #CLOSED
215 def on_lstStartDay_activated(self, index):
218 def on_lstStartDay_activated(self, index):
216 """
219 """
217 Cambia la lista de opciones en lstStopDay
220 Cambia la lista de opciones en lstStopDay
218 """
221 """
219 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
222 var_StopDay_index=self.lstStopDay.count() - self.lstStopDay.currentIndex()
220 self.lstStopDay.clear()
223 self.lstStopDay.clear()
221
224
222 for i in self.var_list[index:]:
225 for i in self.var_list[index:]:
223 self.lstStopDay.addItem(i)
226 self.lstStopDay.addItem(i)
224
227
225 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
228 self.lstStopDay.setCurrentIndex(self.lstStopDay.count() - var_StopDay_index)
226
229
227
230
228 @pyqtSignature("int") #CLOSED
231 @pyqtSignature("int") #CLOSED
229 def on_lstStopDay_activated(self, index):
232 def on_lstStopDay_activated(self, index):
230 """
233 """
231 Cambia la lista de opciones en lstStartDay
234 Cambia la lista de opciones en lstStartDay
232 """
235 """
233 var_StartDay_index=self.lstStartDay.currentIndex()
236 var_StartDay_index=self.lstStartDay.currentIndex()
234 var_end_index = self.lstStopDay.count() - index
237 var_end_index = self.lstStopDay.count() - index
235 self.lstStartDay.clear()
238 self.lstStartDay.clear()
236
239
237 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
240 for i in self.var_list[:len(self.var_list) - var_end_index + 1]:
238 self.lstStartDay.addItem(i)
241 self.lstStartDay.addItem(i)
239
242
240 self.lstStartDay.setCurrentIndex(var_StartDay_index)
243 self.lstStartDay.setCurrentIndex(var_StartDay_index)
241
244
242
245
243 @pyqtSignature("int") #CLOSED
246 @pyqtSignature("int") #CLOSED
244 def on_lstDcapacity_activated(self, index):
247 def on_lstDcapacity_activated(self, index):
245 """
248 """
246 Permite elegir el tamaΓ±o del disco
249 Permite elegir el tamaΓ±o del disco
247 """
250 """
248 if index == 0:
251 if index == 0:
249 var_size=25.0
252 var_size=25.0
250 elif index == 1:
253 elif index == 1:
251 var_size=8.5
254 var_size=8.5
252 elif index == 2:
255 elif index == 2:
253 var_size=4.7
256 var_size=4.7
254 elif index == 3:
257 elif index == 3:
255 var_size=0.7
258 var_size=0.7
256
259
257 if index != 4:
260 if index != 4:
258 self.txtDcapacity.setText(str(var_size*10**9/1024**2))
261 self.txtDcapacity.setText(str(var_size*10**9/1024**2))
259 self.txtDcapacity.setReadOnly(True)
262 self.txtDcapacity.setReadOnly(True)
260 else:
263 else:
261 self.txtDcapacity.setText('')
264 self.txtDcapacity.setText('')
262 self.txtDcapacity.setReadOnly(False)
265 self.txtDcapacity.setReadOnly(False)
263
266
264
267
265 @pyqtSignature("")
268 @pyqtSignature("")
266 def on_btnGbkp_clicked(self):
269 def on_btnGbkp_clicked(self):
267 """
270 """
268 Cuando se presiona el boton btnGbkp
271 Cuando se presiona el boton btnGbkp
269 """
272 """
270
273
271 #Verifica que las rutas sean validas
274 #Verifica que las rutas sean validas
272 if self.statusDpath == False or self.statusRpath == False:
275 if self.statusDpath == False or self.statusRpath == False:
273 if self.statusDpath == False:
276 if self.statusDpath == False:
274 self.txtInfo.append("Ruta de datos no valida")
277 self.txtInfo.append("Ruta de datos no valida")
275 if self.statusRpath == False:
278 if self.statusRpath == False:
276 self.txtInfo.append("Ruta de proyecto no valida")
279 self.txtInfo.append("Ruta de proyecto no valida")
277 return
280 return
278
281
279 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
282 #Crea las carpetas en la ruta del proyecto y verifica que se crearon correctamente
280 var_Rpath=self.txtRpath.text()
283 var_Rpath=self.txtRpath.text()
281 var_dirs='/{gpath,iso,ppath}'
284 list_dirs=['gpath', 'iso', 'ppath']
282 var_cmd="mkdir -p "+str(var_Rpath)+str(var_dirs)
285 functions.make_dirs(var_Rpath, list_dirs, self)
283 var_output=commands.getstatusoutput(var_cmd)[0]
286
284 if var_output != 0:
285 self.txtInfo.append("No se pudieron crear los directorios, output_error:" + str(var_output))
286 return
287 else:
288 self.txtInfo.append('Carpetas creadas correctamente')
289
290 #Cargando variables con los parametros
287 #Cargando variables con los parametros
291 var_Dpath=self.txtDpath.text()
288 var_Dpath=self.txtDpath.text()
292 var_Rpath=self.txtRpath.text()
289 var_Rpath=self.txtRpath.text()
293 var_Rpath_ppath=var_Rpath+"/ppath" #Ruta de los archivos a grabar
290 var_Rpath_ppath=var_Rpath+"/ppath" #Ruta de los archivos a grabar
294 var_sublist=[]
291 var_sublist=[]
295 for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]:
292 for i in self.var_list[self.lstStartDay.currentIndex():self.lstStartDay.currentIndex() + self.lstStopDay.currentIndex()+1]:
296 var_sublist.append(i)
293 var_sublist.append(i)
297 if len(var_sublist) == 0:
294 if len(var_sublist) == 0:
298 self.txtInfo.append("No existen archivos encontrados")
295 self.txtInfo.append("No existen archivos encontrados")
299 return
296 return
300 #self.txtInfo.append('elementos: '+str(len(var_sublist)))
297 #self.txtInfo.append('elementos: '+str(len(var_sublist)))
301
298
302
299
303 var_Dtype=self.txtDtype.text()
300 var_Dtype=self.txtDtype.text()
304 var_Dcapacity=float(self.txtDcapacity.text())*1024 #tamaΓ±o en KB
301 var_Dcapacity=float(self.txtDcapacity.text())*1024 #tamaΓ±o en KB
305
302
306 #Busca los archivos con los parametros de busqueda
303 #Busca los archivos con los parametros de busqueda
307 var_files_list=[]
304 var_files_list=[]
308 for var_doy in var_sublist:
305 for var_doy in var_sublist:
309 var_cmd="find " + str(var_Dpath) + " -name ?"+var_doy+"???."+ str(var_Dtype) + " |sort"
306 var_cmd="find " + str(var_Dpath) + " -name ?"+var_doy+"???."+ str(var_Dtype) + " |sort"
310 var_output=commands.getstatusoutput(var_cmd)[1]
307 var_output=commands.getstatusoutput(var_cmd)[1]
311 for var_file in var_output.split():
308 for var_file in var_output.split():
312 var_files_list.append(var_file) #Almacena cada archivo en la lista
309 var_files_list.append(var_file) #Almacena cada archivo en la lista
313
310
314 #
311 #
315 #Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD
312 #Genera la lista de archivos .dat que contienen los archivos a grabar en cada DVD
316 #
313 #
317 var_n=0 #Numero del DVD actual
314 var_n=0 #Numero del DVD actual
318 var_tmp=0 #Se usa para acumulanr el tamaΓ±o de los archivos de la lista
315 var_tmp=0 #Se usa para acumulanr el tamaΓ±o de los archivos de la lista
319 var_files_list_2=[] #Se usa para almacenar la lista de archivos agrbar en cada DVD
316 var_files_list_2=[] #Se usa para almacenar la lista de archivos agrbar en cada DVD
320
317
321 for i in var_files_list: #Se asignan en i los archivos de la lista
318 for i in var_files_list: #Se asignan en i los archivos de la lista
322 var_size_i=os.path.getsize(i)/1024+1 #tamaΓ±o en KB del archivo de la lista, se suma 1 KB para evitar problemas al momento de sumar
319 var_size_i=os.path.getsize(i)/1024+1 #tamaΓ±o en KB del archivo de la lista, se suma 1 KB para evitar problemas al momento de sumar
323 var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista
320 var_tmp += var_size_i #Se acumulan el tamaΓ±o de los archivos de la lista
324
321
325 #Si el tamaΓ±o acumulado es mayor que el de el DVD
322 #Si el tamaΓ±o acumulado es mayor que el de el DVD
326 if var_tmp > var_Dcapacity:
323 if var_tmp > var_Dcapacity:
327 var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real
324 var_tmp -= var_size_i #se quita el tamaΓ±o sumado para mostrar el tamaΓ±o real
328 #se agregan los ceros necesarios
329 if len(str(var_n)) < 4:
330 var_n2=""
331 for k in range(0, 4-len(str(var_n))):
332 var_n2 = var_n2+"0"
333 #se crea un archivo con numeral en el sufijo y extension .dat
325 #se crea un archivo con numeral en el sufijo y extension .dat
334 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".dat","w")
326 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat","w")
335 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
327 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
336 for line in var_files_list_2:
328 for line in var_files_list_2:
337 var_tmp_path=(line.split(var_Dpath)[1]).split('/')
329 var_tmp_path=(line.split(var_Dpath)[1]).split('/')
338 var_tmp_path2="/"
330 var_tmp_path2="/"
339 for l in range(0, len(var_tmp_path)-1):
331 for l in range(0, len(var_tmp_path)-1):
340 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
332 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
341 var_file.write(var_tmp_path2+'=')
333 var_file.write(var_tmp_path2+'=')
342 var_file.write(line+'\n')
334 var_file.write(line+'\n')
343 var_file.close()
335 var_file.close()
344
336
345 var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual
337 var_tmp = var_size_i #Se asigna a la variable el tamaΓ±o del archivo actual
346 var_files_list_2=[] #Se reinicia la lista
338 var_files_list_2=[] #Se reinicia la lista
347 var_n += 1
339 var_n += 1
348 var_files_list_2.append(i)
340 var_files_list_2.append(i)
349
341
350 #se agregan los ceros necesarios
351 if len(str(var_n)) < 4:
352 var_n2=""
353 for k in range(0, 4-len(str(var_n))):
354 var_n2 = var_n2+"0"
355 #se crea un archivo con numeral en el sufijo y extension .dat
342 #se crea un archivo con numeral en el sufijo y extension .dat
356 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".dat","w")
343 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat","w")
357 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
344 #Se aΓ±ade la lista de archivos a grabar en el DVD al archivo .dat
358 for line in var_files_list_2:
345 for line in var_files_list_2:
359 var_tmp_path=(line.split(var_Dpath)[1]).split('/')
346 var_tmp_path=(line.split(var_Dpath)[1]).split('/')
360 var_tmp_path2="/"
347 var_tmp_path2="/"
361 for l in range(0, len(var_tmp_path)-1):
348 for l in range(0, len(var_tmp_path)-1):
362 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
349 var_tmp_path2=var_tmp_path2+str(var_tmp_path[l])+"/"
363 var_file.write(var_tmp_path2+'=')
350 var_file.write(var_tmp_path2+'=')
364 var_file.write(line+'\n')
351 var_file.write(line+'\n')
365 var_file.close()
352 var_file.close()
366
353
367 #
354 #
368 #Genera los archivos .print con los cuales se creara los postscript
355 #Genera los archivos .print con los cuales se creara los postscript
369 #
356 #
370 self.var_n_files = var_n # Numero del ultimo archivo .dat creado
357 self.var_n_files = var_n # Numero del ultimo archivo .dat creado
371 var_n = 0 # Se reinicia a cero y se usa para poder acceder a cada una de los archivos
358 var_n = 0 # Se reinicia a cero y se usa para poder acceder a cada una de los archivos
372
359
373 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps
360 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps
374 for var_n in range(0, self.var_n_files+1):
361 for var_n in range(0, self.var_n_files+1):
375 print var_n
362 print var_n
376
363
377 #se agregan los ceros necesarios
378 if len(str(var_n)) < 4:
379 var_n2=""
380 for k in range(0, 4-len(str(var_n))):
381 var_n2 = var_n2+"0"
382 #se abren los archivos .dat en modo lectura
364 #se abren los archivos .dat en modo lectura
383 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".dat","r")
365 var_file = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat","r")
384 lines=var_file.readlines() # Se lee las lineas en el archivo y se almacenan en la lista
366 lines=var_file.readlines() # Se lee las lineas en el archivo y se almacenan en la lista
385
367
386 # Se crea el archivo .print
368 # Se crea el archivo .print
387 var_file_print = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".print","w")
369 var_file_print = open(var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".print","w")
388 var_file_print.write(self.txtElabel.text()+" "+str(var_n2)+str(var_n)+"/"+str(self.var_n_files)+"\n")
370 var_file_print.write(self.txtElabel.text()+" "+str(var_n2)+str(var_n)+"/"+str(self.var_n_files)+"\n")
389 var_file_print.write("Year Doy Folder Set Time range\n")
371 var_file_print.write("Year Doy Folder Set Time range\n")
390
372
391 #Se crean los archivos .print con los cuales se crearan los archivos .ps
373 #Se crean los archivos .print con los cuales se crearan los archivos .ps
392 var_first_folder = lines[0].split('=')[0]
374 var_first_folder = lines[0].split('=')[0]
393 var_first_file = (lines[0].split('=')[1])[:-1]
375 var_first_file = (lines[0].split('=')[1])[:-1]
394 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1]
376 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1]
395
377
396 for j in range(1, len(lines)-1):
378 for j in range(1, len(lines)-1):
397 var_tmp_folder = lines[j].split('=')[0]
379 var_tmp_folder = lines[j].split('=')[0]
398 var_tmp_file = (lines[j].split('=')[1])[:-1]
380 var_tmp_file = (lines[j].split('=')[1])[:-1]
399
381
400 # Si el subfolder superior o la fecha del archivo cambia se genera una nueva linea
382 # Si el subfolder superior o la fecha del archivo cambia se genera una nueva linea
401 if (var_tmp_folder != var_first_folder) or (var_tmp_file[0:-5] != var_first_file[0:-5]):
383 if (var_tmp_folder != var_first_folder) or (var_tmp_file[0:-5] != var_first_file[0:-5]):
402
384
403 var_last_file = (lines[j-1].split('=')[1])[:-1]
385 var_last_file = (lines[j-1].split('=')[1])[:-1]
404 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1]
386 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1]
405 # Si el archivo se grabara directamente en la / del DVD y no en un /directorio/
387 # Si el archivo se grabara directamente en la / del DVD y no en un /directorio/
406 # se usa la etiqueta para indicar la parte de la etiqueta donde va el subdirectorio
388 # se usa la etiqueta para indicar la parte de la etiqueta donde va el subdirectorio
407 if var_first_folder == '/':
389 if var_first_folder == '/':
408 var_folder = self.txtElabel.text()
390 var_folder = self.txtElabel.text()
409 else:
391 else:
410 var_folder = var_first_folder.split('/')[1]
392 var_folder = var_first_folder.split('/')[1]
411
393
412 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
394 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
413 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
395 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
414
396
415 var_first_folder = lines[j].split('=')[0]
397 var_first_folder = lines[j].split('=')[0]
416 var_first_file = (lines[j].split('=')[1])[:-1]
398 var_first_file = (lines[j].split('=')[1])[:-1]
417 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1]
399 var_date_first_file=commands.getstatusoutput("date -r "+var_first_file+" +'%T'")[1]
418
400
419 var_last_file = (lines[-1].split('=')[1])[:-1]
401 var_last_file = (lines[-1].split('=')[1])[:-1]
420 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1]
402 var_date_last_file=commands.getstatusoutput("date -r "+var_last_file+" +'%T'")[1]
421
403
422 if var_first_folder == '/':
404 if var_first_folder == '/':
423 var_folder = self.txtElabel.text()
405 var_folder = self.txtElabel.text()
424 else:
406 else:
425 var_folder = var_first_folder.split('/')[1]
407 var_folder = var_first_folder.split('/')[1]
426
408
427 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
409 var_file_print.write(var_first_file[-12:-8]+" "+var_first_file[-8:-5]+" "+var_folder +" "+var_first_file[-5:-2]+" "
428 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
410 +var_last_file[-5:-2]+" "+var_date_first_file+" "+var_date_last_file+"\n")
429
411
430 var_file.close()
412 var_file.close()
431 var_file_print.close()
413 var_file_print.close()
432
414
433
415
434 #Se deshabilita el Tab Parameters y el boton btnGbkp
416 #Se deshabilita el Tab Parameters y el boton btnGbkp
435 self.tabParameters.setEnabled(False)
417 self.tabParameters.setEnabled(False)
436 self.btnGbkp.setEnabled(False)
418 self.btnGbkp.setEnabled(False)
437
419
438
420
439 @pyqtSignature("")
421 @pyqtSignature("")
440 def on_btnStartburn_clicked(self):
422 def on_btnStartburn_clicked(self):
441 """
423 """
442 Se inicia el proceso de grabacion
424 Se inicia el proceso de grabacion
443 """
425 """
444 sys.stdout = self
426 sys.stdout = self
445 #sys.stderr = self
427 #sys.stderr = self
446 print "stdout_!!!"
428 print "stdout_!!!"
447
429
448 #Inicializando variables
430 #Inicializando variables
449 var_Rpath=self.txtRpath.text()
431 var_Rpath=self.txtRpath.text()
450 var_Rpath_ppath=var_Rpath+"/ppath"
432 var_Rpath_ppath=var_Rpath+"/ppath"
451 var_Rpath_iso=var_Rpath+"/iso"
433 var_Rpath_iso=var_Rpath+"/iso"
452 var_label=self.txtElabel.text()
434 var_label=self.txtElabel.text()
453
435
454 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps
436 # Se leen todos los archivos .dat creados para crear las etiquetas en los archivos .ps
455 for var_n in range(0, self.var_n_files+1):
437 for var_n in range(0, self.var_n_files+1):
456 print var_n
438 print var_n
457
439
458 #se agregan los ceros necesarios
459 if len(str(var_n)) < 4:
460 var_n2=""
461 for k in range(0, 4-len(str(var_n))):
462 var_n2 = var_n2+"0"
463
464 file_iso=var_Rpath_iso+"/"+var_n2+str(var_n)+".iso"
440 file_iso=var_Rpath_iso+"/"+var_n2+str(var_n)+".iso"
465 file_dat=var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+str(var_n2)+str(var_n)+".dat"
441 file_dat=var_Rpath_ppath+"/"+self.txtElabel.text()+"_"+functions.i2s(var_n)+".dat"
466
442
467 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
443 var_cmd = 'genisoimage -hide-joliet-trans-tbl -joliet-long -r '
468 var_cmd += ' -A '+var_label+' -V '+var_label
444 var_cmd += ' -A '+var_label+' -V '+var_label
469 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
445 var_cmd += ' -graft-points -path-list '+ file_dat+' -o '+file_iso
470 self.txtInfo.append(var_cmd)
446 self.txtInfo.append(var_cmd)
471
447
472 var_output=commands.getstatusoutput(str(var_cmd))[0]
448 var_output=commands.getstatusoutput(str(var_cmd))[0]
473 self.txtInfo.append(str(var_output))
449 self.txtInfo.append(str(var_output))
474
450
475 #os.system(str(var_cmd))
451 #os.system(str(var_cmd))
476 #p = subprocess.Popen(str('ls /'), shell=True, stdout=self)
452 #p = subprocess.Popen(str('ls /'), shell=True, stdout=self)
477 #os.waitpid(p.pid, 0)
453 #os.waitpid(p.pid, 0)
478 ####self.txtInfo.append(str(p.pid))
454 ####self.txtInfo.append(str(p.pid))
479
455
480
456
481
457
482 @pyqtSignature("")
458 @pyqtSignature("")
483 def on_btnRestart_clicked(self):
459 def on_btnRestart_clicked(self):
484 """
460 """
485 Slot documentation goes here.
461 Slot documentation goes here.
486 """
462 """
487 self.tabParameters.setEnabled(True)
463 self.tabParameters.setEnabled(True)
488 self.btnGbkp.setEnabled(True)
464 self.btnGbkp.setEnabled(True)
489
465
490 @pyqtSignature("")
466 @pyqtSignature("")
491 def on_btnTdevA_clicked(self):
467 def on_btnTdevA_clicked(self):
492 var_dev = str(self.txtDeviceA.text())
468 var_dev = str(self.txtDeviceA.text())
493 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
469 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
494 commands.getstatusoutput(var_cmd)
470 commands.getstatusoutput(var_cmd)
495
471
496 @pyqtSignature("")
472 @pyqtSignature("")
497 def on_btnTdevB_clicked(self):
473 def on_btnTdevB_clicked(self):
498 var_dev = str(self.txtDeviceB.text())
474 var_dev = str(self.txtDeviceB.text())
499 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
475 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
500 commands.getstatusoutput(var_cmd)
476 commands.getstatusoutput(var_cmd)
501
477
502 @pyqtSignature("")
478 @pyqtSignature("")
503 def on_btnTdevC_clicked(self):
479 def on_btnTdevC_clicked(self):
504 var_dev = str(self.txtDeviceC.text())
480 var_dev = str(self.txtDeviceC.text())
505 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
481 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
506 commands.getstatusoutput(var_cmd)
482 commands.getstatusoutput(var_cmd)
507
483
508 @pyqtSignature("")
484 @pyqtSignature("")
509 def on_btnTdevD_clicked(self):
485 def on_btnTdevD_clicked(self):
510 var_dev = str(self.txtDeviceD.text())
486 var_dev = str(self.txtDeviceD.text())
511 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
487 var_cmd = 'eject ' + var_dev + '; eject -t ' + var_dev
512 commands.getstatusoutput(var_cmd)
488 commands.getstatusoutput(var_cmd)
General Comments 0
You need to be logged in to leave comments. Login now