<s> """<STR_LIT>""" <EOL> from inspect import isclass <EOL> from . constants import HTTP_STATUS_CODES <EOL> class HTTPException ( Exception ) : <EOL> """<STR_LIT>""" <EOL> code = None <EOL> traceback = True <EOL> description = None <EOL> def __init__ ( self , description = None , traceback = None ) : <EOL> super ( HTTPException , self ) . __init__ ( "<STR_LIT>" % ( self . code , self . name ) ) <EOL> if description is not None : <EOL> self . description = description <EOL> if traceback is not None : <EOL> self . traceback = traceback <EOL> @ property <EOL> def name ( self ) : <EOL> """<STR_LIT>""" <EOL> return HTTP_STATUS_CODES . get ( self . code , '<STR_LIT>' ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , str ( self ) ) <EOL> class BadRequest ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class UnicodeError ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> class Unauthorized ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class Forbidden ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class NotFound ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class MethodNotAllowed ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> def __init__ ( self , method , description = None ) : <EOL> HTTPException . __init__ ( self , description ) <EOL> if description is None : <EOL> self . description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) % method <EOL> class NotAcceptable ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class RequestTimeout ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class Gone ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class LengthRequired ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class PreconditionFailed ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class RequestEntityTooLarge ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> ) <EOL> class RequestURITooLarge ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class UnsupportedMediaType ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class RangeUnsatisfiable ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> ) <EOL> class InternalServerError ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class NotImplemented ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class BadGateway ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class ServiceUnavailable ( HTTPException ) : <EOL> """<STR_LIT>""" <EOL> code = <NUM_LIT> <EOL> description = ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ) <EOL> class Redirect ( HTTPException ) : <EOL> code = <NUM_LIT> <EOL> def __init__ ( self , urls , status = None ) : <EOL> super ( Redirect , self ) . __init__ ( ) <EOL> if isinstance ( urls , str ) : <EOL> self . urls = [ urls ] <EOL> else : <EOL> self . urls = urls <EOL> self . status = status <EOL> __all__ = [ <EOL> x [ <NUM_LIT:0> ] for x in list ( globals ( ) . items ( ) ) <EOL> if isclass ( x [ <NUM_LIT:1> ] ) and issubclass ( x [ <NUM_LIT:1> ] , HTTPException ) <EOL> ] </s>
