Beispiel #1
0
def main():

    logger.info("route_scans started")

    try:
        dirs = sec.get_scan_dirs()
        pdfpath = dirs["collected_raw_pdfs"]
    except BaseException, msg:
        logger.error("ERROR trying to read configuration directories; exiting: {}.".format(msg.message))
        sys.exit()
Beispiel #2
0
        dirs = sec.get_scan_dirs()
        pdfpath = dirs["collected_raw_pdfs"]
    except BaseException, msg:
        logger.error("ERROR trying to read configuration directories; exiting: {}.".format(msg.message))
        sys.exit()

    router = se.Router()

    logger.info("starting router q search...")

    # get all all of the questionnaires in the raw scans directory
    res = router.questionnaires_in_dir(image_directory=pdfpath, move_bad=True)

    # split all of the questionnaires up and move them into the appropriate
    # staging directories
    staged, not_staged = router.stage_files(res, stage_root_dir=sec.get_scan_dirs()["staging_pdf"])

    staged_counts = count_types(staged)
    not_staged_counts = count_types(not_staged)

    print_counts("staged:", staged_counts)
    print_counts("not-staged:", not_staged_counts)

    logger.info("route_scans ended")


if __name__ == "__main__":

    logger = se.config.start_log()

    main()