Your IP : 216.73.216.74


Current Path : /opt/alt/python27/lib/python2.7/site-packages/astroid/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyc

�
y_VXc@s�dZdZddlZddlZddlmZddlTddlTddlm	Z	ddlm
Z
ddlmZm
Z
mZdd	lmZmZdd
lmZddlmZddlmZdd
lmZe�Z[defd��YZd�Zd�Zddlm Z ddl!m"Z"m#Z#e"e#e$�d�Z%e%ej&krkej&j'e%�nx4e e%�D]&Z(e(j)d�rxe*e(d �qxqxWdS(s�Python Abstract Syntax Tree New Generation

The aim of this module is to provide a common base representation of
python source code for projects such as pychecker, pyreverse,
pylint... Well, actually the development of this library is essentially
governed by pylint's needs.

It extends class defined in the python's _ast module with some
additional methods and attributes. Instance attributes are added by a
builder object, which can either generate extended ast (let's call
them astroid ;) by visiting an existent ast tree or by inspecting living
object. Methods are added by monkey patching ast classes.

Main modules are:

* nodes and scoped_nodes for more information about methods and
  attributes added to different node classes

* the manager contains a high level object to get astroid trees from
  source files and living objects. It maintains a cache of previously
  constructed tree for quick access

* builder contains the class responsible to build astroid trees
srestructuredtext eni����N(t
attrgetter(t*(t	inference(traw_building(tInstancetBoundMethodt
UnboundMethod(t
are_exclusivetunpack_infer(tbuiltin_lookup(tparse(tYES(tAstroidManagertAsStringRegexpPredicatecBs#eZdZdd�Zd�ZRS(s,Class to be used as predicate that may be given to `register_transform`

    First argument is a regular expression that will be searched against the `as_string`
    representation of the node onto which it's applied.

    If specified, the second argument is an `attrgetter` expression that will be
    applied on the node first to get the actual node on which `as_string` should
    be called.

    WARNING: This can be fairly slow, as it has to convert every AST node back
    to Python code; you should consider examining the AST directly instead.
    cCstj|�|_||_dS(N(tretcompiletregexpt
expression(tselfRR((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt__init__XscCs=|jdk	r't|j�|�}n|jj|j��S(N(RtNoneRRtsearcht	as_string(Rtnode((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt__call__\sN(t__name__t
__module__t__doc__RRR(((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyR
KscCs|d�}|S(s:Given an instance specific inference function, return a function to be
    given to MANAGER.register_transform to set this inference function.

    Typical usage

    .. sourcecode:: python

       MANAGER.register_transform(Call, inference_tip(infer_named_tuple),
                                  predicate)
    cSs
||_|S(N(t_explicit_inference(Rtinfer_function((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt	transformls	((RR((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt
inference_tipascs/�fd�}|jt|�fd��dS(Ncsf��}xV|jj�D]E\}}||j|<x)|D]!}|j|kr9||_q9q9WqWdS(N(t_localstitemstparent(Rtextension_moduletnametobjstobj(tget_extension_mod(sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyRss	

cs
|j�kS(N(R$(tn(tmodule_name(sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt<lambda>{t(tregister_transformtModule(tmanagerR)R'R((R'R)sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pytregister_module_extenderrs(tlistdir(tjointdirnametbrains.pyi����(+Rt__doctype__tsysRtoperatorRtastroid.exceptionst
astroid.nodestastroidRRt
astroid.basesRRRtastroid.node_classesRRtastroid.scoped_nodesR	tastroid.builderR
tastroid.utilRtastroid.managerRtMANAGERtobjectR
RR/tosR0tos.pathR1R2t__file__tBRAIN_MODULES_DIRtpathtappendtmoduletendswitht
__import__(((sA/opt/alt/python27/lib/python2.7/site-packages/astroid/__init__.pyt<module>)s6