#!/usr/bin/python # Copyright (C) 2006-2011 Mortal Coil Games # See LICENSE for details. """ MV3D Client This is the main client app. It should be run from the command line. The config is located in client.conf. For info on how to connect to a server and other instructions on the client, see this wiki page: http://www.mv3d.com/trac/wiki/ClientUserInterface """ import sys import os import uuid uuid # shut up pylint if sys.argv and (sys.argv[0].endswith(".exe") or sys.argv[0].endswith(".p3d")): # HACK! Because we do dynamic imports, we need to change the # path a bit so that it looks in the local directory first. sys.path.insert(0, os.path.split(sys.path[0])[0]) __name__ = "__main__" elif not sys.argv: sys.path.insert(0, os.path.split(sys.path[0])[0]) __name__ = "__main__" try: import wx from twisted.internet import wxreactor wxreactor.install() except ImportError: wx = None if wx is not None: app = wx.PySimpleApp(0) wx.InitAllImageHandlers() win = wx.Frame(None) # instance = cls(config=cfg, conductor=cond) app.SetTopWindow(win) # reactor.registerWxApp(app) #@UndefinedVariable from mv3d.client.state import ClientState from mv3d.util.application import ClientApplication class Client(ClientApplication): """ The client application. """ configFile = "client.conf" configSection = "Client" def __init__(self, config, conductor): self.conductor = conductor self.config = config self.state = ClientState(conductor) if __name__ == '__main__': Client.start() sys.exit()