source: trunk/synapse-client.py @ 353

Last change on this file since 353 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.0 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.Client as tgClient
10import Puzzlebox.Synapse.Configuration as tgConf
11import sys, signal
12
13try:
14        import PySide as PyQt4
15        from PySide import QtCore
16except:
17        print "Using PyQt4 module"
18        from PyQt4 import QtCore
19else:
20        print "Using PySide module"
21
22
23signal.signal(signal.SIGINT, signal.SIG_DFL)
24log = None
25DEBUG = 1
26command_parameters = sys.argv[1:]
27
28server_host = tgConf.THINKGEAR_SERVER_HOST
29server_port = tgConf.THINKGEAR_SERVER_PORT
30
31for each in sys.argv:
32        if each.startswith("--host="):
33                server_host = each[ len("--host="): ]
34        if each.startswith("--port="):
35                server_port = each[ len("--port="): ]
36                try:
37                        server_port = int(server_port)
38                except:
39                        pass
40
41app = QtCore.QCoreApplication(sys.argv)
42client = tgClient.CLIClient(log, command_parameters, server_host, server_port, DEBUG=DEBUG)
43sys.exit(app.exec_())
Note: See TracBrowser for help on using the repository browser.