#NEWLINE# def get_placeholder_conf( setting , placeholder , template = None , default = None ) : #NEWLINE# #INDENT# "\n    Returns the placeholder configuration for a given setting. The key would for\n    example be 'plugins' or 'name'.\n\n    If a template is given, it will try\n    CMS_PLACEHOLDER_CONF['template placeholder'] and\n    CMS_PLACEHOLDER_CONF['placeholder'], if no template is given only the latter\n    is checked.\n    " #NEWLINE# if placeholder : #NEWLINE# #INDENT# keys = [ ] #NEWLINE# if template : #NEWLINE# #INDENT# keys . append ( ( '%s %s' % ( template , placeholder ) ) ) #NEWLINE# #UNINDENT# keys . append ( placeholder ) #NEWLINE# for key in keys : #NEWLINE# #INDENT# conf = get_cms_setting ( 'PLACEHOLDER_CONF' ) . get ( key ) #NEWLINE# if ( not conf ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# value = conf . get ( setting ) #NEWLINE# if ( value is not None ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# inherit = conf . get ( 'inherit' ) #NEWLINE# if inherit : #NEWLINE# #INDENT# if ( ' ' in inherit ) : #NEWLINE# #INDENT# inherit = inherit . split ( ' ' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# inherit = ( None , inherit ) #NEWLINE# #UNINDENT# value = get_placeholder_conf ( setting , inherit [ 1 ] , inherit [ 0 ] , default ) #NEWLINE# if ( value is not None ) : #NEWLINE# #INDENT# return value #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return default