~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/util/configobj/configobj.py

  • Committer: Matt Nordhoff
  • Date: 2008-02-27 21:34:30 UTC
  • mto: This revision was merged to the branch mainline in revision 3257.
  • Revision ID: mnordhoff@mattnordhoff.com-20080227213430-gr5acc9b1v87sr81
Upgrade ConfigObj to 4.5.2.

There were no changes to configobj.py, just docs and validate.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
    True, False = 1, 0
118
118
 
119
119
 
120
 
__version__ = '4.5.1'
 
120
__version__ = '4.5.2'
121
121
 
122
122
__revision__ = '$Id: configobj.py 156 2006-01-31 14:57:08Z fuzzyman $'
123
123
 
1312
1312
                self.configspec = None
1313
1313
            return
1314
1314
        
1315
 
        elif getattr(infile, 'read', None) is not None:
 
1315
        elif hasattr(infile, 'read'):
1316
1316
            # This supports file like objects
1317
1317
            infile = infile.read() or []
1318
1318
            # needs splitting into lines - but needs doing *after* decoding
1956
1956
                # FIXME: can we supply any useful information here ?
1957
1957
                raise RepeatSectionError()
1958
1958
            
1959
 
        if getattr(configspec, 'initial_comment', None) is not None:
 
1959
        if hasattr(configspec, 'initial_comment'):
1960
1960
            section._configspec_initial_comment = configspec.initial_comment
1961
1961
            section._configspec_final_comment = configspec.final_comment
1962
1962
            section._configspec_encoding = configspec.encoding
2201
2201
            section = self
2202
2202
        #
2203
2203
        spec_section = section.configspec
2204
 
        if copy and getattr(section, '_configspec_initial_comment', None) is not None:
 
2204
        if copy and hasattr(section, '_configspec_initial_comment'):
2205
2205
            section.initial_comment = section._configspec_initial_comment
2206
2206
            section.final_comment = section._configspec_final_comment
2207
2207
            section.encoding = section._configspec_encoding
2262
2262
                    except KeyError:
2263
2263
                        pass
2264
2264
                    
2265
 
                if getattr(validator, 'get_default_value', None) is not None:
 
2265
                if hasattr(validator, 'get_default_value'):
2266
2266
                    try: 
2267
2267
                        section.default_values[entry] = validator.get_default_value(spec_section[entry])
2268
2268
                    except KeyError: