Skip to content

Commit 6649b10

Browse files
committed
got rid of NODE and NODE_MODULES in settings.py; the cleanest way to deal with this is to setup PATH and NODE_PATH prior to running mathics/jupyter in a script
1 parent 68e7788 commit 6649b10

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

mathics/layout/client.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
# you may use "NODE" in settings.py to specify a custom node binary, and you may use NODE_PATH in settings.py
5-
# to specify a custom node_modules path (that has the necessary node modules mathjax-node, ...).
6-
#
74
# Your installation of nodejs with the following packages: mathjax-node svg2png (install them using
85
# npm).
96

@@ -15,8 +12,6 @@
1512
from subprocess import Popen
1613
import os
1714

18-
from mathics import settings
19-
2015
import socket
2116
import json
2217
import struct
@@ -116,8 +111,6 @@ def __init__(self):
116111
def _create_client(self):
117112
try:
118113
popen_env = os.environ.copy()
119-
if settings.NODE_MODULES:
120-
popen_env["NODE_PATH"] = os.path.expandvars(settings.NODE_MODULES)
121114

122115
server_path = os.path.join(
123116
os.path.dirname(os.path.realpath(__file__)), 'server.js')
@@ -127,7 +120,7 @@ def abort(message):
127120
raise WebEngineUnavailable(error_text + message)
128121

129122
process = Popen(
130-
[os.path.expandvars(settings.NODE), server_path],
123+
['node', server_path],
131124
stdout=subprocess.PIPE,
132125
env=popen_env)
133126

mathics/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
DEBUG = True
1414
TEMPLATE_DEBUG = DEBUG
1515

16-
# node.js based layout engine
17-
NODE = 'node' # path to node binary; default 'node' assumes it is in PATH
18-
NODE_MODULES = None # overrides NODE_PATH environment variable if not None
19-
2016
# set only to True in DEBUG mode
2117
DEBUG_MAIL = True
2218
PROPAGATE_EXCEPTIONS = True

0 commit comments

Comments
 (0)