Logo Search packages:      
Sourcecode: feed2omb version File versions  Download package

def configobj::ConfigObj::_set_configspec (   self,
  section,
  copy 
) [private]
Called by validate. Handles setting the configspec on subsections
including sections to be validated by __many__

Definition at line 1905 of file configobj.py.

                                            :
        """
        Called by validate. Handles setting the configspec on subsections
        including sections to be validated by __many__
        """
        configspec = section.configspec
        many = configspec.get('__many__')
        if isinstance(many, dict):
            for entry in section.sections:
                if entry not in configspec:
                    section[entry].configspec = many
                    
        for entry in configspec.sections:
            if entry == '__many__':
                continue
            if entry not in section:
                section[entry] = {}
                if copy:
                    # copy comments
                    section.comments[entry] = configspec.comments.get(entry, [])
                    section.inline_comments[entry] = configspec.inline_comments.get(entry, '')
                
            # Could be a scalar when we expect a section
            if isinstance(section[entry], Section):
                section[entry].configspec = configspec[entry]
                        


Generated by  Doxygen 1.6.0   Back to index