Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.

removes FLASK_DEBUG, adds --reload #184

Merged
merged 7 commits into from
Nov 8, 2017
Merged
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 Makefile
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ VERSION_FILE := $(FILES_DIR)/etc/version50
PLUGINS := audioplayer browser cat debug gist hex info presentation simple statuspage theme

NAME := ide50
VERSION := 123
VERSION := 124

define getplugin
@echo "\nFetching $(1)..."
5 changes: 1 addition & 4 deletions files/etc/profile.d/ide50.sh
Original file line number Diff line number Diff line change
@@ -105,12 +105,9 @@ export DEBIAN_FRONTEND=noninteractive

# flask
export FLASK_APP="application.py"
export FLASK_DEBUG="1"

# flask wrapper
alias flask="/home/ubuntu/.cs50/bin/flask"

# http-server wrapper
# http-server
alias http-server="/home/ubuntu/.cs50/bin/http-server"

# language
5 changes: 4 additions & 1 deletion files/home/ubuntu/.cs50/bin/flask
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ if [[ "$1" == "run" ]]; then
# default options
host="--host=0.0.0.0"
port="--port=8080"
reload="--reload"
threads="--with-threads"
options=""

@@ -25,6 +26,8 @@ if [[ "$1" == "run" ]]; then
host="$1"
elif [[ "$1" =~ ^--port= ]]; then
port="$1"
elif [[ "$1" =~ ^--(no-)?reload$ ]]; then
reload="$1"
elif [[ "$1" =~ ^--with(out)?-threads$ ]]; then
threads="$1"
else
@@ -34,7 +37,7 @@ if [[ "$1" == "run" ]]; then
done

# spawn flask
script --flush --quiet --return /dev/null --command "FLASK_APP=\"$FLASK_APP\" FLASK_DEBUG=\"$FLASK_DEBUG\" flask run $host $port $threads $options" |
script --flush --quiet --return /dev/null --command "FLASK_APP=\"$FLASK_APP\" FLASK_DEBUG=\"$FLASK_DEBUG\" flask run $host $port $reload $threads $options" |
while IFS= read -r line
do
# rewrite address as hostname50
11 changes: 6 additions & 5 deletions update50
Original file line number Diff line number Diff line change
@@ -142,8 +142,8 @@ unset PYTHONPATH
export PATH="$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"

# install python packages
PYTHON_PACKAGES="check50==2.1.3 \
cs50==2.3.1 \
PYTHON_PACKAGES="check50==2.2.1 \
cs50==2.3.2 \
feedparser \
Flask \
Flask-JSGlue \
@@ -153,14 +153,15 @@ PYTHON_PACKAGES="check50==2.1.3 \
nltk \
passlib \
plotly \
render50==2.1.1 \
render50==2.2.0 \
SQLAlchemy \
style50==2.3.3 \
submit50==2.4.5 \
submit50==2.4.6 \
termcolor \
twython \
virtualenv"
( sudo -H pip3 install $PYTHON_PACKAGES )

sudo -H pip3 install $PYTHON_PACKAGES
/opt/pyenv/bin/pyenv rehash

echo "Installing nltk data..."