コード例 #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)
コード例 #2
0
ファイル: MClassCode.py プロジェクト: lite/empweb
    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)
コード例 #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)