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 DHT is a class that implements interfaces.IDHT.
11 Diagram of the interaction between the given modules::
13 +---------------+ +-------------+ +----------------+ +-------------
14 | AptP2P | | DHTManager | | IDHT | |
15 | |--->|start |--->|join DHT|----|--\
16 | | | |--->|loadConfig | | | Another
17 | |--->|get |--->|getValue | | | Node
18 | |--->|store |--->|storeValue DHT|<---|--/
20 | /-----|--->|getStats |--->|getStats | |
21 | | | +-------------+ +----------------+ | Internet
22 | | | +-------------+ +----------------+ |
23 | | | | PeerManager | | HTTPDownloader*| |
24 | | |--->|get |--->|get HTTP|----|---> Mirror
25 | | | | |--->|getRange | |
26 | | |--->|close |--->|close HTTP|----|--\
27 | | | +-------------+ +----------------+ | | Another
28 | | | +-----------------------------------+ | | Peer
29 | | | | HTTPServer HTTP|<---|--/
30 | | | | | +-------------
31 | getStats|<---| | +-------------
32 | get_resp|<---| HTTP|<---|HTTP Request
33 | | +-----------------------------------+ |
34 | | +---------------+ +--------------+ | Local Net
35 | | | CacheManager | | ProxyFile- | | (apt)
36 | |--->|scanDirectories| | Stream* | |
37 | |--->|save_file |--->|__init__ HTTP|--->|HTTP Response
38 | |--->|save_error | | | +-------------
39 | | | | | | +-------------
40 |new_cached_file|<---| | | file|--->|write file
41 | | +---------------+ +--------------+ |
42 | | +---------------+ +--------------+ | Filesystem
43 | | | MirrorManager | | AptPackages* | |
44 | |--->|updatedFile |--->|file_updated | |
45 | |--->|findHash |--->|findHash file|<---|read file
46 +---------------+ +---------------+ +--------------+ +-------------