<commit_before>#!/bin/bash
#
# Fetch current IPython sources and extract docstrings from them.
#

if test "$1" = ""; then
    echo "Usage: pull-ipython.sh OUTPUTFILE"
    exit 1
fi

set -e

# 1. Fetch/update sources from Bzr

if test ! -d ipython; then
    bzr branch lp:ipython ipython
fi

pushd ipython

bzr pull --overwrite
bzr revert --no-backup .

# 2. Build and install the module

rm -rf dist
python2.5 setup.py install --prefix=dist

popd

# 3. Extract docstrings

export SITEPATH=$PWD/ipython/dist/lib/python2.5/site-packages

python2.5 $PYDOCTOOL collect -s $SITEPATH \
    IPython \
| $PYDOCTOOL prune -i - \
| $PYDOCTOOL sphinx-docs -i - -n ipython-docs -e .txt \
    ipython/docs/source \
> "$1"<commit_msg>Add docs-only example to the IPython example<commit_after>#!/bin/bash
#
# Fetch current IPython sources and extract docstrings from them.
#

if test "$1" = ""; then
    echo "Usage: pull-ipython.sh OUTPUTFILE"
    exit 1
fi

set -e

# 1. Fetch/update sources from Bzr

if test ! -d ipython; then
    bzr branch lp:ipython ipython
fi

pushd ipython

bzr pull --overwrite
bzr revert --no-backup .

# 2. Build and install the module

rm -rf dist
python2.5 setup.py install --prefix=dist

popd

# 3. Extract docstrings

export SITEPATH=$PWD/ipython/dist/lib/python2.5/site-packages

python2.5 $PYDOCTOOL collect -s $SITEPATH \
    IPython \
| $PYDOCTOOL prune -i - \
| $PYDOCTOOL sphinx-docs -i - -n ipython-docs -e .txt \
    ipython/docs/source \
> "$1"

## 3b. Another possibility: just the Sphinx docs
#$PYDOCTOOL sphinx-docs -i - -n ipython-docs -e .txt \
#    ipython/docs/source \
#> "$1"
{'fraction_non_alphanumeric': 0.1191806331471136, 'fraction_numerical': 0.016139044072004966, 'mean_word_length': 2.950980392156863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '7185367', 'n_tokens_mistral': 668, 'n_tokens_neox': 637, 'n_words': 187}