Beispiel #1
0
    def __init__(self, buffer):
        self.iso639LanguageCode = '---'
        self.descriptorNumber = 0
        self.lastDescriptorNumber = 0
        self.items = []
        self.text = ''

        bufferLen = len(buffer)
        headerLength = 6
        if headerLength < bufferLen:
            self.descriptorNumber = (buffer[2] >> 4) & 0x0f
            self.lastDescriptorNumber = buffer[2] & 0x0f
            self.iso639LanguageCode = ''.join([chr(x) for x in buffer[3:6]])
            lengthOfItems = buffer[6]
            headerLength += lengthOfItems
            if headerLength < bufferLen:
                i = 0
                while i < lengthOfItems:
                    e = ExtendedEvent(buffer[i + 7:])
                    self.items.append(e)
                    i += e.itemDescriptionLength + e.itemLength + 2
                textLength = buffer[lengthOfItems + 7]
                headerLength += textLength
                if headerLength < bufferLen:
                    self.text = convertDVBUTF8([
                        x for x in buffer[8 + lengthOfItems:8 + lengthOfItems +
                                          textLength]
                    ], textLength)
	def __init__(self, buffer):
		self.iso639LanguageCode = '---';
		self.descriptorNumber = 0;
		self.lastDescriptorNumber = 0;
		self.items = [ ];
		self.text = '';
		
		bufferLen = len(buffer);
		headerLength = 6;
		if headerLength < bufferLen:
			self.descriptorNumber = (buffer[2] >> 4) & 0x0f;
			self.lastDescriptorNumber = buffer[2] & 0x0f;
			self.iso639LanguageCode = ''.join([chr(x) for x in buffer[3:6]]);
			lengthOfItems = buffer[6];
			headerLength += lengthOfItems;
			if headerLength < bufferLen:
				i = 0
				while i < lengthOfItems:
					e = ExtendedEvent(buffer[i+7:]);
					self.items.append(e);
					i += e.itemDescriptionLength + e.itemLength + 2;
				textLength = buffer[lengthOfItems + 7];
				headerLength += textLength;
				if headerLength < bufferLen:
					self.text = convertDVBUTF8([x for x in buffer[8+lengthOfItems:8+lengthOfItems+textLength]], textLength);
	def __init__(self, buffer):
		self.iso639LanguageCode = '---';
		self.eventName = '';
		self.text = '';
		
		bufferLen = len(buffer);
		headerLength = 5;
		if headerLength < bufferLen:
			self.iso639LanguageCode = ''.join([chr(x) for x in buffer[2:5]]);
			eventNameLength = buffer[5];
			headerLength += eventNameLength;
			if headerLength < bufferLen:
				self.eventName = convertDVBUTF8([x for x in buffer[6:6+eventNameLength]], eventNameLength);
				textLength = buffer[6 + eventNameLength];
				headerLength += textLength;
				if headerLength < bufferLen:
					self.text = convertDVBUTF8([x for x in buffer[7+eventNameLength:7+eventNameLength+textLength]], textLength);
Beispiel #4
0
    def __init__(self, buffer):
        self.iso639LanguageCode = '---'
        self.eventName = ''
        self.text = ''

        bufferLen = len(buffer)
        headerLength = 5
        if headerLength < bufferLen:
            self.iso639LanguageCode = ''.join([chr(x) for x in buffer[2:5]])
            eventNameLength = buffer[5]
            headerLength += eventNameLength
            if headerLength < bufferLen:
                self.eventName = convertDVBUTF8(
                    [x for x in buffer[6:6 + eventNameLength]],
                    eventNameLength)
                textLength = buffer[6 + eventNameLength]
                headerLength += textLength
                if headerLength < bufferLen:
                    self.text = convertDVBUTF8([
                        x for x in buffer[7 + eventNameLength:7 +
                                          eventNameLength + textLength]
                    ], textLength)