Example #1
0
    def messageEndReceived(self, text, type):
        if type == 'AFTN':
            position = MessageAFTN.positionOfEndOfMessage(text)
        elif type == 'ACK':
            position = AckAFTN.positionOfEndOfMessage(text)

        if position != -1:
            if type == 'AFTN':
                if len(text)-2 == position:
                    #print  "Well placed Ending"
                    return True
                else:
                    print "Badly placed ending"
                    return False
            elif type == 'ACK':
                if len(text)-1 == position:
                    #print  "Well placed Ending"
                    return True
                else:
                    print "Badly placed ending"
                    return False

        else:
            print "No valid ending"
            print "Type=%s, Text=%s" % (type, text)
        return False
Example #2
0
    def messageEndReceived(self, text, type):
        if type == 'AFTN':
            position = MessageAFTN.positionOfEndOfMessage(text)
        elif type == 'ACK':
            position = AckAFTN.positionOfEndOfMessage(text)

        if position != -1:
            if type == 'AFTN':
                if len(text) - 2 == position:
                    #print  "Well placed Ending"
                    return True
                else:
                    print "Badly placed ending"
                    return False
            elif type == 'ACK':
                if len(text) - 1 == position:
                    #print  "Well placed Ending"
                    return True
                else:
                    print "Badly placed ending"
                    return False

        else:
            print "No valid ending"
            print "Type=%s, Text=%s" % (type, text)
        return False