sympy/stripmpmath.sh

21 lines
464 B
Bash
Raw Normal View History

2011-10-11 23:02:20 +00:00
#!/bin/bash
# Script for stripping traces of the bundled mpmath library
# 2011-10-12 Jussi Lehtola
# Loop
for i in `find . -name \*.py`; do
if [[ " `grep sympy.mpmath $i`" != " " ]]; then
echo $i
cp -a $i $i.mpmath
sed -i 's|sympy.mpmath|mpmath|g' $i
fi
if [[ " `grep 'from sympy import mpmath' $i`" != " " ]]; then
if [ ! -f $i.mpmath ]; then
echo $i
cp -a $i $i.mpmath
fi
sed -i 's|from sympy import mpmath|import mpmath|g' $i
fi
done