1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#!/bin/bash
# emacs: -*- mode: shell-script; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
# vi: set ft=sh sts=4 ts=4 sw=4 noet:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#echo "./tests/crossval.py" | \
#echo "tests/test_algorithms.py" | \
#echo "mvpa/datasets/mapper.py" | \
find -iname '*.py' | \
while read fname; do
grep -q 'This package is distributed in the hope' $fname || continue
descr="`grep '[#"]* *PyMVPA: ' "$fname" | head -1 | sed -e 's/^.*PyMVPA: //g' -e 's/"""//g'`"
[ "$descr" == "" ] && \
descr="`sed -n -e '/###/,/^[^#]/p' "$fname" | grep '"""' | head -1 | sed -e 's/^"""\(PyMVPA: *\)*\(.*\)"""/\2/g'`"
[ "$descr" == "" ] && \
descr="`sed -n -e '/###/,/^[^#]/p' $fname | sed -n -e '3s/^# *//gp'`"
echo "$fname:$descr"
cat $fname \
| sed -e '0,/### ###/d' -e '0,/### ###/d' \
| sed -e '1rdoc/misc/header.py' \
| sed -e 's/\t/ /g' \
| sed -n -e "s/\(\"PyMVPA: \)\"/\1${descr}\"/g" -e '2,$p' \
| sed -e 's/ -- loosely implemented//g' \
| sponge $fname
done
exit 0
problematic: mvpa/misc/fsl/__init__.py -- removed header completely for some reason...
tests/test_algorithms.py os gone!
mvpa/datasets/mapper.py is gone
|