Ejemplo n.º 1
0
def main():
    global changes
    import themortgagemeter_db
    import themortgagemeter_utils
    themortgagemeter_db.open_db()
    if args.logging == 'DEBUG':
        logger = themortgagemeter_utils.setup_logging(logging.DEBUG,
                                                      stdout=args.stdout)
    elif args.logging == 'INFO':
        logger = themortgagemeter_utils.setup_logging(logging.INFO,
                                                      stdout=args.stdout)
    elif args.logging == 'WARNING':
        logger = themortgagemeter_utils.setup_logging(logging.WARNING,
                                                      stdout=args.stdout)
    elif args.logging == 'ERROR':
        logger = themortgagemeter_utils.setup_logging(logging.ERROR,
                                                      stdout=args.stdout)
    elif args.logging == 'CRITICAL':
        logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,
                                                      stdout=args.stdout)
    elif args.logging == 'STDOUT':
        logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,
                                                      stdout=args.stdout)
    logger.info('Program starting: %s', args.institution)
    try:
        #if args.institution == 'NTNWD':
        #	import nationwide
        #	nationwide.nationwide_main(args.static,args.forcedelete,logger)
        if args.institution == 'HSBC':
            import hsbc
            hsbc.hsbc_main(args.static, args.forcedelete, logger)
        elif args.institution == 'HLFX':
            import halifax
            halifax.halifax_main(args.static, args.forcedelete, logger)
        else:
            raise Exception('Need to supply an institution', '')
        if not args.test:
            themortgagemeter_db.db_connection.commit()
        else:
            logger.info('Not committing data, as --test passed in')
            themortgagemeter_db.db_connection.rollback()
    except Exception as e:
        logger.critical('Error was thrown, quitting')
        logger.exception('Error was:')
        themortgagemeter_utils.record_alert('ERROR: ' + args.institution,
                                            logger,
                                            themortgagemeter_db.db_connection,
                                            themortgagemeter_db.cursor)
    logger.info('Program complete for institution: %s', args.institution)
    # TOOD: why does this never seem to be set to true?
    global changes
    logger.info('Changes is: ' + str(changes))
    themortgagemeter_db.commit_db()
Ejemplo n.º 2
0
def main():
	global changes
	import themortgagemeter_db
	import themortgagemeter_utils
	themortgagemeter_db.open_db()
	if args.logging == 'DEBUG':
		logger = themortgagemeter_utils.setup_logging(logging.DEBUG,stdout=args.stdout)
	elif args.logging == 'INFO':
		logger = themortgagemeter_utils.setup_logging(logging.INFO,stdout=args.stdout)
	elif args.logging == 'WARNING':
		logger = themortgagemeter_utils.setup_logging(logging.WARNING,stdout=args.stdout)
	elif args.logging == 'ERROR':
		logger = themortgagemeter_utils.setup_logging(logging.ERROR,stdout=args.stdout)
	elif args.logging == 'CRITICAL':
		logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,stdout=args.stdout)
	elif args.logging == 'STDOUT':
		logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,stdout=args.stdout)
	logger.info('Program starting: %s', args.institution)
	try:
		#if args.institution == 'NTNWD':
		#	import nationwide
		#	nationwide.nationwide_main(args.static,args.forcedelete,logger)
		if args.institution == 'HSBC':
			import hsbc
			hsbc.hsbc_main(args.static,args.forcedelete,logger)
		elif args.institution == 'HLFX':
			import halifax
			halifax.halifax_main(args.static,args.forcedelete,logger)
		else:
			raise Exception('Need to supply an institution','')
		if not args.test:
			themortgagemeter_db.db_connection.commit()
		else:
			logger.info('Not committing data, as --test passed in')
			themortgagemeter_db.db_connection.rollback()
	except Exception as e:
		logger.critical('Error was thrown, quitting')
		logger.exception('Error was:')
		themortgagemeter_utils.record_alert('ERROR: ' + args.institution,logger,themortgagemeter_db.db_connection,themortgagemeter_db.cursor)
	logger.info('Program complete for institution: %s', args.institution)
	# TOOD: why does this never seem to be set to true?
	global changes
	logger.info('Changes is: ' + str(changes))
	themortgagemeter_db.commit_db()
