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

Method python_tokens

web/template.py:400–404  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

398 return next(tokens)[1]
399
400 def python_tokens(self, text):
401 i = iter([text])
402 readline = lambda: next(i)
403 tokens = tokenize.generate_tokens(readline)
404 return [t[1] for t in tokens]
405
406 def read_indented_block(self, text, indent):
407 r"""Read a block of text. A block is what typically follows a for or it statement.

Callers 1

read_varMethod · 0.95

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected