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

Method walk

web/template.py:1359–1364  ·  view source on GitHub ↗

Validate each node in AST and raise SecurityError if the code is not safe.

(self, tree, filename)

Source from the content-addressed store, hash-verified

1357 self.errors = []
1358
1359 def walk(self, tree, filename):
1360 "Validate each node in AST and raise SecurityError if the code is not safe."
1361 self.filename = filename
1362 self.visit(tree)
1363 if self.errors:
1364 raise SecurityError("\n".join([str(err) for err in self.errors]))
1365
1366 def generic_visit(self, node):
1367 nodename = type(node).__name__

Callers 2

compile_templateMethod · 0.80
compile_templatesFunction · 0.80

Calls 2

SecurityErrorClass · 0.85
joinMethod · 0.80

Tested by

no test coverage detected