51 __all__ = ["check", "NannyNag", "process_tokens"] |
51 __all__ = ["check", "NannyNag", "process_tokens"] |
52 |
52 |
53 |
53 |
54 class NannyNag(Exception): |
54 class NannyNag(Exception): |
55 """ |
55 """ |
|
56 Class implementing an exception for indentation issues. |
|
57 |
56 Raised by tokeneater() if detecting an ambiguous indent. |
58 Raised by tokeneater() if detecting an ambiguous indent. |
57 Captured and handled in check(). |
59 Captured and handled in check(). |
58 """ |
60 """ |
59 def __init__(self, lineno, msg, line): |
61 def __init__(self, lineno, msg, line): |
60 """ |
62 """ |
341 def process_tokens(tokens): |
343 def process_tokens(tokens): |
342 """ |
344 """ |
343 Function processing all tokens generated by a tokenizer run. |
345 Function processing all tokens generated by a tokenizer run. |
344 |
346 |
345 @param tokens list of tokens |
347 @param tokens list of tokens |
|
348 @exception NannyNag raised to indicate an indentation error |
346 """ |
349 """ |
347 INDENT = tokenize.INDENT |
350 INDENT = tokenize.INDENT |
348 DEDENT = tokenize.DEDENT |
351 DEDENT = tokenize.DEDENT |
349 NEWLINE = tokenize.NEWLINE |
352 NEWLINE = tokenize.NEWLINE |
350 JUNK = tokenize.COMMENT, tokenize.NL |
353 JUNK = tokenize.COMMENT, tokenize.NL |