Ejemplo n.º 1
0
    def serializeFormatted(self, tree):
        # provide minimal pretty options
        def options(): pass
        pretty.defaultOptions(options)
        options.prettypCommentsBlockAdd = False  # turn off comment filling

        result = [u'']
        result = pretty.prettyNode(tree, options, result)

        return u''.join(result)
Ejemplo n.º 2
0
    def serializeFormatted(self, tree):
        # provide minimal pretty options
        def options():
            pass

        pretty.defaultOptions(options)
        options.prettypCommentsBlockAdd = False  # turn off comment filling

        result = [u'']
        result = pretty.prettyNode(tree, options, result)

        return u''.join(result)
Ejemplo n.º 3
0
def _compileTree(tree, prettyFlag):
    result = [u'']

    if prettyFlag:
        # Set options
        def optns(): pass
        optns = pretty.defaultOptions(optns)
        #optns.prettypCommentsBlockAdd = False
        result = pretty.prettyNode(tree, optns, result)
    else:
        result =  Packer().serializeNode(tree, None, result, True)

    return u''.join(result)