<commit_before>#!/bin/bash

# Common setup for all web2py applications (opentree, curator, phylesystem-api)

if [ "$#" -ne 2 ]; then
    echo "install-common.sh WNA (expecting 2)"
    exit 1
fi

OPENTREE_DEFAULT_APPLICATION=$1
CONTROLLER=$2

. setup/functions.sh

echo "Installing web2py common"

bash setup/install-web2py.sh

echo "...fetching opentree repo..."
git_refresh OpenTreeOfLife opentree || true

# requirements list ?

(cd web2py/applications; \
    ln -sf ../../repo/$WEBAPP/common ./)

cp -p repo/opentree/oauth20_account.py web2py/gluon/contrib/login_methods/
cp -p repo/opentree/rewrite.py web2py/gluon/

TMP=/tmp/tmp.tmp
echo default_application should be "$OPENTREE_DEFAULT_APPLICATION"
sed -e "s+default_application='.*'+default_application='$OPENTREE_DEFAULT_APPLICATION'+" \
   repo/opentree/SITE.routes.py >$TMP
cp $TMP web2py/routes.py
rm $TMP
grep default_ web2py/routes.py

# Kludge in case OPENTREE_DEFAULT_APPLICATION is set to 'welcome'
cp -p repo/opentree/webapp/static/robots.txt web2py/applications/welcome/static/<commit_msg>Add robots.txt to static/ of 'phylesystem' webapp<commit_after>#!/bin/bash

# Common setup for all web2py applications (opentree, curator, phylesystem-api)

if [ "$#" -ne 2 ]; then
    echo "install-common.sh WNA (expecting 2)"
    exit 1
fi

OPENTREE_DEFAULT_APPLICATION=$1
CONTROLLER=$2

. setup/functions.sh

echo "Installing web2py common"

bash setup/install-web2py.sh

echo "...fetching opentree repo..."
git_refresh OpenTreeOfLife opentree || true

# requirements list ?

(cd web2py/applications; \
    ln -sf ../../repo/$WEBAPP/common ./)

cp -p repo/opentree/oauth20_account.py web2py/gluon/contrib/login_methods/
cp -p repo/opentree/rewrite.py web2py/gluon/

TMP=/tmp/tmp.tmp
echo default_application should be "$OPENTREE_DEFAULT_APPLICATION"
sed -e "s+default_application='.*'+default_application='$OPENTREE_DEFAULT_APPLICATION'+" \
   repo/opentree/SITE.routes.py >$TMP
cp $TMP web2py/routes.py
rm $TMP
grep default_ web2py/routes.py

# Kludge in case OPENTREE_DEFAULT_APPLICATION is set to 'welcome' or (more likely) 'phylesystem'
cp -p repo/opentree/webapp/static/robots.txt web2py/applications/welcome/static/
cp -p repo/opentree/webapp/static/robots.txt web2py/applications/phylesystem/static/
{'fraction_non_alphanumeric': 0.12268314210061783, 'fraction_numerical': 0.014563106796116505, 'mean_word_length': 4.515815085158151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6862640', 'n_tokens_mistral': 858, 'n_tokens_neox': 840, 'n_words': 183}