~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

[merge] robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
    def _get_signature_checking(self):
77
77
        """Template method to override signature checking policy."""
78
78
 
 
79
    def _get_user_option(self, option_name):
 
80
        """Template method to provide a user option."""
 
81
        return None
 
82
 
 
83
    def get_user_option(self, option_name):
 
84
        """Get a generic option - no special process, no default."""
 
85
        return self._get_user_option(option_name)
 
86
 
79
87
    def gpg_signing_command(self):
80
88
        """What program should be used to sign signatures?"""
81
89
        result = self._gpg_signing_command()
179
187
            if self._get_parser().has_option(section, 'email'):
180
188
                return self._get_parser().get(section, 'email')
181
189
 
 
190
    def _get_user_option(self, option_name):
 
191
        """See Config._get_user_option."""
 
192
        section = self._get_section()
 
193
        if section is not None:
 
194
            if self._get_parser().has_option(section, option_name):
 
195
                return self._get_parser().get(section, option_name)
 
196
 
182
197
    def _gpg_signing_command(self):
183
198
        """See Config.gpg_signing_command."""
184
199
        section = self._get_section()
279
294
            return user_id
280
295
        return self._get_global_config()._get_user_id()
281
296
 
 
297
    def _get_user_option(self, option_name):
 
298
        """See Config._get_user_option."""
 
299
        option_value = super(LocationConfig, 
 
300
                             self)._get_user_option(option_name)
 
301
        if option_value is not None:
 
302
            return option_value
 
303
        return self._get_global_config()._get_user_option(option_name)
 
304
 
282
305
    def _get_signature_checking(self):
283
306
        """See Config._get_signature_checking."""
284
307
        check = super(LocationConfig, self)._get_signature_checking()
315
338
        """See Config._get_signature_checking."""
316
339
        return self._get_location_config()._get_signature_checking()
317
340
 
 
341
    def _get_user_option(self, option_name):
 
342
        """See Config._get_user_option."""
 
343
        return self._get_location_config()._get_user_option(option_name)
 
344
 
318
345
    def _gpg_signing_command(self):
319
346
        """See Config.gpg_signing_command."""
320
347
        return self._get_location_config()._gpg_signing_command()