Ejemplo n.º 3
0
def main():
    global changes
    import themortgagemeter_db
    import themortgagemeter_utils
    themortgagemeter_db.open_db()
    if args.logging == 'DEBUG':
        logger = themortgagemeter_utils.setup_logging(logging.DEBUG,
                                                      stdout=args.stdout)
    elif args.logging == 'INFO':
        logger = themortgagemeter_utils.setup_logging(logging.INFO,
                                                      stdout=args.stdout)
    elif args.logging == 'WARNING':
        logger = themortgagemeter_utils.setup_logging(logging.WARNING,
                                                      stdout=args.stdout)
    elif args.logging == 'ERROR':
        logger = themortgagemeter_utils.setup_logging(logging.ERROR,
                                                      stdout=args.stdout)
    elif args.logging == 'CRITICAL':
        logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,
                                                      stdout=args.stdout)
    elif args.logging == 'STDOUT':
        logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,
                                                      stdout=args.stdout)
    logger.info('Program starting: %s', args.institution)
    try:
        if args.institution == 'HSBC':
            import hsbc
            hsbc.hsbc_main(args.static, args.forcedelete, logger)
        elif args.institution == 'NTNWD':
            import nationwide
            nationwide.nationwide_main(args.static, args.forcedelete, logger)
        elif args.institution == 'LLOYDS':
            import lloyds
            lloyds.lloyds_main(args.static, args.forcedelete, logger)
        elif args.institution == 'SNTNDR':
            import santander
            santander.santander_main(args.static, args.forcedelete, logger)
        elif args.institution == 'HLFX':
            import halifax
            halifax.halifax_main(args.static, args.forcedelete, logger)
        elif args.institution == 'NTWST':
            import natwest
            natwest.natwest_main(args.static, args.forcedelete, logger)
        elif args.institution == 'NRTHNR':
            import northernrock
            northernrock.northernrock_main(args.static, args.forcedelete,
                                           logger)
        elif args.institution == 'CHLS':
            import chelsea
            chelsea.chelsea_main(args.static, args.forcedelete, logger)
        elif args.institution == 'YRKSHR':
            import yorkshire
            yorkshire.yorkshire_main(args.static, args.forcedelete, logger)
        elif args.institution == 'TSC':
            import tesco
            tesco.tesco_main(args.static, args.forcedelete, logger)
        elif args.institution == 'SKPTN':
            import skipton
            skipton.skipton_main(args.static, args.forcedelete, logger)
        elif args.institution == 'PSTFFC':
            import post_office
            post_office.post_office_main(args.static, args.forcedelete, logger)
        elif args.institution == 'FRSTDRCT':
            import first_direct
            first_direct.first_direct_main(args.static, args.forcedelete,
                                           logger)
        else:
            raise Exception('Need to supply an institution', '')
        if not args.test:
            themortgagemeter_db.db_connection.commit()
        else:
            logger.info('Not committing data, as --test passed in')
            themortgagemeter_db.db_connection.rollback()
    except Exception as e:
        logger.critical('Error was thrown, quitting')
        logger.exception('Error was:')
        themortgagemeter_utils.record_alert('ERROR: ' + args.institution,
                                            logger,
                                            themortgagemeter_db.db_connection,
                                            themortgagemeter_db.cursor)
    logger.info('Program complete for institution: %s', args.institution)
    # TOOD: why does this never seem to be set to true?
    global changes
    logger.info('Changes is: ' + str(changes))
    themortgagemeter_db.commit_db()
Ejemplo n.º 4
0
def main():
	global changes
	import themortgagemeter_db
	import themortgagemeter_utils
	themortgagemeter_db.open_db()
	if args.logging == 'DEBUG':
		logger = themortgagemeter_utils.setup_logging(logging.DEBUG,stdout=args.stdout)
	elif args.logging == 'INFO':
		logger = themortgagemeter_utils.setup_logging(logging.INFO,stdout=args.stdout)
	elif args.logging == 'WARNING':
		logger = themortgagemeter_utils.setup_logging(logging.WARNING,stdout=args.stdout)
	elif args.logging == 'ERROR':
		logger = themortgagemeter_utils.setup_logging(logging.ERROR,stdout=args.stdout)
	elif args.logging == 'CRITICAL':
		logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,stdout=args.stdout)
	elif args.logging == 'STDOUT':
		logger = themortgagemeter_utils.setup_logging(logging.CRITICAL,stdout=args.stdout)
	logger.info('Program starting: %s', args.institution)
	try:
		if args.institution == 'HSBC':
			import hsbc
			hsbc.hsbc_main(args.static,args.forcedelete,logger)
		elif args.institution == 'NTNWD':
			import nationwide
			nationwide.nationwide_main(args.static,args.forcedelete,logger)
		elif args.institution == 'LLOYDS':
			import lloyds
			lloyds.lloyds_main(args.static,args.forcedelete,logger)
		elif args.institution == 'SNTNDR':
			import santander
			santander.santander_main(args.static,args.forcedelete,logger)
		elif args.institution == 'HLFX':
			import halifax
			halifax.halifax_main(args.static,args.forcedelete,logger)
		elif args.institution == 'NTWST':
			import natwest
			natwest.natwest_main(args.static,args.forcedelete,logger)
		elif args.institution == 'NRTHNR':
			import northernrock
			northernrock.northernrock_main(args.static,args.forcedelete,logger)
		elif args.institution == 'CHLS':
			import chelsea
			chelsea.chelsea_main(args.static,args.forcedelete,logger)
		elif args.institution == 'YRKSHR':
			import yorkshire
			yorkshire.yorkshire_main(args.static,args.forcedelete,logger)
		elif args.institution == 'TSC':
			import tesco
			tesco.tesco_main(args.static,args.forcedelete,logger)
		elif args.institution == 'SKPTN':
			import skipton
			skipton.skipton_main(args.static,args.forcedelete,logger)
		elif args.institution == 'PSTFFC':
			import post_office
			post_office.post_office_main(args.static,args.forcedelete,logger)
		elif args.institution == 'FRSTDRCT':
			import first_direct
			first_direct.first_direct_main(args.static,args.forcedelete,logger)
		else:
			raise Exception('Need to supply an institution','')
		if not args.test:
			themortgagemeter_db.db_connection.commit()
		else:
			logger.info('Not committing data, as --test passed in')
			themortgagemeter_db.db_connection.rollback()
	except Exception as e:
		logger.critical('Error was thrown, quitting')
		logger.exception('Error was:')
		themortgagemeter_utils.record_alert('ERROR: ' + args.institution,logger,themortgagemeter_db.db_connection,themortgagemeter_db.cursor)
	logger.info('Program complete for institution: %s', args.institution)
	# TOOD: why does this never seem to be set to true?
	global changes
	logger.info('Changes is: ' + str(changes))
	themortgagemeter_db.commit_db()