Mercurial > code > home > repos > light9
changeset 278:d20fda03a041
LevelServer in keyboardcomposer fails less gracelessly
author | David McClosky <dmcc@bigasterisk.com> |
---|---|
date | Fri, 17 Jun 2005 18:23:53 +0000 |
parents | e7630a2072bd |
children | 5bfcf309e1ad |
files | bin/keyboardcomposer |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/keyboardcomposer Fri Jun 17 23:57:04 2005 +0000 +++ b/bin/keyboardcomposer Fri Jun 17 18:23:53 2005 +0000 @@ -267,8 +267,13 @@ kc = KeyboardComposer(tl, s) kc.pack(fill=BOTH, expand=1) - ls = LevelServer(kc.name_to_subtk) - reactor.listenTCP(networking.kcPort(), server.Site(ls)) + import twisted.internet + try: + ls = LevelServer(kc.name_to_subtk) + reactor.listenTCP(networking.kcPort(), server.Site(ls)) + except twisted.internet.error.CannotListenError, e: + print "Can't (and won't!) start level server:" + print e root.protocol('WM_DELETE_WINDOW', reactor.stop) reactor.addSystemEventTrigger('after', 'shutdown', kc.save)