Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nyroglancer/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get(self):

class MainBundle(IPythonHandler):
def get(self):
self.write(main_js.replace("chunk_worker.bundle.js", "js/neuroglancer/chunk_worker.bundle.js"))
self.write(main_js.replace("chunk_worker.bundle.js".encode('utf8'), "js/neuroglancer/chunk_worker.bundle.js".encode('utf8')))
self.set_header("Content-Type", "application/javascript")

class ChunkWorkerBundle(IPythonHandler):
Expand Down
8 changes: 7 additions & 1 deletion nyroglancer/intrusion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from jupyter_client import BlockingKernelClient
import sys

clients = {}

Expand Down Expand Up @@ -58,7 +59,12 @@ def evaluate(kernel_client, expression):
result['evalue'] + "\n\n" +
"\n\t".join(result['traceback']))

data = result['data'].values()[0].strip().strip('\'').decode('string-escape')
raw_data = result['data'].values()[0].strip().strip('\'')
# python3
if sys.version_info[0] == 3:
data = bytes(raw_data, 'utf8').decode('unicode_escape')
else:
data = raw_data.decode('string_escape')

#print "[nyroglancer] return data part (between >>> and <<<):\n\t>>>" + str(data) + "<<<\n"

Expand Down
6 changes: 3 additions & 3 deletions nyroglancer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from tornado.escape import url_escape
from tornado.httpclient import HTTPClient
import collections
import intrusion
import nyroglancer.intrusion
import json
import ndstore
import nyroglancer.ndstore
import neuroglancer
import urllib

Expand Down Expand Up @@ -54,7 +54,7 @@ def register_volume(self, volume):
cf = url_escape(find_connection_file())
http_client= HTTPClient()
try:
response = http_client.fetch(self.get_server_url() + '/register_token/' + volume.token.decode('utf8') + '/' + cf)
response = http_client.fetch(self.get_server_url() + '/register_token/' + volume.token.decode('utf8') + '/'+ cf)
except Exception as e:
raise RuntimeError("could not register token: " + str(e))
http_client.close()
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
jupyter
neuroglancer>=0.0.6
request