(self)
| 63 | yield part |
| 64 | |
| 65 | def actionZip(self): |
| 66 | address = self.get["address"] |
| 67 | site = self.server.site_manager.get(address) |
| 68 | if not site: |
| 69 | return self.error404("Site not found") |
| 70 | |
| 71 | title = site.content_manager.contents.get("content.json", {}).get("title", "") |
| 72 | filename = "%s-backup-%s.zip" % (title, time.strftime("%Y-%m-%d_%H_%M")) |
| 73 | filename_quoted = urllib.parse.quote(filename) |
| 74 | self.sendHeader(content_type="application/zip", extra_headers={'Content-Disposition': 'attachment; filename="%s"' % filename_quoted}) |
| 75 | |
| 76 | return self.streamZip(site.storage.getPath(".")) |
| 77 | |
| 78 | def streamZip(self, dir_path): |
| 79 | zs = ZipStream(dir_path) |
nothing calls this directly
no test coverage detected