Back to index

python-biopython  1.60
ranacompiler.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 #      Restriction Analysis Libraries.
00004 #      Copyright (C) 2004. Frederic Sohm.
00005 #
00006 # This code is part of the Biopython distribution and governed by its
00007 # license.  Please see the LICENSE file that should have been included
00008 # as part of this package.
00009 
00010 import sys
00011 import optparse
00012 from Bio.Restriction._Update.RestrictionCompiler import DictionaryBuilder
00013 
00014 
00015 def standalone() :
00016     parser = optparse.OptionParser() 
00017     add = parser.add_option
00018 
00019     add('-i', '--install',
00020         action  = "store_true",
00021         dest    = 'i',
00022         default = False,
00023         help    = "compile and install the newly created file. "
00024         "default behaviour (without switch): "
00025         "Compile the enzymes and store them in the Updates folder")
00026     add('-m', '--e-mail',
00027         action  = "store",
00028         dest    = 'rebase_password',
00029         default = '',
00030         help    = "set the e-mail address to be used as password for the"
00031         "anonymous ftp connection to Rebase.")
00032     add('-p', '--proxy',
00033         action  = "store",
00034         dest    = 'ftp_proxy',
00035         default = '',
00036         help    = "set the proxy to be used by the ftp connection.")
00037     options, args = parser.parse_args()
00038     return options, args
00039 
00040 if __name__ == '__main__' :
00041     options, args = standalone()
00042     Builder = DictionaryBuilder(options.rebase_password, options.ftp_proxy)
00043     Builder.build_dict()
00044     if options.i :
00045         Builder.install_dict()
00046     else :
00047         Builder.no_install()
00048     sys.exit()