diff options
| author | Sebastian Heinlein <sebi@sebi-laptop> | 2006-12-13 11:22:13 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-laptop> | 2006-12-13 11:22:13 +0100 |
| commit | 346ceff07430725f3c5170c20d5ba243d39212db (patch) | |
| tree | a4f1e0d95be22866d6ad879b5b81db94ccba9fab | |
| parent | cde9d2eafcee3d2769cb9cfecd6e6c1ad3ad153e (diff) | |
| download | python-apt-346ceff07430725f3c5170c20d5ba243d39212db.tar.gz | |
* add a class for mirrors
| -rw-r--r-- | AptSources/aptsources.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/AptSources/aptsources.py b/AptSources/aptsources.py index 748f6aaf..f73ff782 100644 --- a/AptSources/aptsources.py +++ b/AptSources/aptsources.py @@ -819,6 +819,27 @@ def get_distro(): else: return Distribution(id, codename, description, relase) +class Mirror: + ''' Used to store information about a mirror ''' + class Repository: + ''' A mirror can contain more than one repository and provide + access via different protocols. This information is stored + in this class ''' + def __init__(self, proto, dir) + ''' Initialize a new repository ''' + self.proto = proto + self.dir = dir + def __init__(self, hostname, repository=None) + ''' Initialize a new mirror ''' + self.hostname = hostname + proto, dir = repository + self.repositories = [] + self.add_repository(proto, dir) + def add_repository(self, proto, dir): + ''' Add a new repository to the mirror ''' + repo = Repository(proto, dir) + self.repositories.append(repo) + # some simple tests if __name__ == "__main__": apt_pkg.InitConfig() |
