#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import signal

import gevent

from dialer import DialLet

def main():
    from optparse import OptionParser
    parser = OptionParser()
    parser.add_option("-d", "--debug", action="store_true", dest="debug", default=False,
                      help="logging level DEBUG")
    opts, args = parser.parse_args()

    if opts.debug:
        logging.basicConfig(level=logging.DEBUG)
    else:
        logging.basicConfig(level=logging.INFO)

    d = DialLet()
    # gevent.signal(signal.SIGTERM, d.kill)
    # gevent.signal(signal.SIGINT, d.kill)
    d.run()

if __name__ == '__main__':
    main()
