~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/gpg.py

  • Committer: Robert Collins
  • Date: 2005-10-17 10:50:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051017105039-87b9e081c41cb906
Add re-sign command to generate a digital signature on a single revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import bzrlib.errors as errors
24
24
 
 
25
class LoopbackGPGStrategy(object):
 
26
 
 
27
    def __init__(self, ignored):
 
28
        """Real strategies take a configuration."""
 
29
 
 
30
    def sign(self, content):
 
31
        return content
 
32
 
 
33
 
25
34
class GPGStrategy(object):
26
35
    """GPG Signing and checking facilities."""
27
36
        
43
52
                if process.returncode != 0:
44
53
                    raise errors.SigningFailed(self._command_line())
45
54
                return result
46
 
            except IOError, e:
 
55
            except OSError, e:
47
56
                if e.errno == errno.EPIPE:
48
57
                    raise errors.SigningFailed(self._command_line())
 
58
                else:
 
59
                    raise
49
60
        except ValueError:
50
61
            # bad subprocess parameters, should never happen.
51
62
            raise