Skip to content

Commit 915e689

Browse files
committed
Refactor code and structure.
1 parent 018d47c commit 915e689

File tree

5 files changed

+14
-124
lines changed

5 files changed

+14
-124
lines changed

informer.py

100644100755
+11-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
"""
1111

1212
import sys
13+
import os
1314

14-
from PyQt4 import QtGui
15+
from PyQt4 import QtGui, QtCore
1516

16-
from parser.vlt_parser import VltParser
17+
from parsers.vlt_parser import VltParser
1718

1819

1920
class QtInformer(QtGui.QWidget):
@@ -28,6 +29,11 @@ def __init__(self, THREAD_PARSER):
2829
def initUI(self):
2930
self.setGeometry(1000, 200, 350, 550)
3031
self.setWindowTitle("Informer's main window")
32+
self.setWindowIcon(QtGui.QIcon(os.path.dirname(os.path.realpath(__file__)) +
33+
'/call.png'))
34+
self.btn = QtGui.QPushButton('Button', self)
35+
self.connect(self.btn, QtCore.SIGNAL("clicked()"), self.clicked)
36+
self.btn.setToolTip('This is a <b>QPushButton</b> widget')
3137
self.show()
3238

3339
def closeEvent(self, event):
@@ -43,6 +49,9 @@ def closeEvent(self, event):
4349
else:
4450
event.ignore()
4551

52+
def clicked(self):
53+
QtGui.QMessageBox.about(self, 'Socket availability', str(self.THREAD_PARSER.tn.sock_avail()), )
54+
4655

4756
def qtWindow(THREAD_PARSER):
4857
app = QtGui.QApplication(sys.argv)

parser/__init__.py

-1
This file was deleted.

parser/vlt_parser.py

-120
This file was deleted.

test_informer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import unittest
2-
from parser.vlt_parser import VltParser
2+
from parsers.vlt_parser import VltParser
33

44

55
test_str = 'Welcome to \r\nMandriva Linux release 2007.0 (Official) for x86_64\r\nKernel 2.6.22 on a Dual-processor x86_64\r\n NCEN=VELTON/12-12-05/16 H 57 IDENTIFICATION OF MALICIOUS CALLS\r\r\n ND-DE = 577177736 NE-DE = 001-10-127\r\r\n ND-DR = 952357487 AFCT-DR = 222-038-08\r\r\n\r\n'

viewer/notify.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# coding=utf-8
2+
13
from tkinter import Tk, Frame, Button
24
#import smtplib
35

0 commit comments

Comments
 (0)