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)
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)