~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/config.py

  • Committer: Robert Collins
  • Date: 2005-10-15 09:19:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1456.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051015091908-983318b7ee4b824c
create signature_needed() call for commit to trigger creating signatures

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
create_signatures - this option controls whether bzr will always create 
48
48
                    gpg signatures, never create them, or create them if the
49
49
                    branch is configured to require them.
 
50
                    NB: This option is planned, but not implemented yet.
50
51
"""
51
52
 
52
53
from ConfigParser import ConfigParser
124
125
            return policy
125
126
        return CHECK_IF_POSSIBLE
126
127
 
 
128
    def signature_needed(self):
 
129
        """Is a signature needed when committing ?."""
 
130
        policy = self._get_signature_checking()
 
131
        if policy == CHECK_ALWAYS:
 
132
            return True
 
133
        return False
 
134
 
127
135
 
128
136
class IniBasedConfig(Config):
129
137
    """A configuration policy that draws from ini files."""
148
156
        section = self._get_section()
149
157
        if section is None:
150
158
            return None
151
 
        if self._get_parser().has_option(section, 'signatures'):
 
159
        if self._get_parser().has_option(section, 'check_signatures'):
152
160
            return self._string_to_signature_policy(
153
 
                self._get_parser().get(section, 'signatures'))
 
161
                self._get_parser().get(section, 'check_signatures'))
154
162
 
155
163
    def _get_user_id(self):
156
164
        """Get the user id from the 'email' key in the current section."""