version 0.2.6, database support, dbrebuild and dbquery startup commands, connection firstchar error bugfix, log python gevent msgpack lib versions, sitestorage class for site file operations, dbquery websocket api command

This commit is contained in:
HelloZeroNet 2015-03-19 21:19:14 +01:00
parent bce0f56d45
commit 3b8d49207e
16 changed files with 699 additions and 120 deletions

View file

@ -57,9 +57,8 @@ class FileRequest:
if valid == True: # Valid and changed
self.log.info("Update for %s looks valid, saving..." % params["inner_path"])
buff.seek(0)
file = open(site.getPath(params["inner_path"]), "wb")
shutil.copyfileobj(buff, file) # Write buff to disk
file.close()
site.storage.write(params["inner_path"], buff)
site.onFileDone(params["inner_path"]) # Trigger filedone
if params["inner_path"].endswith("content.json"): # Download every changed file from peer
@ -92,7 +91,7 @@ class FileRequest:
self.response({"error": "Unknown site"})
return False
try:
file_path = site.getPath(params["inner_path"])
file_path = site.storage.getPath(params["inner_path"])
if config.debug_socket: self.log.debug("Opening file: %s" % file_path)
file = open(file_path, "rb")
file.seek(params["location"])