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