Package Bio :: Package EUtils :: Module sourcegen
[show private | hide private]
[frames | no frames]

Module Bio.EUtils.sourcegen

This module can be used to generate python source code. It has an interface similar to the "new" module.
Classes
ClassHolder  
FunctionHolder  
MethodHolder  
SourceFile  
SourceGen SourceGen(outfile, [bangline]) An instance of this SourceGen class is a factory for generating python source code, by writing to a file object.

Function Summary
  genClass(klassname, parents, attribs, doc, methods)
genClass(name, parents, [attribs, [doc, [methods]]]) Return a string of Python source code defineing a class object.
  genComment(text)
  genFunc(funcname, params, body, globals, doc)
  genImport(module, obj, indent)
  genMethod(funcname, params, body, globals, doc)
  get_generator(outfile)
  get_sourcefile(outfile, bangline)
  _tuplestr(tup)

Variable Summary
str BANGLINE = '#!/usr/bin/python\n'

Function Details

genClass(klassname, parents, attribs=None, doc=None, methods=None)

genClass(name, parents, [attribs, [doc, [methods]]])
Return a string of Python source code defineing a class object.
Where:
        name = class name (string)
        parents = tuple of parent class objects or strings.
        attribs = class-global attributes to define, contained in a dictionary.
        doc = a doc string (optional)
        methods = list of methods strings.

Variable Details

BANGLINE

Type:
str
Value:
'''#!/usr/bin/python
'''                                                                    

Generated by Epydoc 2.1 on Thu Jun 30 22:05:39 2005 http://epydoc.sf.net