Package apt_p2p :: Module MirrorManager :: Class MirrorManager
[hide private]
[frames] | no frames]

Class MirrorManager

source code

Manages all requests for mirror information.

Instance Methods [hide private]
 
__init__(self, cache_dir) source code
(string, string, string)
extractPath(self, url)
Break the full URI down into the site, base directory and path.
source code
 
init(self, site, baseDir)
Make sure an AptPackages exists for this mirror.
source code
 
updatedFile(self, url, file_path)
A file in the mirror has changed or been added.
source code
twisted.internet.defer.Deferred
findHash(self, url)
Find the hash for a given url.
source code
 
cleanup(self) source code
Instance Variables [hide private]
dictionary apt_caches
the avaliable mirrors
twisted.python.filepath.FilePath cache_dir
the directory to use for storing all files
Method Details [hide private]

extractPath(self, url)

source code 

Break the full URI down into the site, base directory and path.

Site is the host and port of the mirror. Base directory is the directory to the mirror location (usually just '/debian'). Path is the remaining path to get to the file.

E.g. http://ftp.debian.org/debian/dists/sid/binary-i386/Packages.bz2 would return ('ftp.debian.org:80', '/debian', '/dists/sid/binary-i386/Packages.bz2').

Parameters:
  • url - the URI of the file's location on the mirror
Returns: (string, string, string)
the site, base directory and path to the file

updatedFile(self, url, file_path)

source code 

A file in the mirror has changed or been added.

findHash(self, url)

source code 

Find the hash for a given url.

Parameters:
  • url - the URI of the file's location on the mirror
Returns: twisted.internet.defer.Deferred
a deferred that will fire with the returned Hash.HashObject