class Director: (source)
Holds all of the directive information for a source file.
Method | __init__ |
Create a Director for a source file. |
Method | filter |
Return whether the error should be logged. |
Instance Variable | block |
Undocumented |
Instance Variable | features |
Undocumented |
Instance Variable | matches |
Undocumented |
Instance Variable | return |
Undocumented |
Property | annotations |
Undocumented |
Property | decorators |
Undocumented |
Property | ignore |
Undocumented |
Property | type |
Undocumented |
Method | _adjust |
Adjusts the line number for a pytype directive. |
Method | _parse |
Parse a source file, extracting directives from comments. |
Method | _process |
Process a pytype: comment. |
Method | _process |
Process a type: comment. |
Instance Variable | _decorators |
Undocumented |
Instance Variable | _disables |
Undocumented |
Instance Variable | _errorlog |
Undocumented |
Instance Variable | _filename |
Undocumented |
Instance Variable | _function |
Undocumented |
Instance Variable | _ignore |
Undocumented |
Instance Variable | _type |
Undocumented |
Instance Variable | _variable |
Undocumented |
Create a Director for a source file. Args: src_tree: The source text as an ast. errorlog: An ErrorLog object. Directive errors will be logged to the errorlog. filename: The name of the source file. disable: List of error messages to always ignore. code: Optionally, bytecode for adjusting line numbers. If provided, directives will be moved to lines at which corresponding opcodes are present. Otherwise, directives will be moved to the starting line of their containing statement.
Return whether the error should be logged. This method is suitable for use as an error filter. Args: error: An error._Error object. Returns: True iff the error should be included in the log.
int
, error_class: str
, line_range: parser.LineRange
, opcode_lines: Optional[ _OpcodeLines]
):
(source)
¶
Adjusts the line number for a pytype directive.
int
, data: str
, open_ended: bool
, line_range: parser.LineRange
, opcode_lines: Optional[ _OpcodeLines]
):
(source)
¶
Process a pytype: comment.
int
, data: str
, open_ended: bool
, line_range: parser.LineRange
, opcode_lines: Optional[ _OpcodeLines]
):
(source)
¶
Process a type: comment.