summaryrefslogtreecommitdiff
path: root/morphlib/sourcepool.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 10:52:39 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 13:34:25 +0100
commitad31f7608febab04157e015a90f5047a6f0d8d83 (patch)
tree0ac0885cd6e77783a0251ed67ad03f3834679d00 /morphlib/sourcepool.py
parent48732135d4536880e5459e3064cce9cfa63d6abe (diff)
downloadmorph-ad31f7608febab04157e015a90f5047a6f0d8d83.tar.gz
Add a repo_name to Source, use that instead of repo in most places.
This is because we will need to integrate a RemoteRepoCache and we don't always want to create a CachedRepo object (in fact, we only want that for the sources of artifacts we actually need to build). So we'll use either the local or the remote repo cache to resolve refs and morphology texts and then later, when actually caching a repo, we'll set the source.repo member to a CachedRepo object that we can then use to unpack the sources.
Diffstat (limited to 'morphlib/sourcepool.py')
-rw-r--r--morphlib/sourcepool.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/morphlib/sourcepool.py b/morphlib/sourcepool.py
index 0f144ef2..b91f0f25 100644
--- a/morphlib/sourcepool.py
+++ b/morphlib/sourcepool.py
@@ -22,25 +22,25 @@ class SourcePool(object):
self._sources = {}
self._order = []
- def _key(self, reponame, original_ref, filename):
- return (reponame, original_ref, filename)
+ def _key(self, repo_name, original_ref, filename):
+ return (repo_name, original_ref, filename)
def add(self, source):
'''Add a source to the pool.'''
- key = self._key(source.repo.original_name,
+ key = self._key(source.repo_name,
source.original_ref,
source.filename)
self._sources[key] = source
self._order.append(source)
- def lookup(self, reponame, original_ref, filename):
+ def lookup(self, repo_name, original_ref, filename):
'''Find a source in the pool.
Raise KeyError if it is not found.
'''
- key = self._key(reponame, original_ref, filename)
+ key = self._key(repo_name, original_ref, filename)
return self._sources[key]
def __iter__(self):