~mwhudson/pydoctor/combine-interface-implementation-docs-1223227

« back to all changes in this revision

Viewing changes to pydoctor/ast_pp.py

  • Committer: Michael Hudson
  • Date: 2008-08-16 01:06:48 UTC
  • mto: This revision was merged to the branch mainline in revision 540.
  • Revision ID: michael.hudson@canonical.com-20080816010648-bap4s8o65da2ce3s
more server-added docstrings

Show diffs side-by-side

added added

removed removed

Lines of Context:
320
320
        return self.s.getvalue()
321
321
 
322
322
def pp(ast):
 
323
    """Convert `ast` to Python source."""
323
324
    sw = SourceWriter()
324
325
    walk(ast, sw)
325
326
    return sw.s.getvalue()
326
 
 
327
 
def magic(s):
328
 
    ast = parse(s)
329
 
    sw = SourceWriter()
330
 
    walk(ast, sw)
331
 
    return ast, sw
332
 
 
333
 
if __name__ == '__main__':
334
 
    f = file(__file__, 'r').read()
335
 
    ast, sw = magic(f)
336
 
    print sw
337
 
    print ast