.. link: .. description: .. tags: .. date: 2013/08/18 00:00:00 .. title: NINJA-IDE .. slug: analyzer .. class:: alert alert-info pull-top .. contents:: *Module:* `analyzer.py `_ API ====================================================================================== No description. *Imports:* ------------ - `_ast `_ - `ast `_ - `re `_ - `ninja_ide.tools.logger.NinjaLogger `_ - `ninja_ide.tools.completion.model `_ *Global Attributes:* ---------------------- - `MAX_THRESHOLD [at ln:32] `_ - `logger [at ln:30] `_ ---- *Global Functions:* --------------------- *Function:* `expand_attribute(attribute) [at ln:35] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def expand_attribute(attribute): No description. ---- *Class:* `Analyzer(object) `_ ------------------------------------------------------------------------------------------------------------------------------------ .. code:: python class Analyzer(object): No description. *Attributes* ~~~~~~~~~~~~~~ - `__mapping [at ln:57] `_ - `_fixed_line [at ln:72] `_ - `content [at ln:121] `_ *Function:* `__init__() [at ln:71] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def __init__(): No description. ---- *Function:* `_assign_disambiguation(type_name, line_content) [at ln:130] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _assign_disambiguation(type_name, line_content): | Provide a specific builtin for the cases were ast doesn't work. ---- *Function:* `_get_valid_module(source, retry=int) [at ln:76] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _get_valid_module(source, retry=int): | Try to parse the module and fix some errors if it has some. ---- *Function:* `_parse_tuple_in_func_arg(symbol_tuple, function, lineno=int) [at ln:284] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _parse_tuple_in_func_arg(symbol_tuple, function, lineno=int): | Parse the tuple inside a function argument call. ---- *Function:* `_process_assign(symbol) [at ln:174] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _process_assign(symbol): | Process an ast.Assign object to extract the proper info. ---- *Function:* `_process_class(symbol) [at ln:213] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _process_class(symbol): | Process an ast.ClassDef object to extract data. ---- *Function:* `_process_function(symbol, parent=None) [at ln:235] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _process_function(symbol, parent=None): | Process an ast.FunctionDef object to extract data. ---- *Function:* `_process_import(symbol) [at ln:199] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _process_import(symbol): | Process an ast.Import and ast.ImportFrom object to extract data. ---- *Function:* `_resolve_module(module, old_module) [at ln:125] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _resolve_module(module, old_module): No description. ---- *Function:* `_search_recursive_for_types(function, symbol, parent=None) [at ln:292] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def _search_recursive_for_types(function, symbol, parent=None): | Search for return recursively inside the function. ---- *Function:* `analyze(source, old_module=None) [at ln:98] `_ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python def analyze(source, old_module=None): | Analyze the source provided and create the proper structure.