aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2016-09-13 11:02:28 -0500
committerGitHub2016-09-13 11:02:28 -0500
commit47afd15d6524a2071191952cd25796761353ad5e (patch)
treeac7bae3642875a730c4cee662cd94ebaaebf3e7c
parentd3ee8ad4b193cdcb9762a267955a2778ea75dc5a (diff)
parentf399b3bf514b396de67644d4b1e2018886cecac2 (diff)
downloadgenenetwork2-47afd15d6524a2071191952cd25796761353ad5e.tar.gz
Merge pull request #181 from pjotrp/zsloan
Run scripts from ./wqflask - just like the webserver
-rwxr-xr-xbin/genenetwork29
-rw-r--r--wqflask/base/data_set.py2
-rw-r--r--wqflask/maintenance/gen_select_dataset.py4
3 files changed, 8 insertions, 7 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 3a8c3ff4..d926d6a1 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -13,13 +13,12 @@
# Environment settings can be used to preconfigure as well as a
# settings.py file.
-# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")
-# Absolute path this script is in, thus /home/user/bin
GN2_BASE_PATH=$(dirname $(dirname "$SCRIPT"))
GN2_GUIX_PATH=$GN2_BASE_PATH/lib/python2.7/site-packages/genenetwork2-2.0-py2.7.egg
if [ -d $GN2_GUIX_PATH ]; then
+ echo GN2 is running from GUIX
GN2_BASE_PATH=$GN2_GUIX_PATH
fi
echo $GN2_BASE_PATH
@@ -48,9 +47,11 @@ fi
# Now handle command parameter -c
if [ $1 = '-c' ] ; then
+ cd $GN2_BASE_PATH/wqflask
+ cmd=${2#wqflask/}
echo PYTHONPATH=$PYTHONPATH
- echo RUNNING COMMAND $2
- /usr/bin/env python $2
+ echo RUNNING COMMAND $cmd
+ /usr/bin/env python $cmd
exit 0
fi
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 6cd3c8e6..1b4e1195 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -91,7 +91,7 @@ Publish or ProbeSet. E.g.
if USE_GN_SERVER:
data = menu_main()
else:
- file_name = "wqflask/wqflask/static/new/javascript/dataset_menu_structure.json"
+ file_name = "wqflask/static/new/javascript/dataset_menu_structure.json"
with open(file_name, 'r') as fh:
data = json.load(fh)
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
index f2f0830f..23adc4f9 100644
--- a/wqflask/maintenance/gen_select_dataset.py
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -40,8 +40,8 @@ from __future__ import print_function, division
import sys
-# NEW: Note we prepend the current path - otherwise a guix instance of GN2 is used instead
-sys.path.insert(0,'./wqflask')
+# NEW: Note we prepend the current path - otherwise a guix instance of GN2 may be used instead
+sys.path.insert(0,'./')
# NEW: import app to avoid a circular dependency on utility.tools
from wqflask import app