thirdparty/google_appengine/google/appengine/api/urlfetch_service_pb.py
changeset 2864 2e0b0af889be
parent 2309 be1b94099f2d
equal deleted inserted replaced
2862:27971a13089f 2864:2e0b0af889be
    20 import dummy_thread as thread
    20 import dummy_thread as thread
    21 
    21 
    22 __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
    22 __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
    23                    unusednames=printElemNumber,debug_strs no-special"""
    23                    unusednames=printElemNumber,debug_strs no-special"""
    24 
    24 
    25 from google.appengine.api.api_base_pb import *
       
    26 class URLFetchServiceError(ProtocolBuffer.ProtocolMessage):
    25 class URLFetchServiceError(ProtocolBuffer.ProtocolMessage):
    27 
    26 
    28   OK           =    0
    27   OK           =    0
    29   INVALID_URL  =    1
    28   INVALID_URL  =    1
    30   FETCH_ERROR  =    2
    29   FETCH_ERROR  =    2
    81   def __str__(self, prefix="", printElemNumber=0):
    80   def __str__(self, prefix="", printElemNumber=0):
    82     res=""
    81     res=""
    83     return res
    82     return res
    84 
    83 
    85 
    84 
    86   _TEXT = (
    85   def _BuildTagLookupTable(sparse, maxtag, default=None):
    87    "ErrorCode",
    86     return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
    88   )
    87 
    89 
    88 
    90   _TYPES = (
    89   _TEXT = _BuildTagLookupTable({
    91    ProtocolBuffer.Encoder.NUMERIC,
    90     0: "ErrorCode",
    92   )
    91   }, 0)
       
    92 
       
    93   _TYPES = _BuildTagLookupTable({
       
    94     0: ProtocolBuffer.Encoder.NUMERIC,
       
    95   }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
    93 
    96 
    94   _STYLE = """"""
    97   _STYLE = """"""
    95   _STYLE_CONTENT_TYPE = """"""
    98   _STYLE_CONTENT_TYPE = """"""
    96 class URLFetchRequest_Header(ProtocolBuffer.ProtocolMessage):
    99 class URLFetchRequest_Header(ProtocolBuffer.ProtocolMessage):
    97   has_key_ = 0
   100   has_key_ = 0
   424     if self.has_payload_: res+=prefix+("Payload: %s\n" % self.DebugFormatString(self.payload_))
   427     if self.has_payload_: res+=prefix+("Payload: %s\n" % self.DebugFormatString(self.payload_))
   425     if self.has_followredirects_: res+=prefix+("FollowRedirects: %s\n" % self.DebugFormatBool(self.followredirects_))
   428     if self.has_followredirects_: res+=prefix+("FollowRedirects: %s\n" % self.DebugFormatBool(self.followredirects_))
   426     if self.has_deadline_: res+=prefix+("Deadline: %s\n" % self.DebugFormat(self.deadline_))
   429     if self.has_deadline_: res+=prefix+("Deadline: %s\n" % self.DebugFormat(self.deadline_))
   427     return res
   430     return res
   428 
   431 
       
   432 
       
   433   def _BuildTagLookupTable(sparse, maxtag, default=None):
       
   434     return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
       
   435 
   429   kMethod = 1
   436   kMethod = 1
   430   kUrl = 2
   437   kUrl = 2
   431   kHeaderGroup = 3
   438   kHeaderGroup = 3
   432   kHeaderKey = 4
   439   kHeaderKey = 4
   433   kHeaderValue = 5
   440   kHeaderValue = 5
   434   kPayload = 6
   441   kPayload = 6
   435   kFollowRedirects = 7
   442   kFollowRedirects = 7
   436   kDeadline = 8
   443   kDeadline = 8
   437 
   444 
   438   _TEXT = (
   445   _TEXT = _BuildTagLookupTable({
   439    "ErrorCode",
   446     0: "ErrorCode",
   440    "Method",
   447     1: "Method",
   441    "Url",
   448     2: "Url",
   442    "Header",
   449     3: "Header",
   443    "Key",
   450     4: "Key",
   444    "Value",
   451     5: "Value",
   445    "Payload",
   452     6: "Payload",
   446    "FollowRedirects",
   453     7: "FollowRedirects",
   447    "Deadline",
   454     8: "Deadline",
   448   )
   455   }, 8)
   449 
   456 
   450   _TYPES = (
   457   _TYPES = _BuildTagLookupTable({
   451    ProtocolBuffer.Encoder.NUMERIC,
   458     0: ProtocolBuffer.Encoder.NUMERIC,
   452    ProtocolBuffer.Encoder.NUMERIC,
   459     1: ProtocolBuffer.Encoder.NUMERIC,
   453 
   460     2: ProtocolBuffer.Encoder.STRING,
   454    ProtocolBuffer.Encoder.STRING,
   461     3: ProtocolBuffer.Encoder.STARTGROUP,
   455 
   462     4: ProtocolBuffer.Encoder.STRING,
   456    ProtocolBuffer.Encoder.STARTGROUP,
   463     5: ProtocolBuffer.Encoder.STRING,
   457 
   464     6: ProtocolBuffer.Encoder.STRING,
   458    ProtocolBuffer.Encoder.STRING,
   465     7: ProtocolBuffer.Encoder.NUMERIC,
   459 
   466     8: ProtocolBuffer.Encoder.DOUBLE,
   460    ProtocolBuffer.Encoder.STRING,
   467   }, 8, ProtocolBuffer.Encoder.MAX_TYPE)
   461 
       
   462    ProtocolBuffer.Encoder.STRING,
       
   463 
       
   464    ProtocolBuffer.Encoder.NUMERIC,
       
   465 
       
   466    ProtocolBuffer.Encoder.DOUBLE,
       
   467 
       
   468   )
       
   469 
   468 
   470   _STYLE = """"""
   469   _STYLE = """"""
   471   _STYLE_CONTENT_TYPE = """"""
   470   _STYLE_CONTENT_TYPE = """"""
   472 class URLFetchResponse_Header(ProtocolBuffer.ProtocolMessage):
   471 class URLFetchResponse_Header(ProtocolBuffer.ProtocolMessage):
   473   has_key_ = 0
   472   has_key_ = 0
   779     if self.has_contentwastruncated_: res+=prefix+("ContentWasTruncated: %s\n" % self.DebugFormatBool(self.contentwastruncated_))
   778     if self.has_contentwastruncated_: res+=prefix+("ContentWasTruncated: %s\n" % self.DebugFormatBool(self.contentwastruncated_))
   780     if self.has_externalbytessent_: res+=prefix+("ExternalBytesSent: %s\n" % self.DebugFormatInt64(self.externalbytessent_))
   779     if self.has_externalbytessent_: res+=prefix+("ExternalBytesSent: %s\n" % self.DebugFormatInt64(self.externalbytessent_))
   781     if self.has_externalbytesreceived_: res+=prefix+("ExternalBytesReceived: %s\n" % self.DebugFormatInt64(self.externalbytesreceived_))
   780     if self.has_externalbytesreceived_: res+=prefix+("ExternalBytesReceived: %s\n" % self.DebugFormatInt64(self.externalbytesreceived_))
   782     return res
   781     return res
   783 
   782 
       
   783 
       
   784   def _BuildTagLookupTable(sparse, maxtag, default=None):
       
   785     return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
       
   786 
   784   kContent = 1
   787   kContent = 1
   785   kStatusCode = 2
   788   kStatusCode = 2
   786   kHeaderGroup = 3
   789   kHeaderGroup = 3
   787   kHeaderKey = 4
   790   kHeaderKey = 4
   788   kHeaderValue = 5
   791   kHeaderValue = 5
   789   kContentWasTruncated = 6
   792   kContentWasTruncated = 6
   790   kExternalBytesSent = 7
   793   kExternalBytesSent = 7
   791   kExternalBytesReceived = 8
   794   kExternalBytesReceived = 8
   792 
   795 
   793   _TEXT = (
   796   _TEXT = _BuildTagLookupTable({
   794    "ErrorCode",
   797     0: "ErrorCode",
   795    "Content",
   798     1: "Content",
   796    "StatusCode",
   799     2: "StatusCode",
   797    "Header",
   800     3: "Header",
   798    "Key",
   801     4: "Key",
   799    "Value",
   802     5: "Value",
   800    "ContentWasTruncated",
   803     6: "ContentWasTruncated",
   801    "ExternalBytesSent",
   804     7: "ExternalBytesSent",
   802    "ExternalBytesReceived",
   805     8: "ExternalBytesReceived",
   803   )
   806   }, 8)
   804 
   807 
   805   _TYPES = (
   808   _TYPES = _BuildTagLookupTable({
   806    ProtocolBuffer.Encoder.NUMERIC,
   809     0: ProtocolBuffer.Encoder.NUMERIC,
   807    ProtocolBuffer.Encoder.STRING,
   810     1: ProtocolBuffer.Encoder.STRING,
   808 
   811     2: ProtocolBuffer.Encoder.NUMERIC,
   809    ProtocolBuffer.Encoder.NUMERIC,
   812     3: ProtocolBuffer.Encoder.STARTGROUP,
   810 
   813     4: ProtocolBuffer.Encoder.STRING,
   811    ProtocolBuffer.Encoder.STARTGROUP,
   814     5: ProtocolBuffer.Encoder.STRING,
   812 
   815     6: ProtocolBuffer.Encoder.NUMERIC,
   813    ProtocolBuffer.Encoder.STRING,
   816     7: ProtocolBuffer.Encoder.NUMERIC,
   814 
   817     8: ProtocolBuffer.Encoder.NUMERIC,
   815    ProtocolBuffer.Encoder.STRING,
   818   }, 8, ProtocolBuffer.Encoder.MAX_TYPE)
   816 
       
   817    ProtocolBuffer.Encoder.NUMERIC,
       
   818 
       
   819    ProtocolBuffer.Encoder.NUMERIC,
       
   820 
       
   821    ProtocolBuffer.Encoder.NUMERIC,
       
   822 
       
   823   )
       
   824 
   819 
   825   _STYLE = """"""
   820   _STYLE = """"""
   826   _STYLE_CONTENT_TYPE = """"""
   821   _STYLE_CONTENT_TYPE = """"""
   827 
   822 
   828 __all__ = ['URLFetchServiceError','URLFetchRequest','URLFetchRequest_Header','URLFetchResponse','URLFetchResponse_Header']
   823 __all__ = ['URLFetchServiceError','URLFetchRequest','URLFetchRequest_Header','URLFetchResponse','URLFetchResponse_Header']