From 1ac721eb8ae001b7e67633b791c72fa80886bbcd Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 26 Mar 2006 16:27:27 +0000 Subject: [PATCH] Removed 'sources' from model.Interface. It is covered by metadata now. git-svn-id: file:///home/talex/Backups/sf.net/Subversion/zero-install/trunk/0launch@742 9f8c893c-44ee-0310-b757-c8ca8341c71e --- README | 2 +- tests/testautopolicy.py | 6 ++---- tests/testmodel.py | 4 ---- zeroinstall/injector/model.py | 10 +--------- zeroinstall/injector/reader.py | 6 ------ 5 files changed, 4 insertions(+), 24 deletions(-) diff --git a/README b/README index 31f56fa..8528282 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ The Zero Install Injector -Copyright Thomas Leonard, 2005 +Copyright Thomas Leonard, 2006 INTRODUCTION diff --git a/tests/testautopolicy.py b/tests/testautopolicy.py index 70d48c6..91fb54f 100755 --- a/tests/testautopolicy.py +++ b/tests/testautopolicy.py @@ -264,11 +264,9 @@ class TestAutoPolicy(unittest.TestCase): policy.get_interface(policy.root)) assert len(impls) == 4 - policy.network_use = model.network_offline - policy.recalculate() # Changes sort order tests - logger.setLevel(logging.ERROR) - policy.recalculate() # Triggers feed-for warning + policy.network_use = model.network_offline # Changes sort order tests + policy.recalculate() # Triggers feed-for warning logger.setLevel(logging.WARN) def testNoLocal(self): diff --git a/tests/testmodel.py b/tests/testmodel.py index f725287..87693d7 100755 --- a/tests/testmodel.py +++ b/tests/testmodel.py @@ -87,10 +87,6 @@ class TestModel(unittest.TestCase): b.version = [1,2,1] assert b > a - def testSource(self): - i = model.Interface('http://foo') - i.sources.append(model.Source('http://source-iface')) - def testDownloadSource(self): i = model.Interface('http://foo') a = model.Implementation(i, 'foo') diff --git a/zeroinstall/injector/model.py b/zeroinstall/injector/model.py index 2c88d70..e446974 100644 --- a/zeroinstall/injector/model.py +++ b/zeroinstall/injector/model.py @@ -59,13 +59,6 @@ testing = Stability(20, 'testing', 'Stability unknown - please test!') stable = Stability(30, 'stable', 'Tested - no serious problems found') preferred = Stability(40, 'preferred', 'Best of all - must be set manually') -class Source(object): - """An interface that can be executed to build a new implementation.""" - __slots__ = ['source_interface'] - - def __init__(self, source_interface): - self.source_interface = source_interface - class Restriction(object): """A Restriction limits the allowed implementations of an Interface.""" @@ -182,7 +175,7 @@ class Interface(object): """An Interface represents some contract of behaviour.""" __slots__ = ['uri', 'implementations', 'name', 'description', 'summary', 'stability_policy', 'last_modified', 'last_local_update', 'last_checked', - 'main', 'feeds', 'sources', 'feed_for', 'metadata'] + 'main', 'feeds', 'feed_for', 'metadata'] # last_local_update is deprecated @@ -209,7 +202,6 @@ class Interface(object): self.last_local_update = None self.last_checked = None self.main = None - self.sources = [] self.feeds = [] self.feed_for = {} # URI -> True self.metadata = [] diff --git a/zeroinstall/injector/reader.py b/zeroinstall/injector/reader.py index b5fac73..7c2c4cb 100644 --- a/zeroinstall/injector/reader.py +++ b/zeroinstall/injector/reader.py @@ -178,12 +178,6 @@ def update(interface, source, local = False): interface.description = interface.description or x.content elif x.name == 'summary': interface.summary = interface.summary or x.content - elif x.name == 'source': - source_interface = x.getAttribute('interface') - if source_interface: - interface.sources.append(Source(source_interface)) - else: - raise InvalidInterface("Missing interface attribute on ") elif x.name == 'feed-for': feed_iface = x.getAttribute('interface') if not feed_iface: -- 2.11.4.GIT