MCPcopy Create free account
hub / github.com/webpy/webpy / CodeNode

Class CodeNode

web/template.py:660–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658
659
660class CodeNode:
661 def __init__(self, stmt, block, begin_indent=""):
662 # compensate one line for $code:
663 self.code = "\n" + block
664
665 def emit(self, indent, text_indent=""):
666 import re
667
668 rx = re.compile("^", re.M)
669 return rx.sub(indent, self.code).rstrip(" ")
670
671 def __repr__(self):
672 return "<code: %s>" % repr(self.code)
673
674
675class StatementNode:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected