Created
March 1, 2011 02:50
-
-
Save teepark/848508 to your computer and use it in GitHub Desktop.
see which of your modules will shadow standard library modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
EXCLUDES="htdocs mod py vendor tools client qa test" | |
stdlib_dir=`python -c 'import os; print os.path.dirname(os.__file__)'` | |
stdlib=`find $stdlib_dir -maxdepth 1 -name '*.py' -exec basename {} .py \;;\ | |
find $stdlib_dir -maxdepth 2 -name __init__.py -exec dirname {} \; | xargs -L1 basename` | |
find `[ -n "$1" ] && echo $1 || echo .` \ | |
-not \( -false \ | |
`for name in $EXCLUDES; do | |
echo " -o -name $name -type d -prune" | |
done` \ | |
\) \ | |
\( -false \ | |
`for name in $stdlib; do | |
echo " -o -name $name.py -type f -o -name $name -type d" | |
done` \ | |
\) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment