def main(): logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M') logger = logging.getLogger('main') logger.info('starting up') ebooks = EbooksText(Config) if not validate_run_times(Config): logger.error('invalid run times specified') sys.exit(1) while True: ebooks.update() peer = TwitterPeer(Config) conv = Conversation(ebooks, peer) next_run = next_run_time(Config) logger.info('sleeping until {0}'.format(next_run)) pause.until(next_run) conv.talk()
def main(): logging.basicConfig( level=logging.INFO, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%m-%d %H:%M') logger = logging.getLogger('main') logger.info('starting up') ebooks = EbooksText(Config) if not validate_run_times(Config): logger.error('invalid run times specified') sys.exit(1) while True: ebooks.update() peer = TwitterPeer(Config) conv = Conversation(ebooks, peer) next_run = next_run_time(Config) logger.info('sleeping until {0}'.format(next_run)) pause.until(next_run) conv.talk()