<s> from django . conf import settings <EOL> from django . core . management . base import BaseCommand <EOL> import logging <EOL> from mailer . models import Email <EOL> from optparse import make_option <EOL> class Command ( BaseCommand ) : <EOL> option_list = BaseCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , <EOL> action = '<STR_LIT:store_true>' , <EOL> dest = '<STR_LIT>' , <EOL> default = False , <EOL> help = '<STR_LIT>' ) , <EOL> ) <EOL> def handle ( self , * args , ** options ) : <EOL> if not options [ '<STR_LIT>' ] : <EOL> if settings . DEBUG : <EOL> msgs = Email . objects . filter ( sent = False ) . filter ( recipient__icontains = '<STR_LIT>' ) <EOL> else : <EOL> msgs = [ ] <EOL> if not msgs : <EOL> logging . info ( '<STR_LIT>' ) <EOL> return <EOL> for msg in msgs : <EOL> logging . info ( '<STR_LIT>' % ( msg . recipient , msg . subject ) ) <EOL> else : <EOL> pass </s>
