mirror of
https://github.com/HelloZeroNet/ZeroNet.git
synced 2023-12-14 04:33:03 +01:00
New API command: fileNeed to request optional file
This commit is contained in:
parent
24982aee42
commit
d093764731
1 changed files with 8 additions and 0 deletions
|
@ -605,6 +605,14 @@ class UiWebsocket(object):
|
|||
body = base64.b64encode(body)
|
||||
return self.response(to, body)
|
||||
|
||||
def actionFileNeed(self, to, inner_path, timeout=300):
|
||||
try:
|
||||
with gevent.Timeout(timeout):
|
||||
self.site.needFile(inner_path, priority=6)
|
||||
except Exception, err:
|
||||
return self.response(to, {"error": str(err)})
|
||||
return self.response(to, "ok")
|
||||
|
||||
def actionFileRules(self, to, inner_path):
|
||||
rules = self.site.content_manager.getRules(inner_path)
|
||||
if inner_path.endswith("content.json") and rules:
|
||||
|
|
Loading…
Reference in a new issue