import logging.config
import tornado
from bitstampws import Client as Websocket

import lib.configs.logging
from lib.subscribers import SimpleLoggerSubscriber


logging.config.dictConfig(lib.configs.logging.d)


if __name__ == '__main__':
    with Websocket() as client:
        with SimpleLoggerSubscriber(client):
            client.connect()
            try:
                tornado.ioloop.IOLoop.instance().start()
            except KeyboardInterrupt:
                client.close()


[((13, 9, 13, 20), 'bitstampws.Client', 'Websocket', ({}, {}), '()', True, 'from bitstampws import Client as Websocket\n'), ((14, 13, 14, 43), 'lib.subscribers.SimpleLoggerSubscriber', 'SimpleLoggerSubscriber', ({(14, 36, 14, 42): 'client'}, {}), '(client)', False, 'from lib.subscribers import SimpleLoggerSubscriber\n'), ((17, 16, 17, 48), 'tornado.ioloop.IOLoop.instance', 'tornado.ioloop.IOLoop.instance', ({}, {}), '()', False, 'import tornado\n')]