~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Robert Collins
  • Date: 2005-10-17 06:22:23 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051017062223-ef02def7780ccfb7
gpg_signing_command configuration item

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
email=Your Name <your@email.address>
27
27
check_signatures=require|ignore|check-available(default)
28
28
create_signatures=always|never|when-required(default)
 
29
gpg_signing_command=name-of-program
29
30
 
30
31
in branches.conf, you specify the url of a branch and options for it.
31
32
Wildcards may be used - * and ? as normal in shell completion. Options
75
76
    def _get_signature_checking(self):
76
77
        """Template method to override signature checking policy."""
77
78
 
 
79
    def gpg_signing_command(self):
 
80
        """What program should be used to sign signatures?"""
 
81
        return "gpg"
 
82
 
78
83
    def __init__(self):
79
84
        super(Config, self).__init__()
80
85
 
167
172
            if self._get_parser().has_option(section, 'email'):
168
173
                return self._get_parser().get(section, 'email')
169
174
 
 
175
    def gpg_signing_command(self):
 
176
        """See Config.gpg_signing_command."""
 
177
        section = self._get_section()
 
178
        if section is not None:
 
179
            if self._get_parser().has_option(section, 'gpg_signing_command'):
 
180
                return self._get_parser().get(section, 'gpg_signing_command')
 
181
 
170
182
    def __init__(self, get_filename):
171
183
        super(IniBasedConfig, self).__init__()
172
184
        self._get_filename = get_filename
247
259
        matches.sort(reverse=True)
248
260
        return matches[0][1]
249
261
 
 
262
    def gpg_signing_command(self):
 
263
        """See Config.gpg_signing_command."""
 
264
        command = super(LocationConfig, self).gpg_signing_command()
 
265
        if command is not None:
 
266
            return command
 
267
        return self._get_global_config().gpg_signing_command()
 
268
 
250
269
    def _get_user_id(self):
251
270
        user_id = super(LocationConfig, self)._get_user_id()
252
271
        if user_id is not None:
289
308
        """See Config._get_signature_checking."""
290
309
        return self._get_location_config()._get_signature_checking()
291
310
 
 
311
    def gpg_signing_command(self):
 
312
        """See Config.gpg_signing_command."""
 
313
        return self._get_location_config().gpg_signing_command()
 
314
        
292
315
    def __init__(self, branch):
293
316
        super(BranchConfig, self).__init__()
294
317
        self._location_config = None