Skip to content
Snippets Groups Projects
Commit d5c14ab5 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

fancy printing in python pycumbia module load tests

parent 662cc1ca
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,7 @@ find "$dest_dir" -type f | while read -r file; do
done
if find "$dest_dir" -name ".gitignore" -print -quit | grep -q .; then
echo -e "\e[1;36m-\e[0m \e[1;3m.gitignore\e[0m file created in $dest_dir"
echo -e "\e[1;36m-\e[0m directory \e[1;3m$dest_dir\e[0m contains \e[1;3m.gitignore\e[0m file"
fi
# Success message
......
......@@ -8,42 +8,62 @@ python_test() {
fi
err=0
echo -e -n "\e[1;36m?\e[0m \e[3mfrom PyCumbia.Cumbia import Cumbia ..."
echo -e -n "[ \e[1;36mTEST\e[0m ] \e[3mfrom PyCumbia.Cumbia import Cumbia\e[0m ..."
# 1. PyCumbia.Cumbia
python -c "from PyCumbia.Cumbia import Cumbia" 2>/dev/null
if [ $? -eq 0 ]; then
echo -e "\t[ \e[1;32mOK\e[0m ]"
echo -e -n "\e[1;36m?\e[0m \e[3mfrom PyCumbia.QtControls import QuLabel, QuTrendPlot, QuSpectrumPlot, QuButton, CuContext\e[0m ..."
echo -e "\r[ \e[1;32mSUCCESS\e[0m ] from PyCumbia.Cumbia import Cumbia"
echo -e -n "[ \e[1;36mTEST\e[0m ] \e[3mfrom PyCumbia.QtControls import QuLabel, QuTrendPlot, QuSpectrumPlot, QuButton, CuContext\e[0m ..."
# 2. PyCumbia.QtControls
python -c "from PyCumbia.QtControls import QuLabel, QuTrendPlot, QuSpectrumPlot, QuButton, CuContext" 2>/dev/null
else
echo -e "\r[ \e[1;31mFAILED\e[0m ] from PyCumbia.Cumbia import Cumbia"
err=1
fi
if [ $? -eq 0 ]; then
echo -e "\t[ \e[1;32mOK\e[0m ]"
echo -e -n "\e[1;36m?\e[0m \e[3mfrom PyCumbia.Apps import CuModuleLoader\e[0m ..."
if [ $? -eq 0 ] && [ $err -eq 0 ]; then
sleep 0.1 # fancy sleep and \r
echo -e "\r[ \e[1;32mSUCCESS\e[0m ] from PyCumbia.QtControls import QuLabel, QuTrendPlot, QuSpectrumPlot, QuButton, CuContext"
echo -e -n "[ \e[1;36mTEST\e[0m ] \e[3mfrom PyCumbia.Apps import CuModuleLoader\e[0m ..."
python -c "from PyCumbia.Apps import CuModuleLoader" 2>/dev/null
else
elif [ $err -eq 0 ]; then
echo -e "\r[ \e[1;31mFAILED\e[0m ] from PyCumbia.QtControls import QuLabel, QuTrendPlot, QuSpectrumPlot, QuButton, CuContext"
err=1
fi
if [ $err -eq 0 ]; then
echo -e "\t[ \e[1;32mOK\e[0m ]"
echo -e -n "\e[1;36m?\e[0m \e[3mfrom PyCumbia.Plugins import Image\e[0m ..."
if [ $? -eq 0 ] && [ $err -eq 0 ]; then
sleep 0.1 # fancy sleep and \r
echo -e "\r[ \e[1;32mSUCCESS\e[0m ] from PyCumbia.Apps import CuModuleLoader"
echo -e -n "[ \e[1;36mTEST\e[0m ] \e[3mfrom PyCumbia.Plugins import Image\e[0m ..."
python -c "from PyCumbia.Plugins import Image" 2>/dev/null
else
elif [ $err -eq 0 ]; then
echo -e "\r[ \e[1;31mFAILED\e[0m ] from PyCumbia.Apps import CuModuleLoader"
err=1
fi
if [ $err -eq 0 ]; then
echo -e "\t[ \e[1;32mOK\e[0m ]"
echo -e -n "\e[1;36m?\e[0m \e[3mfrom PyCumbia.Plugins import Multireader\e[0m ..."
if [ $? -eq 0 ] && [ $err -eq 0 ]; then
sleep 0.1 # fancy sleep and \r
echo -e "\r[ \e[1;32mSUCCESS\e[0m ] from PyCumbia.Plugins import Image"
echo -e -n "[ \e[1;36mTEST\e[0m ] \e[3mfrom PyCumbia.Plugins import Multireader\e[0m ..."
python -c "from PyCumbia.Plugins import Multireader" 2>/dev/null
else
elif [ $err -eq 0 ]; then
echo -e -n "\r[ \e[1;31mFAILED\e[0m ] \e[3mfrom PyCumbia.Plugins import Image\e[0m"
err=1
fi
if [ $? -eq 0 ] && [ $err -eq 0 ]; then
sleep 0.1 # fancy sleep and \r
echo -e "\r[ \e[1;32mSUCCESS\e[0m ] from PyCumbia.Plugins import Multireader"
elif [ $err -eq 0 ]; then
echo -e "\r[ \e[1;31mFAILED\e[0m ] from PyCumbia.Plugins import Multireader"
err=1
fi
if [ $err -eq 0 ]; then
echo -e "\t[ \e[1;32mOK\e[0m ]"
echo -e "\e[1;32m*\e[0m some relevant \e[1;3mpycumbia\e[0m modules have been successfully loaded in the current python environment."
else
echo -e "\t[ \e[1;31mFAILED\e[0m ]"
echo -e "\e[1;31m*\e[0m your current python environment does not allow loading one or more \e[1;3mpycumbia\e[0m modules"
echo -e "\e[1;31m*\e[0m you probably need to either adjust \e[1;3mPYTHONPATH\e[0m or activate the \e[3mconda\e[0m environment"
echo ""
echo -e "\e[1;31m*\e[0m one or more \e[1;3mpycumbia\e[0m modules failed to load in the current python environment"
echo -e "\e[1;31m*\e[0m you probably need to either adjust \e[1;3mPYTHONPATH\e[0m or activate the \e[1;3mconda\e[0m environment"
fi
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment