<s> from django . core . management . base import BaseCommand <EOL> def module_to_dict ( module , omittable = lambda k : k . startswith ( '<STR_LIT:_>' ) ) : <EOL> """<STR_LIT>""" <EOL> return { k : repr ( v ) for k , v in module . __dict__ . items ( ) if not omittable ( k ) } <EOL> class Command ( BaseCommand ) : <EOL> help = """<STR_LIT>""" <EOL> requires_system_checks = False <EOL> def add_arguments ( self , parser ) : <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , action = '<STR_LIT:store_true>' , dest = '<STR_LIT:all>' , default = False , <EOL> help = '<STR_LIT>' , <EOL> ) <EOL> def handle ( self , ** options ) : <EOL> from django . conf import settings , global_settings <EOL> settings . _setup ( ) <EOL> user_settings = module_to_dict ( settings . _wrapped ) <EOL> default_settings = module_to_dict ( global_settings ) <EOL> output = [ ] <EOL> for key in sorted ( user_settings ) : <EOL> if key not in default_settings : <EOL> output . append ( "<STR_LIT>" % ( key , user_settings [ key ] ) ) <EOL> elif user_settings [ key ] != default_settings [ key ] : <EOL> output . append ( "<STR_LIT>" % ( key , user_settings [ key ] ) ) <EOL> elif options [ '<STR_LIT:all>' ] : <EOL> output . append ( "<STR_LIT>" % ( key , user_settings [ key ] ) ) <EOL> return '<STR_LIT:\n>' . join ( output ) </s>
