(self, address)
| 286 | print(site.peers) |
| 287 | |
| 288 | def siteDownload(self, address): |
| 289 | from Site.Site import Site |
| 290 | from Site import SiteManager |
| 291 | SiteManager.site_manager.load() |
| 292 | |
| 293 | logging.info("Opening a simple connection server") |
| 294 | global file_server |
| 295 | from File import FileServer |
| 296 | file_server = FileServer("127.0.0.1", 1234) |
| 297 | file_server_thread = gevent.spawn(file_server.start, check_sites=False) |
| 298 | |
| 299 | site = Site(address) |
| 300 | |
| 301 | on_completed = gevent.event.AsyncResult() |
| 302 | |
| 303 | def onComplete(evt): |
| 304 | evt.set(True) |
| 305 | |
| 306 | site.onComplete.once(lambda: onComplete(on_completed)) |
| 307 | print("Announcing...") |
| 308 | site.announce() |
| 309 | |
| 310 | s = time.time() |
| 311 | print("Downloading...") |
| 312 | site.downloadContent("content.json", check_modifications=True) |
| 313 | |
| 314 | print("Downloaded in %.3fs" % (time.time()-s)) |
| 315 | |
| 316 | |
| 317 | def siteNeedFile(self, address, inner_path): |
nothing calls this directly
no test coverage detected