Skip to content

Commit

Permalink
Make viewer runnable from outer dirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihneadb committed May 22, 2016
1 parent f9685ec commit ad595aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion execution_trace/viewer/viewer.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Run with `python viewer.py PATH_TO_RECORD_JSON.

import json
import os
import sys

from flask import Flask, jsonify
from flask.helpers import send_from_directory


app = Flask(__name__)
viewer_root = os.path.abspath(os.path.dirname(__file__))


# `main` inits these.
# File containing `record` output.
Expand All @@ -18,7 +21,7 @@

@app.route("/")
def hello():
return send_from_directory('.', 'index.html')
return send_from_directory(viewer_root, 'index.html')


@app.route("/source.json")
Expand Down

0 comments on commit ad595aa

Please sign in to comment.