Beispiel #1
0
 def __init__(self):
     self.iface_cache = iface_cache.IfaceCache()
     self.handler = DummyHandler()
     self.stores = Stores()
     self.fetcher = TestFetcher(self)
     self.trust_db = trust.trust_db
     self.trust_mgr = trust.TrustMgr(self)
Beispiel #2
0
from xml.dom import minidom
from zeroinstall.injector import namespaces
from zeroinstall.zerostore import manifest, Stores, NotStored
import xmltools
from logging import info

stores = Stores()


def digests(impl):
    id = impl.getAttribute('id')
    if '=' in id:
        yield id.split('=', 1)
    for x in xmltools.children(impl, 'manifest-digest'):
        for name, value in x.attributes.itemsNS():
            if name[0] is None:
                yield name[1], value


def get_version(impl):
    while impl:
        v = impl.getAttribute('version')
        if v: return v
        impl = impl.parentNode


def add_digest(impl, alg_name):
    alg = manifest.get_algorithm(alg_name)

    # Scan through the existing digests
    # - If we've already got the one we need, return