~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/gpg.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 23:08:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061011230827-2bdfc45020695281
Change Copyright .. by Canonical to Copyright ... Canonical

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""GPG signing and checking logic."""
19
19
 
 
20
import errno
20
21
import os
 
22
import subprocess
21
23
import sys
22
24
 
23
 
from bzrlib.lazy_import import lazy_import
24
 
lazy_import(globals(), """
25
 
import errno
26
 
import subprocess
27
 
 
28
25
from bzrlib import (
29
26
    errors,
30
27
    trace,
31
28
    ui,
32
29
    )
33
 
""")
34
30
 
35
31
 
36
32
class DisabledGPGStrategy(object):
50
46
        """Real strategies take a configuration."""
51
47
 
52
48
    def sign(self, content):
53
 
        return ("-----BEGIN PSEUDO-SIGNED CONTENT-----\n" + content +
54
 
                "-----END PSEUDO-SIGNED CONTENT-----\n")
 
49
        return content
55
50
 
56
51
 
57
52
def _set_gpg_tty():
77
72
        self._config = config
78
73
 
79
74
    def sign(self, content):
80
 
        if isinstance(content, unicode):
81
 
            raise errors.BzrBadParameterUnicode('content')
82
75
        ui.ui_factory.clear_term()
83
76
 
84
77
        preexec_fn = _set_gpg_tty