-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorbit-gui.py
More file actions
executable file
·104 lines (76 loc) · 2.78 KB
/
orbit-gui.py
File metadata and controls
executable file
·104 lines (76 loc) · 2.78 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Puzzlebox - Orbit - Interface - GUI
#
# Copyright Puzzlebox Productions, LLC (2013-2014)
__changelog__ = """\
Last Update: 2014.02.23
"""
__doc__ = """|
Linux Examples:
#hcitool scan # Find devices
#sdptool search sp D0:DF:9A:69:5D:42 # Examine serial services on device
#hciconfig hci0 sspmode 0 # ignore this step as device seems to work with sspmode enabled
rfcomm bind rfcomm0 D0:DF:9A:69:5D:42 1 # bind /dev/rfcomm0 to channel 1 on device
rfcomm release D0:DF:9A:69:5D:42 # disconnect device
"""
import os, sys
import signal
if ('_MEIPASS2' in os.environ.keys()):
sys.path.insert(0, os.environ['_MEIPASS2'])
os.chdir(os.environ['_MEIPASS2'])
if (sys.platform == 'darwin'):
pass
import Puzzlebox.Orbit.Configuration as configuration
if configuration.ENABLE_PYSIDE:
try:
#import PySide as PyQt4
from PySide import QtCore, QtGui, QtNetwork
except Exception, e:
print "ERROR: Exception importing PySide:",
print e
configuration.ENABLE_PYSIDE = False
else:
print "INFO: [Orbit:orbit-gui] Using PySide module"
if not configuration.ENABLE_PYSIDE:
print "INFO: [Orbit:orbit-gui] Using PyQt4 module"
from PyQt4 import QtCore, QtGui, QtNetwork
import Puzzlebox.Orbit.Interface as interface
#import puzzlebox_logger
#####################################################################
# Globals
#####################################################################
DEBUG = 1
#####################################################################
# Classes
#####################################################################
#####################################################################
# Functions
#####################################################################
#####################################################################
# Main
#####################################################################
if __name__ == '__main__':
# Perform correct KeyboardInterrupt handling
signal.signal(signal.SIGINT, signal.SIG_DFL)
#log = puzzlebox_logger.puzzlebox_logger(logfile='client_interface')
log = None
# Collect default settings and command line parameters
#server_interface = SERVER_INTERFACE
#server_host = SERVER_HOST
#server_port = SERVER_PORT
for each in sys.argv:
if each.startswith("--interface="):
server_interface = each[ len("--interface="): ]
if each.startswith("--host="):
server_host = each[ len("--host="): ]
if each.startswith("--port="):
server_port = each[ len("--port="): ]
app = QtGui.QApplication(sys.argv)
QtGui.QApplication.setApplicationName('puzzlebox-orbit')
window = interface.puzzlebox_orbit_interface(log, \
#server=server, \
DEBUG=DEBUG)
window.show()
sys.exit(app.exec_())