Back to index

python-biopython  1.60
requires_wise.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # Copyright 2004 by Michael Hoffman.  All rights reserved.  This code is
00004 # part of the Biopython distribution and governed by its license.
00005 # Please see the LICENSE file that should have been included as part
00006 # of this package.
00007 
00008 from Bio import MissingExternalDependencyError
00009 import sys
00010 if sys.platform=="win32":
00011     #Someone needs to find out if dnal works nicely on windows,
00012     #and if so where it is typically installed.
00013     raise MissingExternalDependencyError(\
00014         "Don't know how to find the Wise2 tool dnal on Windows.")
00015 
00016 import commands
00017 not_found_types = ["command not found", "dnal: not found", "not recognized"]
00018 dnal_output = commands.getoutput("dnal")
00019 
00020 for not_found in not_found_types:
00021     if dnal_output.find(not_found) != -1:
00022         #raise MissingExternalDependencyError(dnal_output)
00023         raise MissingExternalDependencyError(\
00024             "Install Wise2 (dnal) if you want to use Bio.Wise.")