File manager - Edit - /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyc
Back
� ?I�Qc @ sq d Z d d l m Z d e e f d � � YZ e d e e f d � � Y� Z d e f d � � YZ d � Z d S( s� flask.debughelpers ~~~~~~~~~~~~~~~~~~ Various helpers to make the development experience better. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. i ( t implements_to_stringt UnexpectedUnicodeErrorc B s e Z d Z RS( sj Raised in places where we want some better error reporting for unexpected unicode or binary data. ( t __name__t __module__t __doc__( ( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyR s t DebugFilesKeyErrorc B s e Z d Z d � Z d � Z RS( s� Raised from request.files during debugging. The idea is that it can provide a better error message than just a generic KeyError/BadRequest. c C sk | j j | � } d | | j f g } | rU | j d d j d � | D� � � n d j | � | _ d S( Ns% You tried to access the file "%s" in the request.files dictionary but it does not exist. The mimetype for the request is "%s" instead of "multipart/form-data" which means that no file contents were transmitted. To fix this error you should provide enctype="multipart/form-data" in your form.sI The browser instead transmitted some file names. This was submitted: %ss , c s s | ] } d | Vq d S( s "%s"N( ( t .0t x( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pys <genexpr>$ s t ( t formt getlistt mimetypet appendt joint msg( t selft requestt keyt form_matchest buf( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyt __init__ s c C s | j S( N( R ( R ( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyt __str__( s ( R R R R R ( ( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyR s t FormDataRoutingRedirectc B s e Z d Z d � Z RS( s� This exception is raised by Flask in debug mode if it detects a redirect caused by the routing system when the request method is not GET, HEAD or OPTIONS. Reasoning: form data will be dropped. c C s� | j } d | j | j f g } | j d | j j d � d k rU | j d � n | j d | j � | j d � t j | d j | � j d � � d S( Nsj A request was sent to this URL (%s) but a redirect was issued automatically by the routing system to "%s".t /t ?i s� The URL was defined with a trailing slash so Flask will automatically redirect to the URL with the trailing slash if it was accessed without one.s� Make sure to directly send your %s-request to this URL since we can't make browsers or HTTP clients redirect with form data reliably or without user interaction.s3 Note: this exception is only raised in debug modeR s utf-8( t routing_exceptiont urlt new_urlt base_urlt splitR t methodt AssertionErrorR R t encode( R R t excR ( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyR 2 s # ( R R R R ( ( ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyR , s c sS � j j � d � f � � f d � � Y} � j | _ � j | _ | � j _ d S( s� Since Flask 0.8 we're monkeypatching the files object in case a request is detected that does not use multipart form data but the files object is accessed. t newclsc s e Z � � f d � Z RS( c sR y � j | | � SWn7 t k rM } | � j k r; � n t � | � � n Xd S( N( t __getitem__t KeyErrorR R ( R R t e( t oldclsR ( sA /opt/imh-python/lib/python2.7/site-packages/flask/debughelpers.pyR# N s ( R R R# ( ( R&