<s> from django . core . management . base import BaseCommand , CommandError <EOL> from django . conf import settings <EOL> from optparse import make_option <EOL> import logging <EOL> import zmq <EOL> import sys <EOL> import os <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> from greenqueue import settings as gq_settings <EOL> from greenqueue . shortcuts import load_backend_class <EOL> class Command ( BaseCommand ) : <EOL> option_list = BaseCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , action = "<STR_LIT:store>" , dest = "<STR_LIT>" , default = gq_settings . GREENQUEUE_BIND_ADDRESS , <EOL> help = "<STR_LIT>" ) , <EOL> ) <EOL> help = "<STR_LIT>" <EOL> args = "<STR_LIT>" <EOL> def handle ( self , * args , ** options ) : <EOL> gq_settings . GREENQUEUE_BIND_ADDRESS = options [ '<STR_LIT>' ] <EOL> service_handler = load_backend_class ( ) . instance ( ) <EOL> verbosity = int ( options . get ( '<STR_LIT>' ) ) <EOL> if verbosity > <NUM_LIT:1> : <EOL> log . setLevel ( logging . DEBUG ) <EOL> else : <EOL> log . setLevel ( logging . INFO ) <EOL> try : <EOL> service_handler . start ( ) <EOL> except KeyboardInterrupt : <EOL> pass </s>
