|
|
@@ -398,7 +398,6 @@ class Stream(NilmApp): |
|
|
|
# /stream/extract?path=/newton/prep&start=1234567890.0&end=1234567899.0 |
|
|
|
@cherrypy.expose |
|
|
|
@chunked_response |
|
|
|
@response_type("text/plain") |
|
|
|
def extract(self, path, start = None, end = None, |
|
|
|
count = False, markup = False, binary = False): |
|
|
|
""" |
|
|
@@ -424,11 +423,13 @@ class Stream(NilmApp): |
|
|
|
raise cherrypy.HTTPError("404", "No such stream: " + path) |
|
|
|
|
|
|
|
if binary: |
|
|
|
cherrypy.response.headers['Content-Type'] = ( |
|
|
|
"application/octet-stream") |
|
|
|
content_type = "application/octet-stream" |
|
|
|
if markup or count: |
|
|
|
raise cherrypy.HTTPError("400", "can't mix binary and " |
|
|
|
"markup or count modes") |
|
|
|
else: |
|
|
|
content_type = "text/plain" |
|
|
|
cherrypy.response.headers['Content-Type'] = content_type |
|
|
|
|
|
|
|
@workaround_cp_bug_1200 |
|
|
|
def content(start, end): |
|
|
|