<s> from optparse import make_option <EOL> from django . conf import settings <EOL> from django . core . management . base import BaseCommand , CommandError <EOL> from django . test . utils import override_settings <EOL> from olympia . amo . utils import chunked <EOL> from olympia . lib . crypto . tasks import resign_files <EOL> class Command ( BaseCommand ) : <EOL> args = '<STR_LIT>' <EOL> help = '<STR_LIT>' <EOL> option_list = BaseCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , action = '<STR_LIT:store>' , type = '<STR_LIT:string>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) , <EOL> make_option ( '<STR_LIT>' , action = '<STR_LIT:store>' , <EOL> type = '<STR_LIT:string>' , <EOL> dest = '<STR_LIT>' , <EOL> help = '<STR_LIT>' ) , <EOL> ) <EOL> def handle ( self , * args , ** options ) : <EOL> if len ( args ) == <NUM_LIT:0> : <EOL> raise CommandError ( '<STR_LIT>' ) <EOL> full_server = options . get ( '<STR_LIT>' ) or settings . SIGNING_SERVER <EOL> prelim_server = ( options . get ( '<STR_LIT>' ) or <EOL> settings . PRELIMINARY_SIGNING_SERVER ) <EOL> file_ids = [ int ( file_id ) for file_id in args ] <EOL> with override_settings ( <EOL> SIGNING_SERVER = full_server , <EOL> PRELIMINARY_SIGNING_SERVER = prelim_server ) : <EOL> for chunk in chunked ( file_ids , <NUM_LIT:100> ) : <EOL> resign_files . delay ( chunk ) </s>
