Python thrift.transport.TTransport.TTransportException() Examples

The following are 30 code examples of thrift.transport.TTransport.TTransportException(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module thrift.transport.TTransport , or try the search function .
Example #1
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getChannels(self, seqid, iprot, oprot):
        args = getChannels_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getChannels_result()
        try:
            result.success = self._handler.getChannels(args.lastSynced, args.locale)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getChannels", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #2
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getSquare(self, seqid, iprot, oprot):
        args = getSquare_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSquare_result()
        try:
            result.success = self._handler.getSquare(args.mid)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getSquare", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #3
Source File: AgeCheckService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_retrieveRequestToken(self, seqid, iprot, oprot):
        args = retrieveRequestToken_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = retrieveRequestToken_result()
        try:
            result.success = self._handler.retrieveRequestToken(args.carrier)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("retrieveRequestToken", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #4
Source File: UniversalNotificationService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_notify(self, seqid, iprot, oprot):
        args = notify_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notify_result()
        try:
            self._handler.notify(args.event)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except UniversalNotificationServiceException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("notify", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #5
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_notifyEmailConfirmationResult(self, seqid, iprot, oprot):
        args = notifyEmailConfirmationResult_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notifyEmailConfirmationResult_result()
        try:
            self._handler.notifyEmailConfirmationResult(args.parameterMap)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("notifyEmailConfirmationResult", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #6
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getJoinedSquares(self, seqid, iprot, oprot):
        args = getJoinedSquares_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getJoinedSquares_result()
        try:
            result.success = self._handler.getJoinedSquares(args.continuationToken, args.limit)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getJoinedSquares", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #7
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_createSquareChat(self, seqid, iprot, oprot):
        args = createSquareChat_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = createSquareChat_result()
        try:
            result.success = self._handler.createSquareChat(args.reqSeq, args.squareChat, args.squareMemberMids)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("createSquareChat", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #8
Source File: SnsAdaptorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_postSnsInvitationMessage(self, seqid, iprot, oprot):
        args = postSnsInvitationMessage_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = postSnsInvitationMessage_result()
        try:
            self._handler.postSnsInvitationMessage(args.snsIdType, args.snsAccessToken, args.toSnsUserId)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("postSnsInvitationMessage", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #9
Source File: SnsAdaptorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getSnsMyProfile(self, seqid, iprot, oprot):
        args = getSnsMyProfile_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSnsMyProfile_result()
        try:
            result.success = self._handler.getSnsMyProfile(args.snsIdType, args.snsAccessToken)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getSnsMyProfile", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #10
Source File: SnsAdaptorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getSnsFriends(self, seqid, iprot, oprot):
        args = getSnsFriends_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSnsFriends_result()
        try:
            result.success = self._handler.getSnsFriends(args.snsIdType, args.snsAccessToken, args.startIdx, args.limit)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getSnsFriends", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #11
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_sendMessage(self, seqid, iprot, oprot):
        args = sendMessage_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = sendMessage_result()
        try:
            result.success = self._handler.sendMessage(args.reqSeq, args.squareChatMid, args.squareMessage)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("sendMessage", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #12
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_issueRequestToken(self, seqid, iprot, oprot):
        args = issueRequestToken_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = issueRequestToken_result()
        try:
            result.success = self._handler.issueRequestToken(args.channelId, args.otpId)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("issueRequestToken", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #13
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getNotificationBadgeCount(self, seqid, iprot, oprot):
        args = getNotificationBadgeCount_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getNotificationBadgeCount_result()
        try:
            result.success = self._handler.getNotificationBadgeCount(args.localRev)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getNotificationBadgeCount", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #14
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getFriendChannelMatrices(self, seqid, iprot, oprot):
        args = getFriendChannelMatrices_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getFriendChannelMatrices_result()
        try:
            result.success = self._handler.getFriendChannelMatrices(args.channelIds)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getFriendChannelMatrices", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #15
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getDomains(self, seqid, iprot, oprot):
        args = getDomains_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getDomains_result()
        try:
            result.success = self._handler.getDomains(args.lastSynced)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getDomains", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #16
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_issueRequestTokenWithAuthScheme(self, seqid, iprot, oprot):
        args = issueRequestTokenWithAuthScheme_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = issueRequestTokenWithAuthScheme_result()
        try:
            result.success = self._handler.issueRequestTokenWithAuthScheme(args.channelId, args.otpId, args.authScheme, args.returnUrl)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("issueRequestTokenWithAuthScheme", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #17
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getChannelNotificationSettings(self, seqid, iprot, oprot):
        args = getChannelNotificationSettings_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getChannelNotificationSettings_result()
        try:
            result.success = self._handler.getChannelNotificationSettings(args.locale)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getChannelNotificationSettings", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #18
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getChannelInfo(self, seqid, iprot, oprot):
        args = getChannelInfo_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getChannelInfo_result()
        try:
            result.success = self._handler.getChannelInfo(args.channelId, args.locale)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getChannelInfo", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #19
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getApprovedChannels(self, seqid, iprot, oprot):
        args = getApprovedChannels_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getApprovedChannels_result()
        try:
            result.success = self._handler.getApprovedChannels(args.lastSynced, args.locale)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("getApprovedChannels", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #20
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_fetchNotificationItems(self, seqid, iprot, oprot):
        args = fetchNotificationItems_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = fetchNotificationItems_result()
        try:
            result.success = self._handler.fetchNotificationItems(args.localRev)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("fetchNotificationItems", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #21
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_approveChannelAndIssueRequestToken(self, seqid, iprot, oprot):
        args = approveChannelAndIssueRequestToken_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = approveChannelAndIssueRequestToken_result()
        try:
            result.success = self._handler.approveChannelAndIssueRequestToken(args.channelId, args.otpId)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("approveChannelAndIssueRequestToken", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #22
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_approveChannelAndIssueChannelToken(self, seqid, iprot, oprot):
        args = approveChannelAndIssueChannelToken_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = approveChannelAndIssueChannelToken_result()
        try:
            result.success = self._handler.approveChannelAndIssueChannelToken(args.channelId)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except ChannelException as e:
            msg_type = TMessageType.REPLY
            result.e = e
        except Exception as ex:
            msg_type = TMessageType.EXCEPTION
            logging.exception(ex)
            result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
        oprot.writeMessageBegin("approveChannelAndIssueChannelToken", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #23
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_multiGetLastReadMessageIds(self, seqid, iprot, oprot):
    args = multiGetLastReadMessageIds_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = multiGetLastReadMessageIds_result()
    try:
      result.success = self._handler.multiGetLastReadMessageIds(args.chatIds)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("multiGetLastReadMessageIds", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES 
Example #24
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_getLastReadMessageIds(self, seqid, iprot, oprot):
    args = getLastReadMessageIds_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getLastReadMessageIds_result()
    try:
      result.success = self._handler.getLastReadMessageIds(args.chatId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getLastReadMessageIds", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #25
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_fetchMessageOperations(self, seqid, iprot, oprot):
    args = fetchMessageOperations_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = fetchMessageOperations_result()
    try:
      result.success = self._handler.fetchMessageOperations(args.localRevision, args.lastOpTimestamp, args.count)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("fetchMessageOperations", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #26
Source File: ChannelApplicationProvidedService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_updateProfileAttributeForChannel(self, seqid, iprot, oprot):
    args = updateProfileAttributeForChannel_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = updateProfileAttributeForChannel_result()
    try:
      self._handler.updateProfileAttributeForChannel(args.profileAttribute, args.value)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("updateProfileAttributeForChannel", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES 
Example #27
Source File: ChannelApplicationProvidedService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_sendMessageForChannel(self, seqid, iprot, oprot):
    args = sendMessageForChannel_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = sendMessageForChannel_result()
    try:
      result.success = self._handler.sendMessageForChannel(args.message)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("sendMessageForChannel", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #28
Source File: ChannelApplicationProvidedService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_removeNotificationStatus(self, seqid, iprot, oprot):
    args = removeNotificationStatus_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = removeNotificationStatus_result()
    try:
      self._handler.removeNotificationStatus(args.notificationStatus)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("removeNotificationStatus", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #29
Source File: ChannelApplicationProvidedService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_registerChannelCP(self, seqid, iprot, oprot):
    args = registerChannelCP_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = registerChannelCP_result()
    try:
      result.success = self._handler.registerChannelCP(args.cpId, args.registerPassword)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("registerChannelCP", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #30
Source File: ChannelApplicationProvidedService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_isInContact(self, seqid, iprot, oprot):
    args = isInContact_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = isInContact_result()
    try:
      result.success = self._handler.isInContact(args.mid)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("isInContact", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()