Logo Search packages:      
Sourcecode: zope-externaleditor version File versions  Download package

def ExternalEditor::zopeedit::Configuration::getAllOptions (   self,
  meta_type,
  content_type,
  host_domain 
)
Return a dict of all applicable options for the
   given meta_type, content_type and host_domain

Definition at line 64 of file zopeedit.py.

                                                                 :
        """Return a dict of all applicable options for the
           given meta_type, content_type and host_domain
        """
        opt = {}
        sep = content_type.find('/')
        general_type = '%s/*' % content_type[:sep]
        
        # Divide up the domains segments and create a
        # list of domains from the bottom up
        host_domain = host_domain.split('.')
        domains = []
        for i in range(len(host_domain)):
            domains.append('domain:%s' % '.'.join(host_domain[i:]))
        domains.reverse()

        sections = ['general']
        sections.extend(domains)
        sections.append('meta-type:%s' % meta_type)
        sections.append('content-type:%s' % general_type)
        sections.append('content-type:%s' % content_type)
        
        for section in sections:
            if self.config.has_section(section):
                for option in self.config.options(section):
                    opt[option] = self.config.get(section, option)
        return opt
        

Generated by  Doxygen 1.6.0   Back to index