<s> import os <EOL> import logging <EOL> from optparse import make_option <EOL> from django . core . management . base import BaseCommand <EOL> from django . core . management . base import CommandError <EOL> from chronam . core . management . commands import configure_logging <EOL> from chronam . core import tasks <EOL> configure_logging ( '<STR_LIT>' , <EOL> '<STR_LIT>' % os . getpid ( ) ) <EOL> LOGGER = logging . getLogger ( __name__ ) <EOL> class Command ( BaseCommand ) : <EOL> option_list = BaseCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , <EOL> action = '<STR_LIT>' , <EOL> dest = '<STR_LIT>' , <EOL> default = True , <EOL> help = "<STR_LIT>" ) , <EOL> ) <EOL> help = "<STR_LIT>" <EOL> args = '<STR_LIT>' <EOL> def handle ( self , batch_name , * args , ** options ) : <EOL> if len ( args ) != <NUM_LIT:0> : <EOL> raise CommandError ( '<STR_LIT>' % self . args ) <EOL> try : <EOL> tasks . load_batch . delay ( batch_name , process_coordinates = options [ '<STR_LIT>' ] ) <EOL> except Exception , e : <EOL> LOGGER . exception ( e ) <EOL> raise CommandError ( "<STR_LIT>" ) </s>
