##// END OF EJS Templates
mas funciones implementadas y control de botones paso a paso parte 1
ralonso -
r43:44
parent child
Show More
@@ -1,3 +1,5
1 # -*- coding: utf-8 -*-
No newline at end of file
2 No newline at end of file
1 #class BKmanager: No newline at end of file
3 #class BKmanager:
2 # def __init__(self): No newline at end of file
4 # def __init__(self):
3 No newline at end of file
5
@@ -1,3 +1,6
1 # -*- coding: utf-8 -*-
No newline at end of file
2
No newline at end of file
3 No newline at end of file
1 from subprocess import * No newline at end of file
4 from subprocess import *
2 import sys No newline at end of file
5 import sys
3 import os No newline at end of file
6 import os
@@ -1,7 +1,7
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, 23:51:59 --> No newline at end of file
4 <!-- Saved: 2010-05-16, 21:21:21 --> 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>
@@ -25,65 +25,24
25 QMainWindow.__init__(self, parent) No newline at end of file
25 QMainWindow.__init__(self, parent)
26 self.setupUi(self) No newline at end of file
26 self.setupUi(self)
27 self.setupUi2()
27 self.setupUi2()
No newline at end of file
28 sys.stdout = self #redirige salida estandar No newline at end of file
28
No newline at end of file
29 #redirige salida estandar
No newline at end of file
30 sys.stdout = self
No newline at end of file
31 No newline at end of file
32 No newline at end of file
29
33 def setupUi2(self):
30 def setupUi2(self):
No newline at end of file
31
34 """
No newline at end of file
No newline at end of file
32 self.var_Dpath = self.txtDpath.text()
35 Se usa para inicializar ciertos parametros para pruebas
No newline at end of file
No newline at end of file
33 self.var_Rpath = self.txtRpath.text()
36 """
No newline at end of file
No newline at end of file
34 self.statusDpath = False
37 #self.txtDpath.setText('/home/ricardoar/optional/STORAGE/Data/RAW_EXP/JASMET/')
No newline at end of file
No newline at end of file
35 self.statusRpath = False
38 #self.txtRpath.setText('/home/ricardoar/optional/STORAGE/prueba1_jro_backup_manager/')
No newline at end of file
No newline at end of file
36
39 self.txtDpath.setText('/home/ricardoar/optional/STORAGE/EW_DRIFTS/')
No newline at end of file
No newline at end of file
37 self.var_Dtype = self.txtDtype.text()
40 self.txtRpath.setText('/home/ricardoar/optional/prueba1_jro_backup_manager/')
No newline at end of file
No newline at end of file
38 self.var_Elabel = self.txtElabel.text()
41 self.txtElabel.setText('EW_DRIFTS')
No newline at end of file
No newline at end of file
39 self.var_Copys = self.txtCopys.value()
42 self.statusDpath = True
No newline at end of file
No newline at end of file
40 No newline at end of file
43 self.statusRpath = True No newline at end of file
44 self.var_n_files=0
41 self.var_n_files=0
No newline at end of file
42 self.var_list=[]
45 # self.statusDpath = False
No newline at end of file
No newline at end of file
43
46 # self.statusRpath = False
No newline at end of file
No newline at end of file
44 functions2.set_parameters(self) #Establece ciertos parametros, para pruebas
47
No newline at end of file
No newline at end of file
45 functions2.detect_devices(self) #busca los dispositivos de grabacion No newline at end of file
48
No newline at end of file
49 #
No newline at end of file
50 #Deteccion de los dispositvos de grabacion
No newline at end of file
51 #
No newline at end of file
52 #var_cmd="wodim --devices | grep /dev/ | awk -F\' '{print $2}'" #Funciona en consola pero no en python ¿?
No newline at end of file
53 var_cmd="wodim --devices | grep /dev/ | awk '{print $2}' | awk -F= '{print $2}'"
No newline at end of file
54 var_output = commands.getstatusoutput(var_cmd)
No newline at end of file
55 if var_output[0] != 0:
No newline at end of file
56 self.txtInfo.setText("No se pudo encontrar los dispositivos de grabacion, output_error:" + str(var_output))
No newline at end of file
57 else:
No newline at end of file
58 self.txtInfo.append("dispositivos encontrados")
No newline at end of file
59 var_devices = var_output[1].split('\n')
No newline at end of file
60
No newline at end of file
61 var_tmp=[]
No newline at end of file
62 for i in range(0, 4):
No newline at end of file
63 if i < len(var_devices):
No newline at end of file
64 var_len = len(var_devices[i])
No newline at end of file
65 var_tmp.append(var_devices[i][1:var_len - 1])
No newline at end of file
66 else:
No newline at end of file
67 var_tmp.append('')
No newline at end of file
68
No newline at end of file
69 #Se escriben los dispostivos correspodientes, si existen
No newline at end of file
70 self.txtDeviceA.setText(str(var_tmp[0]))
No newline at end of file
71 self.txtDeviceB.setText(str(var_tmp[1]))
No newline at end of file
72 self.txtDeviceC.setText(str(var_tmp[2]))
No newline at end of file
73 self.txtDeviceD.setText(str(var_tmp[3]))
No newline at end of file
74 #Se desactivan los que no existen
No newline at end of file
75 if len(var_tmp[0]) == 0 :
No newline at end of file
76 self.chkDevA.setChecked(False)
No newline at end of file
77 self.chkDevA.setEnabled(False)
No newline at end of file
78 if len(var_tmp[1]) == 0 :
No newline at end of file
79 self.chkDevB.setChecked(False)
No newline at end of file
80 self.chkDevB.setEnabled(False)
No newline at end of file
81 if len(var_tmp[2]) == 0 :
No newline at end of file
82 self.chkDevC.setChecked(False)
No newline at end of file
83 self.chkDevC.setEnabled(False)
No newline at end of file
84 if len(var_tmp[3]) == 0 :
No newline at end of file
85 self.chkDevD.setChecked(False)
No newline at end of file
86 self.chkDevD.setEnabled(False) No newline at end of file
87 No newline at end of file
46
88 No newline at end of file
47
89 def write(self, txt): No newline at end of file
48 def write(self, txt):
@@ -6,7 +6,7
6 <rect> No newline at end of file
6 <rect>
7 <x>0</x> No newline at end of file
7 <x>0</x>
8 <y>0</y>
8 <y>0</y>
No newline at end of file
9 <width>754</width> No newline at end of file
9 <width>809</width> No newline at end of file
10 <height>737</height> No newline at end of file
10 <height>737</height>
11 </rect> No newline at end of file
11 </rect>
12 </property> No newline at end of file
12 </property>
@@ -2,7 +2,7
2 No newline at end of file
2
3 # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui' No newline at end of file
3 # Form implementation generated from reading ui file '/home/ricardoar/JRO_SVN/eric4/jro_backup_manager/ui/MainWindow.ui'
4 #
4 #
No newline at end of file
5 # Created: Sun May 16 22:58:10 2010 No newline at end of file
5 # Created: Sun May 16 20:10:40 2010 No newline at end of file
6 # by: PyQt4 UI code generator 4.7.2 No newline at end of file
6 # by: PyQt4 UI code generator 4.7.2
7 # No newline at end of file
7 #
8 # WARNING! All changes made in this file will be lost! No newline at end of file
8 # WARNING! All changes made in this file will be lost!
General Comments 0
You need to be logged in to leave comments. Login now