1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 | #
|
---|
4 | # Puzzlebox - Brainstorms - Client - ThinkGear Connector
|
---|
5 | #
|
---|
6 | # Copyright Puzzlebox Productions, LLC (2010)
|
---|
7 | #
|
---|
8 | # This code is released under the GNU Pulic License (GPL) version 2
|
---|
9 | # For more information please refer to http://www.gnu.org/copyleft/gpl.html
|
---|
10 | #
|
---|
11 | # Last Update: 2010.06.16
|
---|
12 | #
|
---|
13 | #####################################################################
|
---|
14 |
|
---|
15 | import os, sys
|
---|
16 | import simplejson as json
|
---|
17 |
|
---|
18 | from twisted.internet import reactor, protocol, defer
|
---|
19 |
|
---|
20 | import puzzlebox_brainstorms_configuration as configuration
|
---|
21 | import puzzlebox_brainstorms_client as client
|
---|
22 |
|
---|
23 | #####################################################################
|
---|
24 | # Globals
|
---|
25 | #####################################################################
|
---|
26 |
|
---|
27 | DEBUG = 1
|
---|
28 |
|
---|
29 | SERVER_HOST = configuration.THINKGEAR_SERVER_HOST
|
---|
30 | SERVER_PORT = configuration.THINKGEAR_SERVER_PORT
|
---|
31 |
|
---|
32 | MAX_CONNECTION_ATTEMPTS = configuration.MAX_CONNECTION_ATTEMPTS
|
---|
33 | NO_REPLY_WAIT = configuration.NO_REPLY_WAIT
|
---|
34 |
|
---|
35 | AUTHORIZATION_REQUEST = configuration.THINKGEAR_AUTHORIZATION_REQUEST
|
---|
36 |
|
---|
37 | #####################################################################
|
---|
38 | # Classes
|
---|
39 | #####################################################################
|
---|
40 |
|
---|
41 |
|
---|
42 | #####################################################################
|
---|
43 | # Main
|
---|
44 | #####################################################################
|
---|
45 |
|
---|
46 | if __name__ == '__main__':
|
---|
47 |
|
---|
48 | #log = puzzlebox_logger.puzzlebox_logger(logfile='client')
|
---|
49 | log = None
|
---|
50 |
|
---|
51 | command_parameters = AUTHORIZATION_REQUEST
|
---|
52 |
|
---|
53 | #log.info("Command parameters: %s" % command_parameters)
|
---|
54 |
|
---|
55 | thinkgear_client = client.puzzlebox_brainstorms_client_command_line( \
|
---|
56 | log, \
|
---|
57 | command_parameters, \
|
---|
58 | server_host=SERVER_HOST, \
|
---|
59 | server_port=SERVER_PORT, \
|
---|
60 | DEBUG=DEBUG)
|
---|
61 |
|
---|
62 | reactor.callWhenRunning(thinkgear_client.execute_command_line)
|
---|
63 | reactor.run()
|
---|
64 |
|
---|