-
Notifications
You must be signed in to change notification settings - Fork 2
/
ui_pyipfinder.py
142 lines (130 loc) · 6.88 KB
/
ui_pyipfinder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyipfinder.ui'
#
# Created: Fri Jun 26 12:11:08 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import subprocess,getpass
try:
from QLed import QLed
except ImportError:
p = subprocess.Popen(['python','setup.py','install','--user'],cwd="QLed")
p.wait()
username = getpass.getuser()
subprocess.call(["chmod", "755","-R", "/home/"+ username + "/.python-eggs"])
try:
import QLed
except ImportError:
try:
username = getpass.getuser()
if username != 'root':
sys.path.insert(0,'/home/' + username + '/.local/lib/python2.7/site-packages')
sys.path.insert(1,'/root/.local/lib/python2.7/site-packages')
import QLed
except:
print "Couldnt detect QLed! Relaunch please!\n"
exit(1)
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(370, 284)
MainWindow.setMaximumSize(QtCore.QSize(420, 16777215))
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setMaximumSize(QtCore.QSize(380, 16777215))
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.verticalLayout_2 = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
self.formLayout = QtGui.QFormLayout()
self.formLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize)
self.formLayout.setObjectName(_fromUtf8("formLayout"))
self.scrollArea = QtGui.QScrollArea(self.centralwidget)
self.scrollArea.setMinimumSize(QtCore.QSize(350, 150))
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
self.scrollAreaWidgetContents = QtGui.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 344, 229))
self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
self.verticalLayout_4 = QtGui.QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
self.verticalLayout = QtGui.QVBoxLayout()
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.deviceNumbertext = QtGui.QLabel(self.scrollAreaWidgetContents)
self.deviceNumbertext.setObjectName(_fromUtf8("deviceNumbertext"))
self.verticalLayout.addWidget(self.deviceNumbertext)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.graphicsView = QtGui.QGraphicsView(self.scrollAreaWidgetContents)
self.graphicsView.setMinimumSize(QtCore.QSize(150, 170))
self.graphicsView.setMaximumSize(QtCore.QSize(150, 16777215))
self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
self.horizontalLayout.addWidget(self.graphicsView)
self.verticalLayout_3 = QtGui.QVBoxLayout()
self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
self.label_2 = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.verticalLayout_3.addWidget(self.label_2)
self.label = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label.setObjectName(_fromUtf8("label"))
self.verticalLayout_3.addWidget(self.label)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.pushButton = QtGui.QPushButton(self.scrollAreaWidgetContents)
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.horizontalLayout_2.addWidget(self.pushButton)
self.kled = QLed(self.scrollAreaWidgetContents,onColour=QLed.Red,shape=QLed.Circle)
self.horizontalLayout_2.addWidget(self.kled)
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
self.horizontalLayout.addLayout(self.verticalLayout_3)
self.verticalLayout.addLayout(self.horizontalLayout)
self.line = QtGui.QFrame(self.scrollAreaWidgetContents)
self.line.setFrameShape(QtGui.QFrame.HLine)
self.line.setFrameShadow(QtGui.QFrame.Sunken)
self.line.setObjectName(_fromUtf8("line"))
self.verticalLayout.addWidget(self.line)
self.verticalLayout_4.addLayout(self.verticalLayout)
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.scrollArea)
self.verticalLayout_2.addLayout(self.formLayout)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 370, 20))
self.menubar.setObjectName(_fromUtf8("menubar"))
self.menuFile = QtGui.QMenu(self.menubar)
self.menuFile.setObjectName(_fromUtf8("menuFile"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)
self.actionRescan = QtGui.QAction(MainWindow)
self.actionRescan.setObjectName(_fromUtf8("actionRescan"))
self.actionQuit = QtGui.QAction(MainWindow)
self.actionQuit.setObjectName(_fromUtf8("actionQuit"))
self.menuFile.addAction(self.actionRescan)
self.menuFile.addAction(self.actionQuit)
self.menubar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QObject.connect(self.actionQuit, QtCore.SIGNAL(_fromUtf8("activated()")), MainWindow.close)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
self.deviceNumbertext.setText(_translate("MainWindow", "Found 0 device", None))
self.label_2.setText(_translate("MainWindow", "Ip adress : ", None))
self.label.setText(_translate("MainWindow", "MAC Address :", None))
self.pushButton.setText(_translate("MainWindow", "PingButton", None))
self.menuFile.setTitle(_translate("MainWindow", "File", None))
self.actionRescan.setText(_translate("MainWindow", "Rescan", None))
self.actionQuit.setText(_translate("MainWindow", "Quit", None))