ó
¿b›]c           @   sQ  d  Z  d d l m Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d
 „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ	 d e f d „  ƒ  YZ
 d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d  „  ƒ  YZ d! e f d" „  ƒ  YZ d# e e f d$ „  ƒ  YZ d% e f d& „  ƒ  YZ d' e f d( „  ƒ  YZ d) e f d* „  ƒ  YZ d+ e f d, „  ƒ  YZ d- e f d. „  ƒ  YZ d/ e f d0 „  ƒ  YZ d1 e f d2 „  ƒ  YZ dM Z d3 e f d4 „  ƒ  YZ  d5 e  f d6 „  ƒ  YZ! d7 e! f d8 „  ƒ  YZ" d9 e! f d: „  ƒ  YZ# d; e# f d< „  ƒ  YZ$ d= e# f d> „  ƒ  YZ% d? e# f d@ „  ƒ  YZ& dA e# f dB „  ƒ  YZ' dC e# f dD „  ƒ  YZ( dE e# f dF „  ƒ  YZ) dG e* f dH „  ƒ  YZ+ dI e, f dJ „  ƒ  YZ- dK e. f dL „  ƒ  YZ/ dM S(N   s¿   Exceptions used with SQLAlchemy.

The base exception class is :exc:`.SQLAlchemyError`.  Exceptions which are
raised as a result of DBAPI exceptions are all subclasses of
:exc:`.DBAPIError`.

