<s> '''<STR_LIT>''' <EOL> from django . conf import settings <EOL> USER_SETTINGS = getattr ( settings , '<STR_LIT>' , None ) <EOL> DEFAULTS = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> class APISettings ( object ) : <EOL> def __init__ ( self , user_settings = None , defaults = None ) : <EOL> self . __user_settings = user_settings or { } <EOL> self . __defaults = defaults or { } <EOL> def __getattr__ ( self , attr ) : <EOL> if attr not in self . __defaults . keys ( ) : <EOL> raise AttributeError ( "<STR_LIT>" % attr ) <EOL> try : <EOL> val = self . __user_settings [ attr ] <EOL> except KeyError : <EOL> val = self . __defaults [ attr ] <EOL> return val <EOL> atc_demo_ui_settings = APISettings ( USER_SETTINGS , DEFAULTS ) </s>
