Did I find the right examples for you? yes no

All Samples(21)  |  Call(21)  |  Derive(0)  |  Import(0)
Convert C{ast} to Python source.

@param ast: The node to render into Python source.

        def pp(ast):
    """Convert C{ast} to Python source.

    @param ast: The node to render into Python source.
    """
    sw = SourceWriter()
    walk(ast, sw)
    return sw.s.getvalue()
        


src/p/y/pydoctor-0.5/pydoctor/twistedmodel.py   pydoctor(Download)
    def visitCallFunc_twisted_python_util_moduleMovedForSplit(self, funcName, node):
        # XXX this is rather fragile...
        origModuleName, newModuleName, moduleDesc, \
                        projectName, projectURL, globDict = node.args
        moduleDesc = ast_pp.pp(moduleDesc)[1:-1]
        projectName = ast_pp.pp(projectName)[1:-1]
        projectURL = ast_pp.pp(projectURL)[1:-1]

src/b/a/babbledrive-HEAD/generator-pydoctor/pydoctor/twistedmodel.py   babbledrive(Download)
    def visitCallFunc_twisted_python_util_moduleMovedForSplit(self, funcName, node):
        # XXX this is rather fragile...
        origModuleName, newModuleName, moduleDesc, \
                        projectName, projectURL, globDict = node.args
        moduleDesc = ast_pp.pp(moduleDesc)[1:-1]
        projectName = ast_pp.pp(projectName)[1:-1]
        projectURL = ast_pp.pp(projectURL)[1:-1]

src/b/a/babbledrive-HEAD/generator-pydoctor/pydoctor/zopeinterface.py   babbledrive(Download)
        cls.implements_directly = []
    for arg in interfaceargs:
        fullName = cls.dottedNameToFullName(ast_pp.pp(arg))
        if fullName not in cls.system.allobjects:
            fullName = cls.system.resolveAlias(fullName)
    def funcNameFromCall(self, node):
        str_base = ast_pp.pp(node.node)
        return self.builder.current.dottedNameToFullName(str_base)
 
    def visitAssign(self, node):
        sup = lambda : super(ZopeInterfaceModuleVisitor, self).visitAssign(node)
        if isinstance(self.builder.current, model.Module) and \
               ast_pp.pp(node) == 'Interface = interface.Interface\n':
            # warner!!!
 
    def visitCallFunc_zope_interface_classImplements(self, funcName, node):
        clsname = self.builder.current.dottedNameToFullName(
            ast_pp.pp(node.args[0]))
        if clsname not in self.system.allobjects:
            self.builder.system.msg(

src/p/y/pydoctor-0.5/pydoctor/zopeinterface.py   pydoctor(Download)
def addInterfaceInfoToModule(module, interfaceargs):
    for arg in interfaceargs:
        if not isinstance(arg, tuple):
            fullName = module.expandName(ast_pp.pp(arg))
        else:
    for arg in interfaceargs:
        if not isinstance(arg, tuple):
            fullName = cls.expandName(ast_pp.pp(arg))
        else:
            fullName = arg[1]
    def funcNameFromCall(self, node):
        str_base = ast_pp.pp(node.node)
        return self.builder.current.expandName(str_base)
 
    def visitAssign(self, node):
    def visitCallFunc_zope_interface_classImplements(self, funcName, node):
        clsname = self.builder.current.expandName(
            ast_pp.pp(node.args[0]))
        if clsname not in self.system.allobjects:
            self.builder.system.msg(

src/p/y/pydoctor-0.5/pydoctor/templatewriter/pages/functionchild.py   pydoctor(Download)
    def decorator(self, request, tag):
        if self.ob.decorators:
            decorators = [ast_pp.pp(dec) for dec in self.ob.decorators]
        else:
            decorators = []

src/p/y/pydoctor-0.5/pydoctor/astbuilder.py   pydoctor(Download)
        baseobjects = []
        for n in node.bases:
            str_base = ast_pp.pp(n)
            rawbases.append(str_base)
            full_name = self.builder.current.expandName(str_base)
        for default in node.defaults:
            try:
                defaults.append(ast_pp.pp(default))
            except (KeyboardInterrupt, SystemExit):
                raise

src/b/a/babbledrive-HEAD/generator-pydoctor/pydoctor/astbuilder.py   babbledrive(Download)
        current = self.builder.current
        for n in node.bases:
            str_base = ast_pp.pp(n)
            rawbases.append(str_base)
            base = current.dottedNameToFullName(str_base)
        for default in node.defaults:
            try:
                defaults.append(ast_pp.pp(default))
            except (KeyboardInterrupt, SystemExit):
                raise

src/b/a/babbledrive-HEAD/generator-pydoctor/pydoctor/nevowhtml/pages/functionchild.py   babbledrive(Download)
    def decorator(self, request, tag):
        if self.ob.decorators:
            decorators = [ast_pp.pp(dec) for dec in self.ob.decorators]
        else:
            decorators = []

src/p/y/pydoctor-0.5/pydoctor/test/test_ast_pp.py   pydoctor(Download)
def pp_test(source):
    assert ast_pp.pp(parse(source)) == source
 
def test_name():
    pp_test('a\n')