discussion of the operation of this code.
"""
+import os
+import parser
import symbol
import token
import types
+from types import ListType, TupleType
+
def get_docs(fileName):
"""Retrieve information from the parse tree of a source file.
Name of the file to read Python source code from.
"""
source = open(fileName).read()
- import os
basename = os.path.basename(os.path.splitext(fileName)[0])
- import parser
ast = parser.suite(source)
- tup = parser.ast2tuple(ast)
- return ModuleInfo(tup, basename)
+ return ModuleInfo(ast.totuple(), basename)
class SuiteInfoBase:
self._docstring = vars["docstring"]
-from types import ListType, TupleType
-
def match(pattern, data, vars=None):
"""Match `data' to `pattern', with variable extraction.
)))))))))))))))),
(token.NEWLINE, '')
))
-
-#
-# end of file