diff -r 27971a13089f -r 2e0b0af889be thirdparty/google_appengine/google/appengine/api/api_base_pb.py --- a/thirdparty/google_appengine/google/appengine/api/api_base_pb.py Sat Sep 05 14:04:24 2009 +0200 +++ b/thirdparty/google_appengine/google/appengine/api/api_base_pb.py Sun Sep 06 23:31:53 2009 +0200 @@ -88,18 +88,21 @@ if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) return res + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + kvalue = 1 - _TEXT = ( - "ErrorCode", - "value", - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ProtocolBuffer.Encoder.STRING, - - ) + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.STRING, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" @@ -169,18 +172,21 @@ if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt32(self.value_)) return res + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + kvalue = 1 - _TEXT = ( - "ErrorCode", - "value", - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ProtocolBuffer.Encoder.NUMERIC, - - ) + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.NUMERIC, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" @@ -250,18 +256,21 @@ if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt64(self.value_)) return res + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + kvalue = 1 - _TEXT = ( - "ErrorCode", - "value", - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ProtocolBuffer.Encoder.NUMERIC, - - ) + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.NUMERIC, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" @@ -330,18 +339,21 @@ if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatBool(self.value_)) return res + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + kvalue = 1 - _TEXT = ( - "ErrorCode", - "value", - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ProtocolBuffer.Encoder.NUMERIC, - - ) + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.NUMERIC, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" @@ -410,18 +422,105 @@ if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormat(self.value_)) return res + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + kvalue = 1 - _TEXT = ( - "ErrorCode", - "value", - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) + + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.DOUBLE, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) + + _STYLE = """""" + _STYLE_CONTENT_TYPE = """""" +class BytesProto(ProtocolBuffer.ProtocolMessage): + has_value_ = 0 + value_ = "" + + def __init__(self, contents=None): + if contents is not None: self.MergeFromString(contents) + + def value(self): return self.value_ + + def set_value(self, x): + self.has_value_ = 1 + self.value_ = x + + def clear_value(self): + if self.has_value_: + self.has_value_ = 0 + self.value_ = "" + + def has_value(self): return self.has_value_ + + + def MergeFrom(self, x): + assert x is not self + if (x.has_value()): self.set_value(x.value()) + + def Equals(self, x): + if x is self: return 1 + if self.has_value_ != x.has_value_: return 0 + if self.has_value_ and self.value_ != x.value_: return 0 + return 1 - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ProtocolBuffer.Encoder.DOUBLE, + def IsInitialized(self, debug_strs=None): + initialized = 1 + if (not self.has_value_): + initialized = 0 + if debug_strs is not None: + debug_strs.append('Required field: value not set.') + return initialized + + def ByteSize(self): + n = 0 + n += self.lengthString(len(self.value_)) + return n + 1 + + def Clear(self): + self.clear_value() + + def OutputUnchecked(self, out): + out.putVarInt32(10) + out.putPrefixedString(self.value_) - ) + def TryMerge(self, d): + while d.avail() > 0: + tt = d.getVarInt32() + if tt == 10: + self.set_value(d.getPrefixedString()) + continue + if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError + d.skipData(tt) + + + def __str__(self, prefix="", printElemNumber=0): + res="" + if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) + return res + + + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + + kvalue = 1 + + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + 1: "value", + }, 1) + + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + 1: ProtocolBuffer.Encoder.STRING, + }, 1, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" @@ -465,15 +564,19 @@ return res - _TEXT = ( - "ErrorCode", - ) + def _BuildTagLookupTable(sparse, maxtag, default=None): + return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) + - _TYPES = ( - ProtocolBuffer.Encoder.NUMERIC, - ) + _TEXT = _BuildTagLookupTable({ + 0: "ErrorCode", + }, 0) + + _TYPES = _BuildTagLookupTable({ + 0: ProtocolBuffer.Encoder.NUMERIC, + }, 0, ProtocolBuffer.Encoder.MAX_TYPE) _STYLE = """""" _STYLE_CONTENT_TYPE = """""" -__all__ = ['StringProto','Integer32Proto','Integer64Proto','BoolProto','DoubleProto','VoidProto'] +__all__ = ['StringProto','Integer32Proto','Integer64Proto','BoolProto','DoubleProto','BytesProto','VoidProto']