Back to index

python-biopython  1.60
Classes | Functions | Variables
Bio.Application Namespace Reference

Classes

class  ApplicationError
class  AbstractCommandline
class  _AbstractParameter
class  _Option
class  _Switch
class  _Argument

Functions

def _escape_filename
def _test

Variables

tuple _re_prop_name = re.compile(r"[a-zA-Z][a-zA-Z0-9_]*")
list _reserved_names
list _local_reserved_names = ["set_parameter"]

Function Documentation

def Bio.Application._escape_filename (   filename) [private]
Escape filenames with spaces by adding quotes (PRIVATE).

Note this will not add quotes if they are already included:

>>> print _escape_filename('example with spaces')
"example with spaces"
>>> print _escape_filename('"example with spaces"')
"example with spaces"

Definition at line 583 of file __init__.py.

00583 
00584 def _escape_filename(filename):
00585     """Escape filenames with spaces by adding quotes (PRIVATE).
00586 
00587     Note this will not add quotes if they are already included:
00588     
00589     >>> print _escape_filename('example with spaces')
00590     "example with spaces"
00591     >>> print _escape_filename('"example with spaces"')
00592     "example with spaces"
00593     """
00594     #Is adding the following helpful
00595     #if os.path.isfile(filename):
00596     #    #On Windows, if the file exists, we can ask for
00597     #    #its alternative short name (DOS style 8.3 format)
00598     #    #which has no spaces in it.  Note that this name
00599     #    #is not portable between machines, or even folder!
00600     #    try:
00601     #        import win32api
00602     #        short = win32api.GetShortPathName(filename)
00603     #        assert os.path.isfile(short)
00604     #        return short
00605     #    except ImportError:
00606     #        pass
00607     if " " not in filename:
00608         return filename
00609     #We'll just quote it - works on Windows, Mac OS X etc
00610     if filename.startswith('"') and filename.endswith('"'):
00611         #Its already quoted
00612         return filename
00613     else:
00614         return '"%s"' % filename

Here is the caller graph for this function:

def Bio.Application._test ( ) [private]
Run the Bio.Application module's doctests.

Definition at line 615 of file __init__.py.

00615 
00616 def _test():
00617     """Run the Bio.Application module's doctests."""
00618     import doctest
00619     doctest.testmod(verbose=1)


Variable Documentation

list Bio.Application._local_reserved_names = ["set_parameter"]

Definition at line 47 of file __init__.py.

tuple Bio.Application._re_prop_name = re.compile(r"[a-zA-Z][a-zA-Z0-9_]*")

Definition at line 33 of file __init__.py.

Initial value:
00001 ["and", "del", "from", "not", "while", "as", "elif",
00002                    "global", "or", "with", "assert", "else", "if", "pass",
00003                    "yield", "break", "except", "import", "print", "class",
00004                    "exec", "in", "raise", "continue", "finally", "is",
00005                    "return", "def", "for", "lambda", "try"]

Definition at line 41 of file __init__.py.