<s> from django . contrib . staticfiles . storage import staticfiles_storage <EOL> from django . core . files . storage import get_storage_class <EOL> from optparse import make_option <EOL> class StorageOverrideMixin ( object ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> self . option_list = self . option_list + ( <EOL> make_option ( '<STR_LIT>' , '<STR_LIT>' , action = '<STR_LIT:store>' , <EOL> dest = '<STR_LIT>' , type = "<STR_LIT:string>" , <EOL> help = '<STR_LIT>' ) , <EOL> ) <EOL> super ( StorageOverrideMixin , self ) . __init__ ( * args , ** kwargs ) <EOL> def set_options ( self , ** options ) : <EOL> try : <EOL> super_set_options = super ( StorageOverrideMixin , self ) . set_options <EOL> except AttributeError : <EOL> pass <EOL> else : <EOL> super_set_options ( ** options ) <EOL> storage_override = options . get ( '<STR_LIT>' ) <EOL> if storage_override : <EOL> cls = get_storage_class ( storage_override ) <EOL> self . storage = cls ( ) <EOL> else : <EOL> self . storage = staticfiles_storage <EOL> try : <EOL> self . storage . path ( '<STR_LIT>' ) <EOL> except NotImplementedError : <EOL> self . local = False <EOL> else : <EOL> self . local = True </s>
