~ubuntu-branches/ubuntu/oneiric/software-properties/oneiric-updates

« back to all changes in this revision

Viewing changes to softwareproperties/ppa.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Michael Vogt, Martin Pitt
  • Date: 2011-05-18 09:59:32 UTC
  • Revision ID: james.westby@ubuntu.com-20110518095932-wy61p72qg8tm6o6a
Tags: 0.80.10
[ Michael Vogt ]
* merged lp:~hodgestar/software-properties/configurable-key-server,
  many thanks

[ Martin Pitt ]
* software-properties-gtk: Stop forcing GTK 2, we want to use GTK 3 now.
  Update gir dependency accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from urllib2 import urlopen, Request, URLError
28
28
from urlparse import urlparse
29
29
 
 
30
DEFAULT_KEYSERVER = "hkp://keyserver.ubuntu.com:80/"
 
31
 
30
32
def encode(s):
31
33
    return re.sub("[^a-zA-Z0-9_-]","_", s)
32
34
 
55
57
class AddPPASigningKeyThread(Thread):
56
58
    " thread class for adding the signing key in the background "
57
59
 
58
 
    def __init__(self, ppa_path):
 
60
    def __init__(self, ppa_path, keyserver=None):
59
61
        Thread.__init__(self)
60
62
        self.ppa_path = ppa_path
 
63
        self.keyserver = (keyserver if keyserver is not None
 
64
                          else DEFAULT_KEYSERVER)
61
65
        
62
66
    def run(self):
63
67
        self.add_ppa_signing_key(self.ppa_path)
86
90
            #        the load
87
91
            res = subprocess.call(
88
92
                ["apt-key", "adv", 
89
 
                 "--keyserver", "hkp://keyserver.ubuntu.com:80/",
 
93
                 "--keyserver", self.keyserver,
90
94
                 "--recv", signing_key_fingerprint[0]])
91
95
            return (res == 0)
92
96
        except URLError, e: