from maconomy import cli, Employee, Timesheet, create_db, TimeRegistrationRepository def main(config, dry_run): db = create_db(config) timereg_repo = TimeRegistrationRepository(db) for employee, timesheet in timereg_repo.all_active(): if timesheet.is_missing(): print u"Timesheet for {} has not been created".format(employee) elif not timesheet.is_submitted(): print u"Missing time sheet for {}".format(employee) elif not timesheet.is_approved(): print u"Timesheet for {} not approved".format(employee) timereg_repo.close() db.close() if __name__ == '__main__': args = cli.parse() config = cli.load_config(args.config) main(config, args.dry)