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