/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to crypt.py

  • Committer: Daniel Schierbeck
  • Date: 2008-04-02 08:56:40 UTC
  • mto: (450.1.16 trunk)
  • mto: This revision was merged to the branch mainline in revision 458.
  • Revision ID: daniel.schierbeck@gmail.com-20080402085640-7d7eerpks2ciuwpm
Added key location getter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
TRUST_FULL = 5
33
33
TRUST_ULTIMATE = 10
34
34
 
 
35
LOCATION_MISSING = 10
 
36
LOCATION_SEARCHING = 20
 
37
LOCATION_REMOTE = 50
 
38
LOCATION_LOCAL = 100
 
39
 
35
40
def discover(*key_ids):
36
41
    return openpgp.DiscoverKeys(key_ids, 0)
37
42
 
48
53
        self.trust = None
49
54
        self.flags = None
50
55
        self.display_name = None
 
56
        self.location = None
51
57
 
52
58
    def get_field(self, field, default=None):
53
59
        (valid, value) = openpgp.GetKeyField(self.key, field)
84
90
 
85
91
        return self.trust
86
92
 
 
93
    def get_location(self):
 
94
        if self.location is None:
 
95
            self.location = self.get_field('location', LOCATION_MISSING)
 
96
 
 
97
        return self.location
 
98
 
87
99
    def is_available(self):
88
100
        return self.key != ""
89
101