diff options
Diffstat (limited to 'src/poezio.py')
-rw-r--r-- | src/poezio.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/poezio.py b/src/poezio.py index f82f103f..9a26e135 100644 --- a/src/poezio.py +++ b/src/poezio.py @@ -57,17 +57,22 @@ def main(): if options.debug: cocore.debug = True cocore.start() + + # Warning: asyncio must always be imported after the config. Otherwise + # the asyncio logger will not follow our configuration and won't write + # the tracebacks in the correct file, etc + import asyncio + loop = asyncio.get_event_loop() + + loop.add_reader(sys.stdin, cocore.on_input_readable) + loop.add_signal_handler(signal.SIGWINCH, cocore.sigwinch_handler) + cocore.xmpp.start() + loop.run_forever() + # We reach this point only when loop.stop() is called try: - if not cocore.xmpp.start(): # Connect to remote server - cocore.on_failed_connection() - except: - cocore.running = False cocore.reset_curses() - print("Poezio could not start, maybe you tried aborting it while it was starting?\n" - "If you think it is abnormal, please run it with the -d option and report the bug.") - else: - log.error('------------------------ new poezio start ------------------------') - cocore.main_loop() # Refresh the screen, wait for user events etc + except: + pass if __name__ == '__main__': main() |