fixed minor issues in ekgplotter

This commit is contained in:
Stefan Kögl 2014-03-27 14:10:26 +01:00
parent e77af368b1
commit 2855d59572
1 changed files with 6 additions and 5 deletions

View File

@ -336,6 +336,7 @@ class EkgPlot(object):
class MyHandler(BaseHTTPRequestHandler): class MyHandler(BaseHTTPRequestHandler):
def __del__(self): def __del__(self):
if hasattr(self, "thread"):
self.thread.running = False self.thread.running = False
self.thread.join() self.thread.join()
@ -406,12 +407,12 @@ class MyHandler(BaseHTTPRequestHandler):
#print '%0.2f fps' % fps #print '%0.2f fps' % fps
elif self.path.endswith(".jpeg"): elif self.path.endswith(".jpeg"):
f = open(curdir + sep + self.path) directory = os.path.dirname(os.path.abspath(__file__))
data = open(os.path.join(directory, self.path), "rb").read()
self.send_response(200) self.send_response(200)
self.send_header('Content-type','image/jpeg') self.send_header('Content-type','image/jpeg')
self.end_headers() self.end_headers()
self.wfile.write(f.read()) self.wfile.write(data)
f.close()
return return
except (KeyboardInterrupt, SystemError): except (KeyboardInterrupt, SystemError):
print "queue size", queue.qsize() print "queue size", queue.qsize()