我写了一个bash脚本,它根据收到的数据重命名MythTV文件.我用bash编写它是因为bash具有强大的文本数据操作和易用性.
您可以在此处查看脚本本身:http://code.google.com/p/mythicallibrarian/source/browse/trunk/mythicalLibrarian
我有几个用户是第一次使用Linux的用户.我在这里创建了一个安装脚本,用于检查依赖关系并以图形方式设置.您可以在此处查看设置脚本:http: //code.google.com/p/mythicallibrarian/source/browse/trunk/mythicalSetup.sh
最近,MythTV发生了一些变化,要求我将mythicalLibrarian中的mysql数据库访问迁移到Python绑定脚本.在这里:http://code.google.com/p/mythicallibrarian/source/browse/trunk/pythonBindings/MythDataGrabber
以前,我使用这样的系统测试了依赖项:
test "`uname`" != "Darwin" && LinuxDep=1 || LinuxDep=0 if which agrep >/dev/null; then echo "Verified agrep exists" else test "$LinuxDep" = "1" && echo "Please install 'agrep' on your system" || echo "Please obtain MacPorts and install package agrep" d="agrep " fi ......................... if which agrep>/dev/null && which curl>/dev/null && which dialog>/dev/null; then echo "All checks complete!!!" else echo "the proper dependencies must be installed..." echo "The missing dependencies are $a$b$c$d$e" test "$LinuxDep" = "1" && echo "Debian based users run: apt-get install $a$b$c$d$e" || echo "Please obtain MacPorts and run: port install $a$b$c" if [ "$LinuxDep" = "0" ]; then read -n1 -p " Would you like some help on installing MacPorts? Select: (y)/n" MacPortsHelp
python依赖关系使它变得更加困难.如果我在系统上有linux pacakge"libmyth-python"和"python-lxml",我不知道如何测试.
从BASH,我如何测试我的Python脚本MythDataGrabber有它的
from MythTV import MythDB
要求满意吗?
您可以查看以下状态代码:
python -c "import MythDB.MythTV"
如果它返回非零,则出现错误,可能是ImportError.