summaryrefslogtreecommitdiff
path: root/query
diff options
context:
space:
mode:
authorJosh Blum2013-06-11 01:13:40 -0700
committerJosh Blum2013-06-11 01:13:40 -0700
commitc10b1b4a55b44777d5ca7c5e570759a107cf38ed (patch)
tree5a21007d3abb108d7cd081f50908d67c8bb7af24 /query
parentb4fd0de25507f693a65274615bfedf648a214cba (diff)
downloadsandhi-c10b1b4a55b44777d5ca7c5e570759a107cf38ed.tar.gz
sandhi-c10b1b4a55b44777d5ca7c5e570759a107cf38ed.tar.bz2
sandhi-c10b1b4a55b44777d5ca7c5e570759a107cf38ed.zip
flow: continued tweaks to dot stuff
Diffstat (limited to 'query')
-rw-r--r--query/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/query/__init__.py b/query/__init__.py
index 28c11a4..40c645b 100644
--- a/query/__init__.py
+++ b/query/__init__.py
@@ -32,9 +32,9 @@ class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
s.end_headers()
dot = args['top_block'].query(json.dumps(dict(path='/flows.dot')))
import subprocess
- open("/tmp/dot.dot", 'w').write(dot)
- subprocess.check_call(["dot", "-T", "png", "-o", "/tmp/dot.png", "/tmp/dot.dot"])
- s.wfile.write(open("/tmp/dot.png").read())
+ p = subprocess.Popen(args=["dot", "-T", "png"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdout, stderr) = p.communicate(input=dot)
+ s.wfile.write(stdout)
return
#handle json requests