Plugins/CheckerPlugins/Tabnanny/Tabnanny.py

changeset 2962
d6c9d1ca2da4
parent 2302
f29e9405c851
child 3004
c4bf32c791d0
equal deleted inserted replaced
2961:e4e2efb4846a 2962:d6c9d1ca2da4
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

eric ide

mercurial