]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht/__init__.py
Various documentation fixes and additions.
[quix0rs-apt-p2p.git] / apt_dht / __init__.py
index 82d30c82acff22b8c29413715c78a056e87e4dcd..b945cecc62c30ca08dbcd6d0d80ee973236e9dcd 100644 (file)
@@ -1,13 +1,20 @@
 
 """The main apt-dht modules.
 
+To run apt-dht, you probably want to do something like::
+
+  from apt_dht.apt_dht import AptDHT
+  myapp = AptDHT(myDHT)
+
+where myDHT is a DHT that implements interfaces.IDHT.
+
 Diagram of the interaction between the given modules::
   
   +---------------+    +-----------------------------------+    +-------------
   |     AptDHT    |    |               DHT                 |    |  Internet
   |               |--->|join                            DHT|----|--\    
   |               |--->|loadConfig                         |    |  | Another
-  |               |--->|getValue                           |    |  | Peer
+  |               |--->|getValue                           |    |  | Node
   |               |--->|storeValue                      DHT|<---|--/
   |               |--->|leave                              |    |
   |               |    +-----------------------------------+    |
@@ -15,27 +22,26 @@ Diagram of the interaction between the given modules::
   |               |    | PeerManager |    | HTTPDownloader*|    |
   |               |--->|get          |--->|get         HTTP|----|---> Mirror
   |               |    |             |--->|getRange        |    |
-  |               |--->|close        |--->|close       HTTP|----|--\
-  |               |    +-------------+    +----------------+    |  |
-  |               |    +-----------------------------------+    |  | Another
-  |               |    |           HTTPServer              |    |  | Peer
-  |               |--->|getHTTPFactory                 HTTP|<---|--/
+  |               |--->|close        |--->|close       HTTP|----|--\       
+  |               |    +-------------+    +----------------+    |  | Another
+  |               |    +-----------------------------------+    |  | Peer
+  |               |    |           HTTPServer          HTTP|<---|--/   
+  |               |--->|getHTTPFactory                     |    +-------------
   |check_freshness|<---|                                   |    +-------------
-  |       get_resp|<---|                                   |    +-------------
-  |          /----|--->|setDirectories                 HTTP|<---|HTTP Request
-  |          |    |    +-----------------------------------+    | 
-  |          |    |    +---------------+    +--------------+    | Local Net
-  |          |    |    | CacheManager  |    | ProxyFile-   |    | (apt)
-  |          |    |--->|scanDirectories|    | Stream*      |    |
-  | setDirectories|<---|               |--->|__init__  HTTP|--->|HTTP Response
-  |               |--->|save_file      |    |              |    +-------------
+  |       get_resp|<---|                               HTTP|<---|HTTP Request
+  |               |    +-----------------------------------+    | 
+  |               |    +---------------+    +--------------+    | Local Net
+  |               |    | CacheManager  |    | ProxyFile-   |    | (apt)
+  |               |--->|scanDirectories|    | Stream*      |    |
+  |               |--->|save_file      |--->|__init__  HTTP|--->|HTTP Response
   |               |--->|save_error     |    |              |    +-------------
+  |               |    |               |    |              |    +-------------
   |new_cached_file|<---|               |    |          file|--->|write file
   |               |    +---------------+    +--------------+    |
   |               |    +---------------+    +--------------+    | Filesystem
   |               |    | MirrorManager |    | AptPackages* |    |
-  |               |--->|updatedFile    |--->|file_updated  |--->|write file
-  |               |--->|findHash       |--->|findHash      |    |
+  |               |--->|updatedFile    |--->|file_updated  |    | 
+  |               |--->|findHash       |--->|findHash  file|<---|read file
   +---------------+    +---------------+    +--------------+    +-------------
 
 """