def start(self, stdscr): if self.debug: from pydevd import pydevd from debug import DEBUG_HOST, DEBUG_PORT pydevd.settrace(DEBUG_HOST, port=DEBUG_PORT, suspend=False) if self.networking is not None: self.event_dispatch.send(ScreenChangeEvent(screen="login")) self.event_dispatch.register(self.finish, ["FinishEvent"]) self.event_dispatch.register(self.quit, ["QuitEvent"]) self.event_dispatch.register(self.set_seed, ["SeedEvent"]) self.event_dispatch.register(self.handle_input, ["InputEvent"]) for thread in self.threads: thread.start() self.shutdown_event.set() self.logic.start() self.input.start(stdscr) self.gui.start(stdscr) self.game_loop()
def setup_remote_pydev_debug(): if CONF.pydev_debug_host and CONF.pydev_debug_port: try: try: from pydevd import pydevd except ImportError: import pydevd pydevd.settrace(CONF.pydev_debug_host, port=CONF.pydev_debug_port, stdoutToServer=True, stderrToServer=True) return True except Exception: LOG.exception(_( 'Error setting up the debug environment. Verify that the ' 'option --debug-url has the format <host>:<port> and that a ' 'debugger processes is listening on that port.')) raise
#!/usr/bin/env python2.7 import sys HOST, PORT = "localhost", 11982 from freecell.server.competitionserver import CompetitionServer if __name__ == "__main__": debug = False if len(sys.argv) > 1: if "debug" in sys.argv: sys.argv.remove("debug") debug = True from pydevd import pydevd from debug import DEBUG_HOST, DEBUG_PORT pydevd.settrace(DEBUG_HOST, port=DEBUG_PORT, suspend=False) competition_server = CompetitionServer(HOST, PORT) competition_server.start()