Last change
on this file since 315 was
276,
checked in by sc, 10 years ago
|
Puzzlebox Synapse:
- split out into separate repository from Puzzlebox Brainstorms
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | # Copyright Puzzlebox Productions, LLC (2010) |
---|
5 | # |
---|
6 | # This code is released under the GNU Pulic License (GPL) version 2 |
---|
7 | # For more information please refer to http://www.gnu.org/copyleft/gpl.html |
---|
8 | |
---|
9 | import Puzzlebox.Synapse.Protocol as tgProtocol |
---|
10 | import Puzzlebox.Synapse.Configuration as tgConf |
---|
11 | import signal, sys |
---|
12 | |
---|
13 | try: |
---|
14 | import PySide as PyQt4 |
---|
15 | from PySide import QtCore |
---|
16 | except: |
---|
17 | print "Using PyQt4 module" |
---|
18 | from PyQt4 import QtCore |
---|
19 | else: |
---|
20 | print "Using PySide module" |
---|
21 | |
---|
22 | signal.signal(signal.SIGINT, signal.SIG_DFL) |
---|
23 | |
---|
24 | log = None |
---|
25 | DEBUG = 2 |
---|
26 | |
---|
27 | device_address = None |
---|
28 | |
---|
29 | for each in sys.argv: |
---|
30 | if each.startswith("--device="): |
---|
31 | device_address = each[ len("--device="): ] |
---|
32 | |
---|
33 | if device_address == None: |
---|
34 | if tgConf.THINKGEAR_DEVICE_BLUETOOTH_ADDRESS == '': |
---|
35 | device_address = tgConf.THINKGEAR_DEVICE_SERIAL_PORT |
---|
36 | else: |
---|
37 | device_address = tgConf.THINKGEAR_DEVICE_BLUETOOTH_ADDRESS |
---|
38 | |
---|
39 | app = QtCore.QCoreApplication(sys.argv) |
---|
40 | serial_device = tgProtocol.SerialDevice(log, device_address, DEBUG=DEBUG) |
---|
41 | protocol = tgProtocol.ProtocolHandler(log, serial_device, DEBUG=DEBUG) |
---|
42 | protocol.start() |
---|
43 | serial_device.run() |
---|
Note: See
TracBrowser
for help on using the repository browser.