2
# -*- coding: UTF-8 -*-
3
# vim: set sw=4 sts=4 expandtab:
5
##############################################################################
7
# Copyright (c) 2007-2010 Bernd Kreuss <prof7bit@gmail.com> #
9
# This program is licensed under the GNU General Public License V3, #
10
# the full source code is included in the binary distribution. #
12
# Included in the distribution are files from other open source projects: #
13
# - TOR Onion Router (c) The Tor Project, 3-clause-BSD #
14
# - SocksiPy (c) Dan Haim, BSD Style License #
15
# - Gajim buddy status icons (c) The Gajim Team, GNU GPL #
17
##############################################################################
22
if wxversion.checkInstalled('2.9'):
23
wxversion.select('2.9') # For Mac it is tweaked and optimized with 2.9
25
print "(1) wxPython-2.9 is not installed"
29
if wxversion.checkInstalled('2.8'):
30
wxversion.select('2.8') # On MSW and GTK we stick with 2.8 for now
32
print "(1) wxPython-2.8 is not installed"
36
# in the pyinstaller binary wxversion can screw up and throw exceptions
37
# so we ignore the error and just use the wx that happens to be available.
38
# TODO: Does this still happen since we now use checkInstalled()?
39
print "(2) wxversion screwed up, this is harmless, ignoring it."
47
print "(2) wxPython version %s" % wx.version()
48
#create the mandatory wx application object
51
app = tc_mac.App(redirect=False)
53
app = wx.App(redirect=False)
55
#test for availability of our listening port
56
interface = config.get("client", "listen_interface")
57
port = config.getint("client", "listen_port")
58
print "(1) opening TorChat listener on %s:%s" % (interface, port)
59
listen_socket = tc_client.tryBindPort(interface, port)
61
print "(1) %s:%s is already in use" % (interface, port)
62
wx.MessageBox(tc_gui.lang.D_WARN_USED_PORT_MESSAGE % (interface, port),
63
tc_gui.lang.D_WARN_USED_PORT_TITLE)
66
print "(1) TorChat is listening on %s:%s" % (interface, port)
68
#now continue with normal program startup
69
print "(1) start initializing main window"
70
app.mw = tc_gui.MainWindow(listen_socket)
71
app.SetTopWindow(app.mw)
72
print "(1) main window initialized"
73
print "(1) entering main loop"
76
if __name__ == "__main__":
79
except KeyboardInterrupt:
80
tc_client.stopPortableTor()