86 def __str__(self, prefix="", printElemNumber=0): |
86 def __str__(self, prefix="", printElemNumber=0): |
87 res="" |
87 res="" |
88 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) |
88 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) |
89 return res |
89 return res |
90 |
90 |
|
91 |
|
92 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
93 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
94 |
91 kvalue = 1 |
95 kvalue = 1 |
92 |
96 |
93 _TEXT = ( |
97 _TEXT = _BuildTagLookupTable({ |
94 "ErrorCode", |
98 0: "ErrorCode", |
95 "value", |
99 1: "value", |
96 ) |
100 }, 1) |
97 |
101 |
98 _TYPES = ( |
102 _TYPES = _BuildTagLookupTable({ |
99 ProtocolBuffer.Encoder.NUMERIC, |
103 0: ProtocolBuffer.Encoder.NUMERIC, |
100 ProtocolBuffer.Encoder.STRING, |
104 1: ProtocolBuffer.Encoder.STRING, |
101 |
105 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
102 ) |
|
103 |
106 |
104 _STYLE = """""" |
107 _STYLE = """""" |
105 _STYLE_CONTENT_TYPE = """""" |
108 _STYLE_CONTENT_TYPE = """""" |
106 class Integer32Proto(ProtocolBuffer.ProtocolMessage): |
109 class Integer32Proto(ProtocolBuffer.ProtocolMessage): |
107 has_value_ = 0 |
110 has_value_ = 0 |
167 def __str__(self, prefix="", printElemNumber=0): |
170 def __str__(self, prefix="", printElemNumber=0): |
168 res="" |
171 res="" |
169 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt32(self.value_)) |
172 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt32(self.value_)) |
170 return res |
173 return res |
171 |
174 |
|
175 |
|
176 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
177 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
178 |
172 kvalue = 1 |
179 kvalue = 1 |
173 |
180 |
174 _TEXT = ( |
181 _TEXT = _BuildTagLookupTable({ |
175 "ErrorCode", |
182 0: "ErrorCode", |
176 "value", |
183 1: "value", |
177 ) |
184 }, 1) |
178 |
185 |
179 _TYPES = ( |
186 _TYPES = _BuildTagLookupTable({ |
180 ProtocolBuffer.Encoder.NUMERIC, |
187 0: ProtocolBuffer.Encoder.NUMERIC, |
181 ProtocolBuffer.Encoder.NUMERIC, |
188 1: ProtocolBuffer.Encoder.NUMERIC, |
182 |
189 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
183 ) |
|
184 |
190 |
185 _STYLE = """""" |
191 _STYLE = """""" |
186 _STYLE_CONTENT_TYPE = """""" |
192 _STYLE_CONTENT_TYPE = """""" |
187 class Integer64Proto(ProtocolBuffer.ProtocolMessage): |
193 class Integer64Proto(ProtocolBuffer.ProtocolMessage): |
188 has_value_ = 0 |
194 has_value_ = 0 |
248 def __str__(self, prefix="", printElemNumber=0): |
254 def __str__(self, prefix="", printElemNumber=0): |
249 res="" |
255 res="" |
250 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt64(self.value_)) |
256 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatInt64(self.value_)) |
251 return res |
257 return res |
252 |
258 |
|
259 |
|
260 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
261 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
262 |
253 kvalue = 1 |
263 kvalue = 1 |
254 |
264 |
255 _TEXT = ( |
265 _TEXT = _BuildTagLookupTable({ |
256 "ErrorCode", |
266 0: "ErrorCode", |
257 "value", |
267 1: "value", |
258 ) |
268 }, 1) |
259 |
269 |
260 _TYPES = ( |
270 _TYPES = _BuildTagLookupTable({ |
261 ProtocolBuffer.Encoder.NUMERIC, |
271 0: ProtocolBuffer.Encoder.NUMERIC, |
262 ProtocolBuffer.Encoder.NUMERIC, |
272 1: ProtocolBuffer.Encoder.NUMERIC, |
263 |
273 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
264 ) |
|
265 |
274 |
266 _STYLE = """""" |
275 _STYLE = """""" |
267 _STYLE_CONTENT_TYPE = """""" |
276 _STYLE_CONTENT_TYPE = """""" |
268 class BoolProto(ProtocolBuffer.ProtocolMessage): |
277 class BoolProto(ProtocolBuffer.ProtocolMessage): |
269 has_value_ = 0 |
278 has_value_ = 0 |
328 def __str__(self, prefix="", printElemNumber=0): |
337 def __str__(self, prefix="", printElemNumber=0): |
329 res="" |
338 res="" |
330 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatBool(self.value_)) |
339 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatBool(self.value_)) |
331 return res |
340 return res |
332 |
341 |
|
342 |
|
343 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
344 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
345 |
333 kvalue = 1 |
346 kvalue = 1 |
334 |
347 |
335 _TEXT = ( |
348 _TEXT = _BuildTagLookupTable({ |
336 "ErrorCode", |
349 0: "ErrorCode", |
337 "value", |
350 1: "value", |
338 ) |
351 }, 1) |
339 |
352 |
340 _TYPES = ( |
353 _TYPES = _BuildTagLookupTable({ |
341 ProtocolBuffer.Encoder.NUMERIC, |
354 0: ProtocolBuffer.Encoder.NUMERIC, |
342 ProtocolBuffer.Encoder.NUMERIC, |
355 1: ProtocolBuffer.Encoder.NUMERIC, |
343 |
356 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
344 ) |
|
345 |
357 |
346 _STYLE = """""" |
358 _STYLE = """""" |
347 _STYLE_CONTENT_TYPE = """""" |
359 _STYLE_CONTENT_TYPE = """""" |
348 class DoubleProto(ProtocolBuffer.ProtocolMessage): |
360 class DoubleProto(ProtocolBuffer.ProtocolMessage): |
349 has_value_ = 0 |
361 has_value_ = 0 |
408 def __str__(self, prefix="", printElemNumber=0): |
420 def __str__(self, prefix="", printElemNumber=0): |
409 res="" |
421 res="" |
410 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormat(self.value_)) |
422 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormat(self.value_)) |
411 return res |
423 return res |
412 |
424 |
|
425 |
|
426 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
427 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
428 |
413 kvalue = 1 |
429 kvalue = 1 |
414 |
430 |
415 _TEXT = ( |
431 _TEXT = _BuildTagLookupTable({ |
416 "ErrorCode", |
432 0: "ErrorCode", |
417 "value", |
433 1: "value", |
418 ) |
434 }, 1) |
419 |
435 |
420 _TYPES = ( |
436 _TYPES = _BuildTagLookupTable({ |
421 ProtocolBuffer.Encoder.NUMERIC, |
437 0: ProtocolBuffer.Encoder.NUMERIC, |
422 ProtocolBuffer.Encoder.DOUBLE, |
438 1: ProtocolBuffer.Encoder.DOUBLE, |
423 |
439 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
424 ) |
440 |
|
441 _STYLE = """""" |
|
442 _STYLE_CONTENT_TYPE = """""" |
|
443 class BytesProto(ProtocolBuffer.ProtocolMessage): |
|
444 has_value_ = 0 |
|
445 value_ = "" |
|
446 |
|
447 def __init__(self, contents=None): |
|
448 if contents is not None: self.MergeFromString(contents) |
|
449 |
|
450 def value(self): return self.value_ |
|
451 |
|
452 def set_value(self, x): |
|
453 self.has_value_ = 1 |
|
454 self.value_ = x |
|
455 |
|
456 def clear_value(self): |
|
457 if self.has_value_: |
|
458 self.has_value_ = 0 |
|
459 self.value_ = "" |
|
460 |
|
461 def has_value(self): return self.has_value_ |
|
462 |
|
463 |
|
464 def MergeFrom(self, x): |
|
465 assert x is not self |
|
466 if (x.has_value()): self.set_value(x.value()) |
|
467 |
|
468 def Equals(self, x): |
|
469 if x is self: return 1 |
|
470 if self.has_value_ != x.has_value_: return 0 |
|
471 if self.has_value_ and self.value_ != x.value_: return 0 |
|
472 return 1 |
|
473 |
|
474 def IsInitialized(self, debug_strs=None): |
|
475 initialized = 1 |
|
476 if (not self.has_value_): |
|
477 initialized = 0 |
|
478 if debug_strs is not None: |
|
479 debug_strs.append('Required field: value not set.') |
|
480 return initialized |
|
481 |
|
482 def ByteSize(self): |
|
483 n = 0 |
|
484 n += self.lengthString(len(self.value_)) |
|
485 return n + 1 |
|
486 |
|
487 def Clear(self): |
|
488 self.clear_value() |
|
489 |
|
490 def OutputUnchecked(self, out): |
|
491 out.putVarInt32(10) |
|
492 out.putPrefixedString(self.value_) |
|
493 |
|
494 def TryMerge(self, d): |
|
495 while d.avail() > 0: |
|
496 tt = d.getVarInt32() |
|
497 if tt == 10: |
|
498 self.set_value(d.getPrefixedString()) |
|
499 continue |
|
500 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError |
|
501 d.skipData(tt) |
|
502 |
|
503 |
|
504 def __str__(self, prefix="", printElemNumber=0): |
|
505 res="" |
|
506 if self.has_value_: res+=prefix+("value: %s\n" % self.DebugFormatString(self.value_)) |
|
507 return res |
|
508 |
|
509 |
|
510 def _BuildTagLookupTable(sparse, maxtag, default=None): |
|
511 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
|
512 |
|
513 kvalue = 1 |
|
514 |
|
515 _TEXT = _BuildTagLookupTable({ |
|
516 0: "ErrorCode", |
|
517 1: "value", |
|
518 }, 1) |
|
519 |
|
520 _TYPES = _BuildTagLookupTable({ |
|
521 0: ProtocolBuffer.Encoder.NUMERIC, |
|
522 1: ProtocolBuffer.Encoder.STRING, |
|
523 }, 1, ProtocolBuffer.Encoder.MAX_TYPE) |
425 |
524 |
426 _STYLE = """""" |
525 _STYLE = """""" |
427 _STYLE_CONTENT_TYPE = """""" |
526 _STYLE_CONTENT_TYPE = """""" |
428 class VoidProto(ProtocolBuffer.ProtocolMessage): |
527 class VoidProto(ProtocolBuffer.ProtocolMessage): |
429 |
528 |
463 def __str__(self, prefix="", printElemNumber=0): |
562 def __str__(self, prefix="", printElemNumber=0): |
464 res="" |
563 res="" |
465 return res |
564 return res |
466 |
565 |
467 |
566 |
468 _TEXT = ( |
567 def _BuildTagLookupTable(sparse, maxtag, default=None): |
469 "ErrorCode", |
568 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)]) |
470 ) |
569 |
471 |
570 |
472 _TYPES = ( |
571 _TEXT = _BuildTagLookupTable({ |
473 ProtocolBuffer.Encoder.NUMERIC, |
572 0: "ErrorCode", |
474 ) |
573 }, 0) |
475 |
574 |
476 _STYLE = """""" |
575 _TYPES = _BuildTagLookupTable({ |
477 _STYLE_CONTENT_TYPE = """""" |
576 0: ProtocolBuffer.Encoder.NUMERIC, |
478 |
577 }, 0, ProtocolBuffer.Encoder.MAX_TYPE) |
479 __all__ = ['StringProto','Integer32Proto','Integer64Proto','BoolProto','DoubleProto','VoidProto'] |
578 |
|
579 _STYLE = """""" |
|
580 _STYLE_CONTENT_TYPE = """""" |
|
581 |
|
582 __all__ = ['StringProto','Integer32Proto','Integer64Proto','BoolProto','DoubleProto','BytesProto','VoidProto'] |