-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock_run.py
46 lines (32 loc) · 966 Bytes
/
mock_run.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
import getopt
import sys
# import wx
from names import Names
from devices import Devices
from network import Network
from monitors import Monitors
from scanner import Scanner
from parse import Parser
from userint import UserInterface
# from gui import Gui
# Workaround to stop Python stealing _ for translations
# Necessary for tests to work
import sys
import wx
import builtins
def _hook(obj):
if obj is not None:
print(repr(obj))
builtins.__dict__['_'] = wx.GetTranslation
sys.displayhook = _hook
names = Names()
devices = Devices(names)
network = Network(names, devices)
monitors = Monitors(names, devices, network)
path = 'example_files/binary_counter.txt'
scanner = Scanner(path, names)
parser = Parser(names, devices, network, monitors, scanner)
if parser.parse_network():
# Initialise an instance of the userint.UserInterface() class
userint = UserInterface(names, devices, network, monitors)
userint.command_interface()