##// END OF EJS Templates
***
ralonso -
r9:10
parent child
Show More
@@ -1,74 +1,74
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 subprocess No newline at end of file
13 #import subprocess
14 import commands No newline at end of file
14 import commands
15 No newline at end of file
15
16 class MainWindow(QMainWindow, Ui_MainWindow): No newline at end of file
16 class MainWindow(QMainWindow, Ui_MainWindow):
17 """ No newline at end of file
17 """
18 Class documentation goes here. No newline at end of file
18 Class documentation goes here.
19 """ No newline at end of file
19 """
20 def __init__(self, parent = None): No newline at end of file
20 def __init__(self, parent = None):
21 QMainWindow.__init__(self, parent) No newline at end of file
21 QMainWindow.__init__(self, parent)
22 self.setupUi(self) No newline at end of file
22 self.setupUi(self)
23 No newline at end of file
23
24 @pyqtSignature("") No newline at end of file
24 @pyqtSignature("")
25 def on_btnDpath_clicked(self): No newline at end of file
25 def on_btnDpath_clicked(self):
26 """ No newline at end of file
26 """
27 Slot documentation goes here. No newline at end of file
27 Slot documentation goes here.
28 """ No newline at end of file
28 """
29 var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) No newline at end of file
29 var_Dpath= QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
30 self.txtDpath.setText(var_Dpath) No newline at end of file
30 self.txtDpath.setText(var_Dpath)
31 self.on_txtDpath_editingFinished() No newline at end of file
31 self.on_txtDpath_editingFinished()
32 No newline at end of file
32
33 @pyqtSignature("") No newline at end of file
33 @pyqtSignature("")
34 def on_btnRpath_clicked(self): No newline at end of file
34 def on_btnRpath_clicked(self):
35 """ No newline at end of file
35 """
36 Slot documentation goes here. No newline at end of file
36 Slot documentation goes here.
37 """ No newline at end of file
37 """
38 filename = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly) No newline at end of file
38 filename = QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)
39 self.txtRpath.setText(filename) No newline at end of file
39 self.txtRpath.setText(filename)
40 No newline at end of file
40
41 # TODO: not implemented yet No newline at end of file
41 # TODO: not implemented yet
42 # raise NotImplementedError No newline at end of file
42 # raise NotImplementedError
43 No newline at end of file
43
44 @pyqtSignature("") No newline at end of file
44 @pyqtSignature("")
45 def on_txtDpath_editingFinished(self): No newline at end of file
45 def on_txtDpath_editingFinished(self):
46 No newline at end of file
46
47 var_Dpath=self.txtDpath.text() No newline at end of file
47 var_Dpath=self.txtDpath.text()
48 No newline at end of file
48
49 #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo) No newline at end of file
49 #Usando el modulo "subprocess" eric4 pide seleccion del tipo de subproceso (padre o hijo)
50 #por ello se prefiere usar el modulo "commands" No newline at end of file
50 #por ello se prefiere usar el modulo "commands"
51 #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE) No newline at end of file
51 #p1= Popen(['find', var_Dpath, '-name', '*.r'], stdout=PIPE)
52 #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE) No newline at end of file
52 #p2= Popen(['awk', '-F/', '{print substr($NF,2,7)}'], stdin=p1.stdout, stdout=PIPE)
53 #output_p2= p2.communicate()[0] No newline at end of file
53 #output_p2= p2.communicate()[0]
54 #self.txtInfo.setText(output_p2) No newline at end of file
54 #self.txtInfo.setText(output_p2)
55 No newline at end of file
55
56 var_cmd="find " + str(var_Dpath) + " -name *.r | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
56 var_cmd="find " + str(var_Dpath) + " -name *.r | awk -F/ '{print substr($NF,2,7)}' | sort| uniq"
No newline at end of file
57 output_p2=commands.getstatusoutput(var_cmd)[1] No newline at end of file
57 output_p2=commands.getstatusoutput(var_cmd)[] No newline at end of file
58 No newline at end of file
58
59 self.txtInfo.setText(output_p2) No newline at end of file
59 self.txtInfo.setText(output_p2)
60 No newline at end of file
60
61 var_list=[] No newline at end of file
61 var_list=[]
62 for i in range(0, (len(output_p2)+1)/8): No newline at end of file
62 for i in range(0, (len(output_p2)+1)/8):
63 var_list.append(output_p2[8*i:8*(i+1)-1]) No newline at end of file
63 var_list.append(output_p2[8*i:8*(i+1)-1])
64 No newline at end of file
64
65 self.lstStartDay.clear() No newline at end of file
65 self.lstStartDay.clear()
66 self.lstStopDay.clear() No newline at end of file
66 self.lstStopDay.clear()
67 No newline at end of file
67
68 for i in var_list: No newline at end of file
68 for i in var_list:
69 self.lstStartDay.addItem(i) No newline at end of file
69 self.lstStartDay.addItem(i)
70 self.lstStopDay.addItem(i) No newline at end of file
70 self.lstStopDay.addItem(i)
71 No newline at end of file
71
72 self.txtInfo.setText(str(self.lstStartDay.count())) No newline at end of file
72 self.txtInfo.setText(str(self.lstStartDay.count()))
73 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1) No newline at end of file
73 self.lstStopDay.setCurrentIndex(self.lstStartDay.count()-1)
74 No newline at end of file
74
General Comments 0
You need to be logged in to leave comments. Login now