MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / siteNeedFile

Method siteNeedFile

src/main.py:317–337  ·  view source on GitHub ↗
(self, address, inner_path)

Source from the content-addressed store, hash-verified

315
316
317 def siteNeedFile(self, address, inner_path):
318 from Site.Site import Site
319 from Site import SiteManager
320 SiteManager.site_manager.load()
321
322 def checker():
323 while 1:
324 s = time.time()
325 time.sleep(1)
326 print("Switch time:", time.time() - s)
327 gevent.spawn(checker)
328
329 logging.info("Opening a simple connection server")
330 global file_server
331 from File import FileServer
332 file_server = FileServer("127.0.0.1", 1234)
333 file_server_thread = gevent.spawn(file_server.start, check_sites=False)
334
335 site = Site(address)
336 site.announce()
337 print(site.needFile(inner_path, update=True))
338
339 def siteCmd(self, address, cmd, parameters):
340 import json

Callers

nothing calls this directly

Calls 5

announceMethod · 0.95
needFileMethod · 0.95
FileServerClass · 0.90
SiteClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected