Ejemplo n.º 1
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_sender(d.getPrefixedString())
                continue
            if tt == 18:
                self.set_replyto(d.getPrefixedString())
                continue
            if tt == 26:
                self.add_to(d.getPrefixedString())
                continue
            if tt == 34:
                self.add_cc(d.getPrefixedString())
                continue
            if tt == 42:
                self.add_bcc(d.getPrefixedString())
                continue
            if tt == 50:
                self.set_subject(d.getPrefixedString())
                continue
            if tt == 58:
                self.set_textbody(d.getPrefixedString())
                continue
            if tt == 66:
                self.set_htmlbody(d.getPrefixedString())
                continue
            if tt == 74:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.add_attachment().TryMerge(tmp)
                continue
            if tt == 82:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.add_header().TryMerge(tmp)
                continue
            if tt == 90:
                self.set_amphtmlbody(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
 def put32(self, value):
     if value < 0 or value >= (1 << 32):
         raise ProtocolBuffer.ProtocolBufferEncodeError('u32 too big')
     self.buf.append((value >> 24) & 0xff)
     self.buf.append((value >> 16) & 0xff)
     self.buf.append((value >> 8) & 0xff)
     self.buf.append((value >> 0) & 0xff)
     return
Ejemplo n.º 3
0
    def TryMerge(self, d):
        while 1:
            tt = d.getVarInt32()
            if tt == 12: break
            if tt == 18:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.mutable_key().TryMerge(tmp)
                continue
            if tt == 26:
                self.set_hash(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 4
0
 def TryMerge(self, d):
   while d.avail() > 0:
     tt = d.getVarInt32()
     if tt == 10:
       length = d.getVarInt32()
       tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
       d.skip(length)
       self.add_config().TryMerge(tmp)
       continue
     if tt == 18:
       length = d.getVarInt32()
       tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
       d.skip(length)
       self.mutable_default_config().TryMerge(tmp)
       continue
     if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
     d.skipData(tt)
Ejemplo n.º 5
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 8:
                self.set_log_mail_body(d.getBoolean())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
 def get32(self):
     if self.idx + 4 > self.limit:
         raise ProtocolBuffer.ProtocolBufferDecodeError('truncated')
     c = int(self.buf[self.idx])
     d = self.buf[self.idx + 1]
     e = self.buf[self.idx + 2]
     f = self.buf[self.idx + 3]
     self.idx += 4
     return (c << 24) | (d << 16) | (e << 8) | f
Ejemplo n.º 7
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_version(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 8
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 8:
                self.set_instances(d.getVarInt64())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
  def TryMerge(self, d):
    while d.avail() > 0:
      tt = d.getVarInt32()
      if tt == 10:
        length = d.getVarInt32()
        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
        d.skip(length)
        self.mutable_fetch_queues_response().TryMerge(tmp)
        continue
      if tt == 18:
        length = d.getVarInt32()
        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
        d.skip(length)
        self.mutable_fetch_queue_stats_response().TryMerge(tmp)
        continue


      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
      d.skipData(tt)
Ejemplo n.º 10
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.mutable_scope().TryMerge(tmp)
                continue
            if tt == 16:
                self.set_permission(d.getVarInt32())
                continue
            if tt == 26:
                self.set_display_name(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 11
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_service_name(d.getPrefixedString())
                continue
            if tt == 18:
                self.set_call(d.getPrefixedString())
                continue
            if tt == 26:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.mutable_status().TryMerge(tmp)
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 12
0
  def TryMerge(self, d):
    while d.avail() > 0:
      tt = d.getVarInt32()
      if tt == 9:
        self.set_value(d.getDouble())
        continue


      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
      d.skipData(tt)
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 8:
                self.set_summary_status(d.getVarInt32())
                continue
            if tt == 16:
                self.set_time_until_scheduled(d.getVarInt64())
                continue
            if tt == 26:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.add_config().TryMerge(tmp)
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 14
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_id(d.getPrefixedString())
                continue
            if tt == 18:
                self.set_language(d.getPrefixedString())
                continue
            if tt == 26:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.add_field().TryMerge(tmp)
                continue
            if tt == 32:
                self.set_order_id(d.getVarInt32())
                continue
            if tt == 40:
                self.set_storage(d.getVarInt32())
                continue
            if tt == 50:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.mutable_acl().TryMerge(tmp)
                continue
            if tt == 56:
                self.set_version(d.getVarInt64())
                continue
            if tt == 66:
                length = d.getVarInt32()
                tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                             d.pos() + length)
                d.skip(length)
                self.add_facet().TryMerge(tmp)
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
            d.skipData(tt)
 def put64(self, value):
     if value < 0 or value >= (1 << 64):
         raise ProtocolBuffer.ProtocolBufferEncodeError('u64 too big')
     self.buf.append((value >> 56) & 0xff)
     self.buf.append((value >> 48) & 0xff)
     self.buf.append((value >> 40) & 0xff)
     self.buf.append((value >> 32) & 0xff)
     self.buf.append((value >> 24) & 0xff)
     self.buf.append((value >> 16) & 0xff)
     self.buf.append((value >> 8) & 0xff)
     self.buf.append((value >> 0) & 0xff)
     return
Ejemplo n.º 16
0
  def _MakeCallImpl(self):
    assert isinstance(self.request, ProtocolBuffer.ProtocolMessage)
    assert isinstance(self.response, ProtocolBuffer.ProtocolMessage)

    e = ProtocolBuffer.Encoder()
    self.request.Output(e)

    self.__state = RPC.RUNNING

    _apphosting_runtime___python__apiproxy.MakeCall(
        self.package, self.call, e.buffer(), self.__result_dict,
        self.__MakeCallDone, self, deadline=(self.deadline or -1))
    def getDouble(self):
        if self.idx + 8 > self.limit:
            raise ProtocolBuffer.ProtocolBufferDecodeError('truncated')
        a = self.buf[self.idx:self.idx + 8]
        self.idx += 8
        if a[0] & 0x80:

            a[0] ^= 0x80
        else:

            a = [x ^ 0xFF for x in a]
        return struct.unpack('>d', array.array('B', a).tostring())[0]
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 18:
                self.set_token(d.getPrefixedString())
                continue
            if tt == 24:
                self.set_duration_minutes(d.getVarInt32())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 19
0
 def TryMerge(self, d):
     while d.avail() > 0:
         tt = d.getVarInt32()
         if tt == 11:
             self.add_precondition().TryMerge(d)
             continue
         if tt == 34:
             length = d.getVarInt32()
             tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                          d.pos() + length)
             d.skip(length)
             self.mutable_puts().TryMerge(tmp)
             continue
         if tt == 42:
             length = d.getVarInt32()
             tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(),
                                          d.pos() + length)
             d.skip(length)
             self.mutable_deletes().TryMerge(tmp)
             continue
         if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
         d.skipData(tt)
Ejemplo n.º 20
0
    def TryMerge(self, d):
        while 1:
            tt = d.getVarInt32()
            if tt == 28: break
            if tt == 34:
                self.set_key(d.getPrefixedString())
                continue
            if tt == 42:
                self.set_value(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
  def TryMerge(self, d):
    while d.avail() > 0:
      tt = d.getVarInt32()
      if tt == 10:
        length = d.getVarInt32()
        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
        d.skip(length)
        self.mutable_input().TryMerge(tmp)
        continue
      if tt == 18:
        self.set_output_mime_type(d.getPrefixedString())
        continue
      if tt == 26:
        length = d.getVarInt32()
        tmp = ProtocolBuffer.Decoder(d.buffer(), d.pos(), d.pos() + length)
        d.skip(length)
        self.add_flag().TryMerge(tmp)
        continue


      if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
      d.skipData(tt)
 def get64(self):
     if self.idx + 8 > self.limit:
         raise ProtocolBuffer.ProtocolBufferDecodeError('truncated')
     c = int(self.buf[self.idx])
     d = int(self.buf[self.idx + 1])
     e = int(self.buf[self.idx + 2])
     f = int(self.buf[self.idx + 3])
     g = int(self.buf[self.idx + 4])
     h = self.buf[self.idx + 5]
     i = self.buf[self.idx + 6]
     j = self.buf[self.idx + 7]
     self.idx += 8
     return ((c << 56) | (d << 48) | (e << 40) | (f << 32) | (g << 24)
             | (h << 16) | (i << 8) | j)
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_package(d.getPrefixedString())
                continue
            if tt == 18:
                self.add_capability(d.getPrefixedString())
                continue
            if tt == 26:
                self.add_call(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 24
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_scope(d.getPrefixedString())
                continue
            if tt == 18:
                self.add_scopes(d.getPrefixedString())
                continue
            if tt == 24:
                self.set_request_writer_permission(d.getBoolean())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 25
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 8:
                self.set_is_available(d.getBoolean())
                continue
            if tt == 16:
                self.set_presence(d.getVarInt32())
                continue
            if tt == 24:
                self.set_valid(d.getBoolean())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 26
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_blob_key(d.getPrefixedString())
                continue
            if tt == 18:
                self.set_mime_type(d.getPrefixedString())
                continue
            if tt == 26:
                self.set_target_app_id(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 27
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_blob_key(d.getPrefixedString())
                continue
            if tt == 16:
                self.set_start_index(d.getVarInt64())
                continue
            if tt == 24:
                self.set_end_index(d.getVarInt64())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 28
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_destination_url(d.getPrefixedString())
                continue
            if tt == 18:
                self.set_auth_domain(d.getPrefixedString())
                continue
            if tt == 26:
                self.set_federated_identity(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 29
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_key(d.getPrefixedString())
                continue
            if tt == 18:
                self.add_value(d.getPrefixedString())
                continue
            if tt == 24:
                self.set_partial(d.getBoolean())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)
Ejemplo n.º 30
0
    def TryMerge(self, d):
        while d.avail() > 0:
            tt = d.getVarInt32()
            if tt == 10:
                self.set_file(d.getPrefixedString())
                continue
            if tt == 16:
                self.set_line(d.getVarInt64())
                continue
            if tt == 26:
                self.set_function_name(d.getPrefixedString())
                continue

            if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError()
            d.skipData(tt)