thirdparty/google_appengine/google/appengine/ext/remote_api/remote_api_pb.py
changeset 2864 2e0b0af889be
parent 1278 a7766286a7be
--- a/thirdparty/google_appengine/google/appengine/ext/remote_api/remote_api_pb.py	Sat Sep 05 14:04:24 2009 +0200
+++ b/thirdparty/google_appengine/google/appengine/ext/remote_api/remote_api_pb.py	Sun Sep 06 23:31:53 2009 +0200
@@ -155,29 +155,144 @@
       res+=prefix+">\n"
     return res
 
+
+  def _BuildTagLookupTable(sparse, maxtag, default=None):
+    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
+
   kservice_name = 2
   kmethod = 3
   krequest = 4
 
-  _TEXT = (
-   "ErrorCode",
-   None,
-   "service_name",
-   "method",
-   "request",
-  )
+  _TEXT = _BuildTagLookupTable({
+    0: "ErrorCode",
+    2: "service_name",
+    3: "method",
+    4: "request",
+  }, 4)
+
+  _TYPES = _BuildTagLookupTable({
+    0: ProtocolBuffer.Encoder.NUMERIC,
+    2: ProtocolBuffer.Encoder.STRING,
+    3: ProtocolBuffer.Encoder.STRING,
+    4: ProtocolBuffer.Encoder.STRING,
+  }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
+
+  _STYLE = """"""
+  _STYLE_CONTENT_TYPE = """"""
+class ApplicationError(ProtocolBuffer.ProtocolMessage):
+  has_code_ = 0
+  code_ = 0
+  has_detail_ = 0
+  detail_ = ""
+
+  def __init__(self, contents=None):
+    if contents is not None: self.MergeFromString(contents)
+
+  def code(self): return self.code_
+
+  def set_code(self, x):
+    self.has_code_ = 1
+    self.code_ = x
+
+  def clear_code(self):
+    if self.has_code_:
+      self.has_code_ = 0
+      self.code_ = 0
+
+  def has_code(self): return self.has_code_
+
+  def detail(self): return self.detail_
+
+  def set_detail(self, x):
+    self.has_detail_ = 1
+    self.detail_ = x
+
+  def clear_detail(self):
+    if self.has_detail_:
+      self.has_detail_ = 0
+      self.detail_ = ""
+
+  def has_detail(self): return self.has_detail_
+
+
+  def MergeFrom(self, x):
+    assert x is not self
+    if (x.has_code()): self.set_code(x.code())
+    if (x.has_detail()): self.set_detail(x.detail())
+
+  def Equals(self, x):
+    if x is self: return 1
+    if self.has_code_ != x.has_code_: return 0
+    if self.has_code_ and self.code_ != x.code_: return 0
+    if self.has_detail_ != x.has_detail_: return 0
+    if self.has_detail_ and self.detail_ != x.detail_: return 0
+    return 1
 
-  _TYPES = (
-   ProtocolBuffer.Encoder.NUMERIC,
-   ProtocolBuffer.Encoder.MAX_TYPE,
+  def IsInitialized(self, debug_strs=None):
+    initialized = 1
+    if (not self.has_code_):
+      initialized = 0
+      if debug_strs is not None:
+        debug_strs.append('Required field: code not set.')
+    if (not self.has_detail_):
+      initialized = 0
+      if debug_strs is not None:
+        debug_strs.append('Required field: detail not set.')
+    return initialized
 
-   ProtocolBuffer.Encoder.STRING,
+  def ByteSize(self):
+    n = 0
+    n += self.lengthVarInt64(self.code_)
+    n += self.lengthString(len(self.detail_))
+    return n + 2
+
+  def Clear(self):
+    self.clear_code()
+    self.clear_detail()
+
+  def OutputUnchecked(self, out):
+    out.putVarInt32(8)
+    out.putVarInt32(self.code_)
+    out.putVarInt32(18)
+    out.putPrefixedString(self.detail_)
 
-   ProtocolBuffer.Encoder.STRING,
+  def TryMerge(self, d):
+    while d.avail() > 0:
+      tt = d.getVarInt32()
+      if tt == 8:
+        self.set_code(d.getVarInt32())
+        continue
+      if tt == 18:
+        self.set_detail(d.getPrefixedString())
+        continue
+      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
+      d.skipData(tt)
+
+
+  def __str__(self, prefix="", printElemNumber=0):
+    res=""
+    if self.has_code_: res+=prefix+("code: %s\n" % self.DebugFormatInt32(self.code_))
+    if self.has_detail_: res+=prefix+("detail: %s\n" % self.DebugFormatString(self.detail_))
+    return res
 
-   ProtocolBuffer.Encoder.STRING,
+
+  def _BuildTagLookupTable(sparse, maxtag, default=None):
+    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
+
+  kcode = 1
+  kdetail = 2
 
-  )
+  _TEXT = _BuildTagLookupTable({
+    0: "ErrorCode",
+    1: "code",
+    2: "detail",
+  }, 2)
+
+  _TYPES = _BuildTagLookupTable({
+    0: ProtocolBuffer.Encoder.NUMERIC,
+    1: ProtocolBuffer.Encoder.NUMERIC,
+    2: ProtocolBuffer.Encoder.STRING,
+  }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
 
   _STYLE = """"""
   _STYLE_CONTENT_TYPE = """"""
@@ -186,6 +301,10 @@
   response_ = None
   has_exception_ = 0
   exception_ = None
+  has_application_error_ = 0
+  application_error_ = None
+  has_java_exception_ = 0
+  java_exception_ = None
 
   def __init__(self, contents=None):
     self.lazy_init_lock_ = thread.allocate_lock()
@@ -227,11 +346,49 @@
 
   def has_exception(self): return self.has_exception_
 
+  def application_error(self):
+    if self.application_error_ is None:
+      self.lazy_init_lock_.acquire()
+      try:
+        if self.application_error_ is None: self.application_error_ = ApplicationError()
+      finally:
+        self.lazy_init_lock_.release()
+    return self.application_error_
+
+  def mutable_application_error(self): self.has_application_error_ = 1; return self.application_error()
+
+  def clear_application_error(self):
+    if self.has_application_error_:
+      self.has_application_error_ = 0;
+      if self.application_error_ is not None: self.application_error_.Clear()
+
+  def has_application_error(self): return self.has_application_error_
+
+  def java_exception(self):
+    if self.java_exception_ is None:
+      self.lazy_init_lock_.acquire()
+      try:
+        if self.java_exception_ is None: self.java_exception_ = RawMessage()
+      finally:
+        self.lazy_init_lock_.release()
+    return self.java_exception_
+
+  def mutable_java_exception(self): self.has_java_exception_ = 1; return self.java_exception()
+
+  def clear_java_exception(self):
+    if self.has_java_exception_:
+      self.has_java_exception_ = 0;
+      if self.java_exception_ is not None: self.java_exception_.Clear()
+
+  def has_java_exception(self): return self.has_java_exception_
+
 
   def MergeFrom(self, x):
     assert x is not self
     if (x.has_response()): self.mutable_response().MergeFrom(x.response())
     if (x.has_exception()): self.mutable_exception().MergeFrom(x.exception())
+    if (x.has_application_error()): self.mutable_application_error().MergeFrom(x.application_error())
+    if (x.has_java_exception()): self.mutable_java_exception().MergeFrom(x.java_exception())
 
   def Equals(self, x):
     if x is self: return 1
@@ -239,23 +396,33 @@
     if self.has_response_ and self.response_ != x.response_: return 0
     if self.has_exception_ != x.has_exception_: return 0
     if self.has_exception_ and self.exception_ != x.exception_: return 0
+    if self.has_application_error_ != x.has_application_error_: return 0
+    if self.has_application_error_ and self.application_error_ != x.application_error_: return 0
+    if self.has_java_exception_ != x.has_java_exception_: return 0
+    if self.has_java_exception_ and self.java_exception_ != x.java_exception_: return 0
     return 1
 
   def IsInitialized(self, debug_strs=None):
     initialized = 1
     if (self.has_response_ and not self.response_.IsInitialized(debug_strs)): initialized = 0
     if (self.has_exception_ and not self.exception_.IsInitialized(debug_strs)): initialized = 0
+    if (self.has_application_error_ and not self.application_error_.IsInitialized(debug_strs)): initialized = 0
+    if (self.has_java_exception_ and not self.java_exception_.IsInitialized(debug_strs)): initialized = 0
     return initialized
 
   def ByteSize(self):
     n = 0
     if (self.has_response_): n += 1 + self.lengthString(self.response_.ByteSize())
     if (self.has_exception_): n += 1 + self.lengthString(self.exception_.ByteSize())
+    if (self.has_application_error_): n += 1 + self.lengthString(self.application_error_.ByteSize())
+    if (self.has_java_exception_): n += 1 + self.lengthString(self.java_exception_.ByteSize())
     return n + 0
 
   def Clear(self):
     self.clear_response()
     self.clear_exception()
+    self.clear_application_error()
+    self.clear_java_exception()
 
   def OutputUnchecked(self, out):
     if (self.has_response_):
@@ -266,6 +433,14 @@
       out.putVarInt32(18)
       out.putVarInt32(self.exception_.ByteSize())
       self.exception_.OutputUnchecked(out)
+    if (self.has_application_error_):
+      out.putVarInt32(26)
+      out.putVarInt32(self.application_error_.ByteSize())
+      self.application_error_.OutputUnchecked(out)
+    if (self.has_java_exception_):
+      out.putVarInt32(34)
+      out.putVarInt32(self.java_exception_.ByteSize())
+      self.java_exception_.OutputUnchecked(out)
 
   def TryMerge(self, d):
     while d.avail() > 0:
@@ -282,6 +457,18 @@
         d.skip(length)
         self.mutable_exception().TryMerge(tmp)
         continue
+      if tt == 26:
+        length = d.getVarInt32()
+        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
+        d.skip(length)
+        self.mutable_application_error().TryMerge(tmp)
+        continue
+      if tt == 34:
+        length = d.getVarInt32()
+        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
+        d.skip(length)
+        self.mutable_java_exception().TryMerge(tmp)
+        continue
       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       d.skipData(tt)
 
@@ -296,24 +483,40 @@
       res+=prefix+"exception <\n"
       res+=self.exception_.__str__(prefix + "  ", printElemNumber)
       res+=prefix+">\n"
+    if self.has_application_error_:
+      res+=prefix+"application_error <\n"
+      res+=self.application_error_.__str__(prefix + "  ", printElemNumber)
+      res+=prefix+">\n"
+    if self.has_java_exception_:
+      res+=prefix+"java_exception <\n"
+      res+=self.java_exception_.__str__(prefix + "  ", printElemNumber)
+      res+=prefix+">\n"
     return res
 
+
+  def _BuildTagLookupTable(sparse, maxtag, default=None):
+    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
+
   kresponse = 1
   kexception = 2
-
-  _TEXT = (
-   "ErrorCode",
-   "response",
-   "exception",
-  )
+  kapplication_error = 3
+  kjava_exception = 4
 
-  _TYPES = (
-   ProtocolBuffer.Encoder.NUMERIC,
-   ProtocolBuffer.Encoder.STRING,
+  _TEXT = _BuildTagLookupTable({
+    0: "ErrorCode",
+    1: "response",
+    2: "exception",
+    3: "application_error",
+    4: "java_exception",
+  }, 4)
 
-   ProtocolBuffer.Encoder.STRING,
-
-  )
+  _TYPES = _BuildTagLookupTable({
+    0: ProtocolBuffer.Encoder.NUMERIC,
+    1: ProtocolBuffer.Encoder.STRING,
+    2: ProtocolBuffer.Encoder.STRING,
+    3: ProtocolBuffer.Encoder.STRING,
+    4: ProtocolBuffer.Encoder.STRING,
+  }, 4, ProtocolBuffer.Encoder.MAX_TYPE)
 
   _STYLE = """"""
   _STYLE_CONTENT_TYPE = """"""
@@ -572,36 +775,35 @@
       res+=prefix+">\n"
     return res
 
+
+  def _BuildTagLookupTable(sparse, maxtag, default=None):
+    return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
+
   kPreconditionGroup = 1
   kPreconditionkey = 2
   kPreconditionhash = 3
   kputs = 4
   kdeletes = 5
 
-  _TEXT = (
-   "ErrorCode",
-   "Precondition",
-   "key",
-   "hash",
-   "puts",
-   "deletes",
-  )
+  _TEXT = _BuildTagLookupTable({
+    0: "ErrorCode",
+    1: "Precondition",
+    2: "key",
+    3: "hash",
+    4: "puts",
+    5: "deletes",
+  }, 5)
 
-  _TYPES = (
-   ProtocolBuffer.Encoder.NUMERIC,
-   ProtocolBuffer.Encoder.STARTGROUP,
-
-   ProtocolBuffer.Encoder.STRING,
-
-   ProtocolBuffer.Encoder.STRING,
-
-   ProtocolBuffer.Encoder.STRING,
-
-   ProtocolBuffer.Encoder.STRING,
-
-  )
+  _TYPES = _BuildTagLookupTable({
+    0: ProtocolBuffer.Encoder.NUMERIC,
+    1: ProtocolBuffer.Encoder.STARTGROUP,
+    2: ProtocolBuffer.Encoder.STRING,
+    3: ProtocolBuffer.Encoder.STRING,
+    4: ProtocolBuffer.Encoder.STRING,
+    5: ProtocolBuffer.Encoder.STRING,
+  }, 5, ProtocolBuffer.Encoder.MAX_TYPE)
 
   _STYLE = """"""
   _STYLE_CONTENT_TYPE = """"""
 
-__all__ = ['Request','Response','TransactionRequest','TransactionRequest_Precondition']
+__all__ = ['Request','ApplicationError','Response','TransactionRequest','TransactionRequest_Precondition']