def some_check data some checks pass CHECKS some_check def check_outgo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def some_check(data):
# ... some checks
pass
CHECKS = (
some_check,
)
def check_outgoing_data(records_iterator)
for record in records_iterator:
for check in CHECKS:
try:
check(record)
except ValueError, e:
logging.error("Fail to run %s at %d record: %s" %
(check.__name__, i, e))