UtilitiesPython2/Tabnanny.py

changeset 2965
d133c7edd88a
parent 945
8cd4d08fa9f6
child 2998
95581102e03e
equal deleted inserted replaced
2964:84b65fb9e780 2965:d133c7edd88a
49 __all__ = ["check", "NannyNag", "process_tokens"] 49 __all__ = ["check", "NannyNag", "process_tokens"]
50 50
51 51
52 class NannyNag(Exception): 52 class NannyNag(Exception):
53 """ 53 """
54 Class implementing an exception to indicate indentation issues.
55
54 Raised by tokeneater() if detecting an ambiguous indent. 56 Raised by tokeneater() if detecting an ambiguous indent.
55 Captured and handled in check(). 57 Captured and handled in check().
56 """ 58 """
57 def __init__(self, lineno, msg, line): 59 def __init__(self, lineno, msg, line):
58 """ 60 """
330 def process_tokens(tokens): 332 def process_tokens(tokens):
331 """ 333 """
332 Function processing all tokens generated by a tokenizer run. 334 Function processing all tokens generated by a tokenizer run.
333 335
334 @param tokens list of tokens 336 @param tokens list of tokens
337 @exception NannyNag raised to indicate an indentation issue
335 """ 338 """
336 INDENT = tokenize.INDENT 339 INDENT = tokenize.INDENT
337 DEDENT = tokenize.DEDENT 340 DEDENT = tokenize.DEDENT
338 NEWLINE = tokenize.NEWLINE 341 NEWLINE = tokenize.NEWLINE
339 JUNK = tokenize.COMMENT, tokenize.NL 342 JUNK = tokenize.COMMENT, tokenize.NL

eric ide

mercurial