Skip to content

Commit

Permalink
should fix people who can't write to their own tempdir (wtf)
Browse files Browse the repository at this point in the history
  • Loading branch information
glamp committed Apr 24, 2015
1 parent e3247ac commit 9327375
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions rodeo/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import atexit
import subprocess
import uuid
import tempfile
import time
import os
import sys
Expand Down Expand Up @@ -60,10 +59,9 @@ def __get_variables():
"""

class Kernel(object):
def __init__(self, plot_dir):
self.plot_dir = plot_dir
def __init__(self, active_dir):
# kernel config is stored in a temp file
config = os.path.join(tempfile.gettempdir(), "kernel-%s.json" % str(uuid.uuid4()))
config = os.path.join(active_dir, ".kernel-%s.json" % str(uuid.uuid4()))
args = [sys.executable, '-m', 'IPython', 'kernel', '-f', config]
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

Expand Down
3 changes: 1 addition & 2 deletions rodeo/rodeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from flask import Flask, request, render_template, jsonify
import pip
import webbrowser
import tempfile
import json
import os
import sys
Expand Down Expand Up @@ -83,7 +82,7 @@ def main(directory, port=5000, host=None, browser=True):
if not port:
port = 5000

kernel = Kernel(plot_dir)
kernel = Kernel(active_dir)
art = open(os.path.join(__dirname, "rodeo-ascii.txt"), 'r').read()
display = """
{ART}
Expand Down

0 comments on commit 9327375

Please sign in to comment.