<commit_before>#!/bin/sh
usage() { (cat <<USAGE
usage: $0

Generate and upload documentation to python-smisk.org.

USAGE
  ) >&2
}

cd "$(dirname "$0")/.."
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then usage ; exit 1; fi

rm -rf docs/html || exit 1
./setup.py docs || exit 1

VER=$(./setup.py --version)
REMOTEDIR="/var/www/python-smisk.org/www/public/docs"
TFN=".uploading-$(date '+%y%m%d-%H%M%S')-$VER"
echo "Uploading HTML docs to python-smisk.org:$REMOTEDIR/..."
scp -Cr "docs/html" "python-smisk.org:$REMOTEDIR/$TFN"
ssh python-smisk.org "cd $REMOTEDIR && rm -rf $VER && mv -f $TFN $VER"

echo "If you wish to make this documentation the current one, do this:"
echo "  ssh python-smisk.org 'cd $REMOTEDIR && ln -sf $VER current'"
<commit_msg>more explanative messages when uploading documentation<commit_after>#!/bin/sh
usage() { (cat <<USAGE
usage: $0

Generate and upload documentation to python-smisk.org.

USAGE
  ) >&2
}

cd "$(dirname "$0")/.."
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then usage ; exit 1; fi

rm -rf docs/html || exit 1
./setup.py docs || exit 1

VER=$(./setup.py --version)
REMOTEDIR="/var/www/python-smisk.org/www/public/docs"
TFN=".uploading-$(date '+%y%m%d-%H%M%S')-$VER"
echo "Uploading HTML docs to python-smisk.org:$REMOTEDIR/$TFN"
scp -Cr "docs/html" "python-smisk.org:$REMOTEDIR/$TFN"
echo "Upload done. Staging new files $REMOTEDIR/$TFN -> $REMOTEDIR/$VER"
ssh python-smisk.org "cd $REMOTEDIR && rm -rf $VER && mv -f $TFN $VER"

echo "If you wish to make this documentation the current one, do this:"
echo "  ssh python-smisk.org 'cd $REMOTEDIR && ln -sf $VER current'"

{'fraction_non_alphanumeric': 0.20024798512089276, 'fraction_numerical': 0.009919404835709857, 'mean_word_length': 3.775147928994083, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5349306', 'n_tokens_mistral': 671, 'n_tokens_neox': 625, 'n_words': 181}