<s> from datetime import datetime <EOL> import re <EOL> from custom . ilsgateway . tanzania . handlers . keyword import KeywordHandler <EOL> from custom . ilsgateway . models import SupplyPointStatusValues , SupplyPointStatus , SupplyPointStatusTypes <EOL> from custom . ilsgateway . tanzania . reminders import SUPERVISION_HELP , SUPERVISION_CONFIRM_NO , SUPERVISION_CONFIRM_YES <EOL> class SupervisionHandler ( KeywordHandler ) : <EOL> def help ( self ) : <EOL> self . respond ( SUPERVISION_HELP ) <EOL> return True <EOL> def handle ( self ) : <EOL> subcommand = self . args [ <NUM_LIT:0> ] . strip ( ) . lower ( ) <EOL> location = self . user . location <EOL> if not location : <EOL> return True <EOL> if re . match ( "<STR_LIT>" , subcommand ) or re . match ( "<STR_LIT>" , subcommand ) : <EOL> status_value = SupplyPointStatusValues . NOT_RECEIVED <EOL> self . respond ( SUPERVISION_CONFIRM_NO ) <EOL> elif re . match ( "<STR_LIT>" , subcommand ) or re . match ( "<STR_LIT:yes>" , subcommand ) : <EOL> status_value = SupplyPointStatusValues . RECEIVED <EOL> self . respond ( SUPERVISION_CONFIRM_YES ) <EOL> else : <EOL> self . help ( ) <EOL> return True <EOL> SupplyPointStatus . objects . create ( status_type = SupplyPointStatusTypes . SUPERVISION_FACILITY , <EOL> status_value = status_value , <EOL> location_id = location . get_id , <EOL> status_date = datetime . utcnow ( ) ) <EOL> return True </s>
