<s> from optparse import make_option <EOL> from django . core . management . base import LabelCommand <EOL> import sys <EOL> from pillowtop import get_pillow_by_name , get_all_pillow_configs <EOL> class Command ( LabelCommand ) : <EOL> help = "<STR_LIT>" <EOL> args = '<STR_LIT>' <EOL> label = '<STR_LIT>' <EOL> option_list = LabelCommand . 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 , * labels , ** options ) : <EOL> """<STR_LIT>""" <EOL> if not labels : <EOL> pillow_names = [ config . name for config in get_all_pillow_configs ( ) ] <EOL> print "<STR_LIT>" % ( '<STR_LIT>' . join ( pillow_names ) ) <EOL> sys . exit ( ) <EOL> pillow_name = labels [ <NUM_LIT:0> ] <EOL> pillow_to_use = get_pillow_by_name ( pillow_name ) <EOL> if not pillow_to_use : <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % pillow_name <EOL> sys . exit ( ) <EOL> if not options . get ( '<STR_LIT>' ) : <EOL> confirm = raw_input ( """<STR_LIT>""" % pillow_name ) <EOL> else : <EOL> confirm = '<STR_LIT:yes>' <EOL> if confirm != '<STR_LIT:yes>' : <EOL> print "<STR_LIT>" <EOL> return <EOL> print "<STR_LIT>" % pillow_to_use . checkpoint . checkpoint_id <EOL> print "<STR_LIT>" % pillow_to_use . get_checkpoint ( ) . sequence <EOL> pillow_to_use . checkpoint . reset ( ) <EOL> print "<STR_LIT>" </s>
