source: trunk/synapse/synapse-server.py @ 200

Last change on this file since 200 was 163, checked in by sc, 11 years ago
  • Merge of code from repackaging by John Schutte <g.john.schutte@…>
  • Property svn:executable set to *
File size: 1.2 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
9import Puzzlebox.Synapse.Server as tgServer
10import Puzzlebox.Synapse.Configuration as tgConf
11
12import sys, signal
13
14try:
15        import PySide as PyQt4
16        from PySide import QtCore
17except:
18        print "Using PyQt4 module"
19        from PyQt4 import QtCore
20else:
21        print "Using PySide module"
22
23# Perform correct KeyboardInterrupt handling
24signal.signal(signal.SIGINT, signal.SIG_DFL)
25log = None
26
27server_interface = tgConf.THINKGEAR_SERVER_INTERFACE
28server_port = tgConf.THINKGEAR_SERVER_PORT
29device_address = tgConf.THINKGEAR_DEVICE_SERIAL_PORT
30
31for each in sys.argv:
32        if each.startswith("--interface="):
33                server_interface = each[ len("--interface="): ]
34        if each.startswith("--port="):
35                server_port = each[ len("--port="): ]
36        if each.startswith("--device="):
37                device_address = each[ len("--device="): ]
38
39app = QtCore.QCoreApplication(sys.argv)
40server = tgServer.ThinkgearServer(log, server_interface, server_port, device_address, emulate_headset_data = tgConf.THINKGEAR_ENABLE_SIMULATE_HEADSET_DATA, DEBUG=1)
41server.start()
42sys.exit(app.exec_())
Note: See TracBrowser for help on using the repository browser.