Back to index

python-biopython  1.60
Classes | Functions | Variables
test_PAML_tools Namespace Reference

Classes

class  Common
class  CodemlTest
class  BasemlTest
class  Yn00Test

Functions

def is_exe
def which

Variables

list binaries = ["codeml.exe", "baseml.exe", "yn00.exe"]
tuple runner = unittest.TextTestRunner(verbosity = 2)

Function Documentation

def test_PAML_tools.is_exe (   filepath)
Test if a file is an executable.

Definition at line 12 of file test_PAML_tools.py.

00012 
00013 def is_exe(filepath):
00014     """Test if a file is an executable."""
00015     return os.path.exists(filepath) and os.access(filepath, os.X_OK)

Here is the caller graph for this function:

def test_PAML_tools.which (   program)
Find the path to an executable.

Definition at line 16 of file test_PAML_tools.py.

00016 
00017 def which(program):
00018     """Find the path to an executable."""
00019     filepath, filename = os.path.split(program)
00020     os_path = os.environ["PATH"].split(os.pathsep)
00021     if sys.platform == "win32":
00022         try:
00023             #This can vary depending on the Windows language.
00024             prog_files = os.environ["PROGRAMFILES"]
00025         except KeyError:
00026             prog_files = r"C:\Program Files"
00027         #For Windows, the user is instructed to move the programs to a folder
00028         #and then to add the folder to the system path. Just in case they didn't
00029         #do that, we can check for it in Program Files.
00030         likely_dirs = ["", #Current dir
00031                        prog_files,
00032                        os.path.join(prog_files, "paml41"),
00033                        os.path.join(prog_files, "paml43"),
00034                        os.path.join(prog_files, "paml44"),
00035                        os.path.join(prog_files, "paml45")] + sys.path
00036         os_path.extend(likely_dirs)
00037     for path in os.environ["PATH"].split(os.pathsep):
00038         exe_file = os.path.join(path, program)
00039         if is_exe(exe_file):
00040             return exe_file
00041     return None
00042 
#Find the PAML binaries

Here is the call graph for this function:


Variable Documentation

list test_PAML_tools.binaries = ["codeml.exe", "baseml.exe", "yn00.exe"]

Definition at line 44 of file test_PAML_tools.py.

tuple test_PAML_tools.runner = unittest.TextTestRunner(verbosity = 2)

Definition at line 131 of file test_PAML_tools.py.