]> arthur.barton.de Git - bup.git/blob - lib/bup/repo.py
Add repo abstraction and use it in join
[bup.git] / lib / bup / repo.py
1
2 from bup import client, git
3
4
5 class LocalRepo:
6     def __init__(self, repo_dir=None):
7         self.repo_dir = repo_dir or git.repo()
8         self._cp = git.cp(repo_dir)
9
10     def join(self, ref):
11         return self._cp.join(ref)
12
13 class RemoteRepo:
14     def __init__(self, address):
15         self.address = address
16         self.client = client.Client(address)
17
18     def join(self, ref):
19         return self.client.cat(ref)