-
Notifications
You must be signed in to change notification settings - Fork 0
/
VDHApp.py
36 lines (26 loc) · 989 Bytes
/
VDHApp.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
import sys
import logging
from VirtualDeviceHost import VirtualDeviceHost
class VDHApp:
def __init__(self):
logging.basicConfig(level=logging.INFO)
# logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) < 2:
logging.error('ERROR: Invalid configuration. Enter active configuration as command line argument.')
return
virtual_device_host = VirtualDeviceHost()
logging.info('active configuration: ' + sys.argv[1])
virtual_device_host.initialize(sys.argv[1])
virtual_device_host.start()
logging.info('VirtualDeviceHost now running')
logging.info('Press ENTER to exit...')
if len(sys.argv) >= 3 and sys.argv[2] == '-background':
while True:
pass
else:
logging.info('Press ENTER to exit...')
input()
virtual_device_host.stop()
logging.info('Exiting')
if __name__ == '__main__':
app = VDHApp()