i   (   t   compatt   SQLAlchemyErrorc           B   sP   e  Z d  Z d Z d „  Z d „  Z e j d „ Z	 d „  Z
 d „  Z d „  Z RS(   s   Generic error class.c         O   sG   | j  d d  ƒ } | d  k	 r* | |  _ n  t t |  ƒ j | | Ž  d  S(   Nt   code(   t   popt   NoneR   t   superR   t   __init__(   t   selft   argt   kwR   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR      s    c         C   s   |  j  s d Sd |  j  f Sd  S(   Nt    s6   (Background on this error at: http://sqlalche.me/e/%s)(   R   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt	   _code_str   s    	c         C   si   t  |  j ƒ d k rX |  j d } | rJ t | t j ƒ rJ t j | d ƒ S|  j d Sn t |  j ƒ Sd  S(   Ni   i    s   utf-8(   t   lent   argst
   isinstanceR    t   binary_typest   decode_backslashreplacet   str(   R   t
   as_unicodet   text(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   _message'   s    c         C   s5   |  j  | ƒ } |  j r1 d | |  j ƒ  f } n  | S(   Ns   %s %s(   R   R   R   (   R   R   t   message(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   _sql_messageC   s    	c         C   s   |  j  t j ƒ S(   N(   R   R    t   py3k(   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   __str__K   s    c         C   s   |  j  d t ƒ S(   NR   (   R   t   True(   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   __unicode__N   s    N(   t   __name__t
   __module__t   __doc__R   R   R   R   R    R   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR      s   					t   ArgumentErrorc           B   s   e  Z d  Z RS(   s“   Raised when an invalid or conflicting function argument is supplied.

    This error generally corresponds to construction time state errors.

    (   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   R   s   t   ObjectNotExecutableErrorc           B   s   e  Z d  Z d „  Z RS(   sq   Raised when an object is passed to .execute() that can't be
    executed as SQL.

    .. versionadded:: 1.1

    c         C   s   t  t |  ƒ j d | ƒ d  S(   Ns   Not an executable object: %r(   R   R   R   (   R   t   target(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   b   s    (   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   Z   s   t   NoSuchModuleErrorc           B   s   e  Z d  Z RS(   sp   Raised when a dynamically-loaded module (usually a database dialect)
    of a particular name cannot be located.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR!   h   s   t   NoForeignKeysErrorc           B   s   e  Z d  Z RS(   sU   Raised when no foreign keys can be located between two selectables
    during a join.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR"   m   s   t   AmbiguousForeignKeysErrorc           B   s   e  Z d  Z RS(   sh   Raised when more than one foreign key matching can be located
    between two selectables during a join.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR#   r   s   t   CircularDependencyErrorc           B   s&   e  Z d  Z d d d „ Z d „  Z RS(   sî  Raised by topological sorts when a circular dependency is detected.

    There are two scenarios where this error occurs:

    * In a Session flush operation, if two objects are mutually dependent
      on each other, they can not be inserted or deleted via INSERT or
      DELETE statements alone; an UPDATE will be needed to post-associate
      or pre-deassociate one of the foreign key constrained values.
      The ``post_update`` flag described at :ref:`post_update` can resolve
      this cycle.
    * In a :attr:`.MetaData.sorted_tables` operation, two :class:`.ForeignKey`
      or :class:`.ForeignKeyConstraint` objects mutually refer to each
      other.  Apply the ``use_alter=True`` flag to one or both,
      see :ref:`use_alter`.

    c         C   sb   | d  k r0 | d d j d „  | Dƒ ƒ 7} n | } t j |  | d | ƒ| |  _ | |  _ d  S(   Ns    (%s)s   , c         s   s   |  ] } t  | ƒ Vq d  S(   N(   t   repr(   t   .0t   s(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pys	   <genexpr>‹   s    R   (   R   t   joinR   R   t   cyclest   edges(   R   R   R)   R*   t   msgR   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   ‰   s    $	c         C   s&   |  j  d  |  j |  j |  j d f f S(   Ni    (   t	   __class__R   R)   R*   R   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt
   __reduce__’   s    N(   R   R   R   R   R   R-   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR$   w   s   	t   CompileErrorc           B   s   e  Z d  Z RS(   s2   Raised when an error occurs during SQL compilation(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR.   –   s   t   UnsupportedCompilationErrorc           B   s   e  Z d  Z d Z d „  Z RS(   sœ   Raised when an operation is not supported by the given compiler.

    .. seealso::

        :ref:`faq_sql_expression_string`

        :ref:`error_l7de`
    t   l7dec         C   s$   t  t |  ƒ j d | | f ƒ d  S(   Ns+   Compiler %r can't render element of type %s(   R   R/   R   (   R   t   compilert   element_type(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   ¦   s    (   R   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR/   š   s   t   IdentifierErrorc           B   s   e  Z d  Z RS(   s;   Raised when a schema name is beyond the max character limit(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR3   ­   s   t   DisconnectionErrorc           B   s   e  Z d  Z e Z RS(   s™  A disconnect is detected on a raw DB-API connection.

    This error is raised and consumed internally by a connection pool.  It can
    be raised by the :meth:`.PoolEvents.checkout` event so that the host pool
    forces a retry; the exception will be caught three times in a row before
    the pool gives up and raises :class:`~sqlalchemy.exc.InvalidRequestError`
    regarding the connection attempt.

    (   R   R   R   t   Falset   invalidate_pool(    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR4   ±   s   	t   InvalidatePoolErrorc           B   s   e  Z d  Z e Z RS(   sá  Raised when the connection pool should invalidate all stale connections.

    A subclass of :class:`.DisconnectionError` that indicates that the
    disconnect situation encountered on the connection probably means the
    entire pool should be invalidated, as the database has been restarted.

    This exception will be handled otherwise the same way as
    :class:`.DisconnectionError`, allowing three attempts to reconnect
    before giving up.

    .. versionadded:: 1.2

    (   R   R   R   R   R6   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR7   ¿   s   t   TimeoutErrorc           B   s   e  Z d  Z RS(   s@   Raised when a connection pool times out on getting a connection.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR8   Ñ   s   t   InvalidRequestErrorc           B   s   e  Z d  Z RS(   sv   SQLAlchemy was asked to do something it can't do.

    This error generally corresponds to runtime state errors.

    (   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR9   Õ   s   t   NoInspectionAvailablec           B   s   e  Z d  Z RS(   sa   A subject passed to :func:`sqlalchemy.inspection.inspect` produced
    no context for inspection.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR:   Ý   s   t   ResourceClosedErrorc           B   s   e  Z d  Z RS(   sc   An operation was requested from a connection, cursor, or other
    object that's in a closed state.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR;   â   s   t   NoSuchColumnErrorc           B   s   e  Z d  Z RS(   s6   A nonexistent column is requested from a ``RowProxy``.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR<   ç   s   t   NoReferenceErrorc           B   s   e  Z d  Z RS(   sD   Raised by ``ForeignKey`` to indicate a reference cannot be resolved.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR=   ë   s   t   NoReferencedTableErrorc           B   s    e  Z d  Z d „  Z d „  Z RS(   sQ   Raised by ``ForeignKey`` when the referred ``Table`` cannot be
    located.

    c         C   s   t  j |  | ƒ | |  _ d  S(   N(   R=   R   t
   table_name(   R   R   t   tname(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   õ   s    c         C   s   |  j  |  j d |  j f f S(   Ni    (   R,   R   R?   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR-   ù   s    (   R   R   R   R   R-   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR>   ï   s   	t   NoReferencedColumnErrorc           B   s    e  Z d  Z d „  Z d „  Z RS(   sR   Raised by ``ForeignKey`` when the referred ``Column`` cannot be
    located.

    c         C   s&   t  j |  | ƒ | |  _ | |  _ d  S(   N(   R=   R   R?   t   column_name(   R   R   R@   t   cname(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR     s    	c         C   s#   |  j  |  j d |  j |  j f f S(   Ni    (   R,   R   R?   RB   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR-     s    (   R   R   R   R   R-   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRA   ý   s   	t   NoSuchTableErrorc           B   s   e  Z d  Z RS(   s7   Table does not exist or is not visible to a connection.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRD     s   t   UnreflectableTableErrorc           B   s   e  Z d  Z RS(   sU   Table exists but can't be reflected for some reason.

    .. versionadded:: 1.2

    (   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRE     s   t   UnboundExecutionErrorc           B   s   e  Z d  Z RS(   sA   SQL was attempted without a database connection to execute it on.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRF     s   t   DontWrapMixinc           B   s   e  Z d  Z RS(   s8  A mixin class which, when applied to a user-defined Exception class,
    will not be wrapped inside of :exc:`.StatementError` if the error is
    emitted within the process of executing a statement.

    E.g.::

        from sqlalchemy.exc import DontWrapMixin

        class MyCustomException(Exception, DontWrapMixin):
            pass

        class MySpecialType(TypeDecorator):
            impl = String

            def process_bind_param(self, value, dialect):
                if value == 'invalid':
                    raise MyCustomException("invalid!")

    (   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRG     s   t   StatementErrorc           B   sJ   e  Z d  Z d Z d Z d Z e d d „ Z d „  Z	 d „  Z
 d „  Z RS(   sv  An error occurred during execution of a SQL statement.

    :class:`StatementError` wraps the exception raised
    during execution, and features :attr:`.statement`
    and :attr:`.params` attributes which supply context regarding
    the specifics of the statement which had an issue.

    The wrapped exception object is available in
    the :attr:`.orig` attribute.

    c         C   sG   t  j |  | d | ƒ| |  _ | |  _ | |  _ | |  _ g  |  _ d  S(   NR   (   R   R   t	   statementt   paramst   origt   hide_parameterst   detail(   R   R   RI   RJ   RK   RL   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   O  s    					c         C   s   |  j  j | ƒ d  S(   N(   RM   t   append(   R   R+   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt
   add_detail_  s    c         C   s/   |  j  |  j d |  j |  j |  j |  j f f S(   Ni    (   R,   R   RI   RJ   RK   RL   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR-   b  s    
c         C   s  d d l  m } |  j d | ƒ g } |  j rÀ | rX t j rX d t j |  j ƒ } n d |  j } | j | ƒ |  j rÀ |  j	 r” | j d ƒ q½ | j
 |  j d ƒ } | j d | ƒ qÀ n  |  j ƒ  } | râ | j | ƒ n  d j g  |  j D] } d	 | ^ qò | ƒ S(
   Niÿÿÿÿ(   t   utilR   s	   [SQL: %s]s3   [SQL parameters hidden due to hide_parameters=True]i
   s   [parameters: %r]s   
s   (%s)(   t   sqlalchemy.sqlRP   R   RI   R    R   t   safe_bytestringRN   RJ   RL   t   _repr_paramsR   R(   RM   (   R   R   RP   t   detailst   stmt_detailt   params_reprt   code_strt   det(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   n  s$    				
N(   R   R   R   R   RI   RJ   RK   R5   R   RO   R-   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRH   9  s   				t
   DBAPIErrorc           B   sG   e  Z d  Z d Z e e e d d „ ƒ Z d „  Z e e d d „ Z	 RS(   s	  Raised when the execution of a database operation fails.

    Wraps exceptions raised by the DB-API underlying the
    database operation.  Driver-specific implementations of the standard
    DB-API exception types are wrapped by matching sub-types of SQLAlchemy's
    :class:`DBAPIError` when possible.  DB-API's ``Error`` type maps to
    :class:`DBAPIError` in SQLAlchemy, otherwise the names are identical.  Note
    that there is no guarantee that different DB-API implementations will
    raise the same exception type for any given error condition.

    :class:`DBAPIError` features :attr:`~.StatementError.statement`
    and :attr:`~.StatementError.params` attributes which supply context
    regarding the specifics of the statement which had an issue, for the
    typical case when the error was raised within the context of
    emitting a SQL statement.

    The wrapped exception object is available in the
    :attr:`~.StatementError.orig` attribute. Its type and properties are
    DB-API implementation specific.

    t   dbapic      
   C   sy  t  | t ƒ r t  | t ƒ s. t  | t ƒ r2 | S| d  k	 rTt  | t ƒ r• | r• t d | j j | j j	 | j
 d f | | | d | d | j ƒSt  | | ƒ rÝ | rÝ t d | j j | j j	 | f | | | d | ƒSt ƒ  } xk | j j D]Z }	 |	 j	 }
 | r | j j |
 |
 ƒ }
 n  |
 | k ró t | |
 t ƒ ró | |
 }  Pqó qó Wn  |  | | | d | d | d |  j ƒS(   Ns
   (%s.%s) %si    RL   R   t   connection_invalidated(   R   t   BaseExceptiont	   ExceptionRG   R   R   RH   R,   R   R   R   R   t   globalst   __mro__t   dbapi_exception_translation_mapt   gett
   issubclassRY   (   t   clsRI   RJ   RK   t   dbapi_base_errRL   R[   t   dialectt   globt   super_t   name(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   instance¡  sR    		
					
c         C   s+   |  j  |  j |  j |  j |  j |  j f f S(   N(   R,   RI   RJ   RK   RL   R[   (   R   (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR-   æ  s    c   	   	   C   s~   y t  | ƒ } Wn# t k
 r5 } d t  | ƒ } n Xt j |  d | j j | j j | f | | | | d | ƒ| |  _ d  S(   Ns.   Error in str() of DB-API-generated exception: s
   (%s.%s) %sR   (   R   R]   RH   R   R,   R   R   R[   (	   R   RI   RJ   RK   RL   R[   R   R   t   e(    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR   ò  s    	N(
   R   R   R   R   t   classmethodR5   R   Ri   R-   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRY   ˆ  s   <	t   InterfaceErrorc           B   s   e  Z d  Z d Z RS(   s   Wraps a DB-API InterfaceError.t   rvf5(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRl     s   t   DatabaseErrorc           B   s   e  Z d  Z d Z RS(   s   Wraps a DB-API DatabaseError.t   4xp6(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRn     s   t	   DataErrorc           B   s   e  Z d  Z d Z RS(   s   Wraps a DB-API DataError.t   9h9h(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRp     s   t   OperationalErrorc           B   s   e  Z d  Z d Z RS(   s    Wraps a DB-API OperationalError.t   e3q8(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRr     s   t   IntegrityErrorc           B   s   e  Z d  Z d Z RS(   s   Wraps a DB-API IntegrityError.t   gkpj(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRt   $  s   t   InternalErrorc           B   s   e  Z d  Z d Z RS(   s   Wraps a DB-API InternalError.t   2j85(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRv   *  s   t   ProgrammingErrorc           B   s   e  Z d  Z d Z RS(   s    Wraps a DB-API ProgrammingError.t   f405(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRx   0  s   t   NotSupportedErrorc           B   s   e  Z d  Z d Z RS(   s!   Wraps a DB-API NotSupportedError.t   tw8g(   R   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyRz   6  s   t   SADeprecationWarningc           B   s   e  Z d  Z RS(   s*   Issued once per usage of a deprecated API.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR|   ?  s   t   SAPendingDeprecationWarningc           B   s   e  Z d  Z RS(   s*   Issued once per usage of a deprecated API.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR}   C  s   t	   SAWarningc           B   s   e  Z d  Z RS(   s   Issued at runtime.(   R   R   R   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyR~   G  s   N(0   R   RP   R    R]   R   R   R   R!   R"   R#   R$   R.   R/   R3   R4   R7   R8   R9   R:   R;   t   KeyErrorR<   R=   R>   RA   RD   RE   RF   t   objectRG   R   t   UnmappedColumnErrorRH   RY   Rl   Rn   Rp   Rr   Rt   Rv   Rx   Rz   t   DeprecationWarningR|   t   PendingDeprecationWarningR}   t   RuntimeWarningR~   (    (    (    s-   lib/python2.7/site-packages/sqlalchemy/exc.pyt   <module>   sN   ?O„	