2 """The main apt-p2p modules.
4 To run apt-p2p, you probably want to do something like::
6 from apt_p2p.apt_p2p import AptP2P
9 where myDHT is a DHT that implements interfaces.IDHT.
11 Diagram of the interaction between the given modules::
13 +---------------+ +-----------------------------------+ +-------------
14 | AptP2P | | DHT | | Internet
15 | |--->|join DHT|----|--\
16 | |--->|loadConfig | | | Another
17 | |--->|getValue | | | Node
18 | |--->|storeValue DHT|<---|--/
20 | | +-----------------------------------+ |
21 | | +-------------+ +----------------+ |
22 | | | PeerManager | | HTTPDownloader*| |
23 | |--->|get |--->|get HTTP|----|---> Mirror
24 | | | |--->|getRange | |
25 | |--->|close |--->|close HTTP|----|--\
26 | | +-------------+ +----------------+ | | Another
27 | | +-----------------------------------+ | | Peer
28 | | | HTTPServer HTTP|<---|--/
29 | |--->|getHTTPFactory | +-------------
30 |check_freshness|<---| | +-------------
31 | get_resp|<---| HTTP|<---|HTTP Request
32 | | +-----------------------------------+ |
33 | | +---------------+ +--------------+ | Local Net
34 | | | CacheManager | | ProxyFile- | | (apt)
35 | |--->|scanDirectories| | Stream* | |
36 | |--->|save_file |--->|__init__ HTTP|--->|HTTP Response
37 | |--->|save_error | | | +-------------
38 | | | | | | +-------------
39 |new_cached_file|<---| | | file|--->|write file
40 | | +---------------+ +--------------+ |
41 | | +---------------+ +--------------+ | Filesystem
42 | | | MirrorManager | | AptPackages* | |
43 | |--->|updatedFile |--->|file_updated | |
44 | |--->|findHash |--->|findHash file|<---|read file
45 +---------------+ +---------------+ +--------------+ +-------------