def get_default_section(self, file_name):
        """Returns first non-DEFAULT section; falls back to DEFAULT."""
        if not os.path.isfile(file_name):
            return 'DEFAULT'
        parser = self.make_parser()
        with open(file_name) as fp:
            parser.read_file(fp)
        sections = parser.sections()
        section = sections[0] if len(sections) > 0 else 'DEFAULT'
        return section
def get_default_section ( self , file_name ) : if not os . path . isfile ( file_name ) : return 'DEFAULT' parser = self . make_parser ( ) with open ( file_name ) as fp : parser . read_file ( fp ) sections = parser . sections ( ) section = sections [ 0 ] if len ( sections ) > 0 else 'DEFAULT' return section
Returns first non-DEFAULT section; falls back to DEFAULT.