Ejemplo n.º 1
0
                    create_mbox(lst_name, mbox_name, 
                                name, email, 
                                date, updated_date,
                                subject, message_id, body, in_reply_to, references)

                    list_fetched_messages += 1
                    fetched_messages += 1

                if messages: 
                    write_config(lst_name, final_year, final_month, message)

            logging.info("Finished processing '%s' (%s messages)" % (lst_name, list_fetched_messages))
            counter += 1

    if fetched_messages:
        logging.info('Fetched %s messages in the current run' % fetched_messages)
    else:
        logging.info('No messages were fetched in the current run')

    if skipped_messages:
        logging.info('Skipped %s messages in the current run' % skipped_messages)

    logging.info('Quit')
    sys.exit()


if __name__ == '__main__':
    liststat.start_logging(logfilepath=LOG_FILE)
    logging.info('\t\tStarting Archive Parser (mbox)')
    main()
Ejemplo n.º 2
0
            counter += 1

    logging.info('Quit')
    sys.exit()


def confirm_run():
    """Notify the user before starting NNTPStat."""
    ask = raw_input('Do you really want to run NNTPStat instead of ArchiveParser [y/n]?: ')
    if ask in ('y', 'Y', 'yes', ''):
        ask_again = raw_input('WARNING: This will override good data from ArchiveParser. Proceed [y/n]?: ')
        if ask_again in ('y', 'Y', 'yes', ''):
            return
        else:
            sys.exit()
    else:
        sys.exit()   


if __name__ == '__main__':
    confirm_run()

    liststat.start_logging()

    if not os.path.isfile(NNTP_CONF_SAVE_PATH):
        open(NNTP_CONF_SAVE_PATH, 'w').close()
    
    logging.info('\t\tStarting NNTPListStat')

    main()