@@ -0,0 +1,875 @@
+import ast%0Aimport os%0A%0A%0Aclass Parser(object):%0A%0A    def __init__(self, source):%0A        if not os.path.isabs(source):%0A            raise ValueError('Source path is not absolute: %25s' %25 source)%0A        self.source = source%0A%0A    def walk(self):%0A        for root, dirnames, filenames in os.walk(self.source):%0A            for filename in filenames:%0A                if filename.endswith('.py'):%0A                    yield os.path.join(root, filename)%0A%0A    def relpath(self, path):%0A        return os.path.relpath(path, self.source)%0A%0A    def parse_file(self, path):%0A        relpath = self.relpath(path)%0A        with open(path) as f:%0A            content = f.read()%0A        try:%0A            return (relpath, ast.parse(content, relpath))%0A        except SyntaxError, e:%0A            return (relpath, e)%0A%0A    def parse(self):%0A        return dict(self.parse_file(path) for path in self.walk())%0A

Add code parser