Package mms :: Module message :: Class MMSMessage
[hide private]
[frames] | no frames]

Class MMSMessage

source code

An MMS message


Note: References used in this class: [1][2][3][4][5]

Instance Methods [hide private]
 
__init__(self) source code
 
addPage(self, page)
Adds a single page/slide (MMSMessagePage object) to the message
source code
 
addDataPart(self, dataPart)
Adds a single data part (DataPart object) to the message, without connecting it to a specific slide/page in the message.
source code
 
smil(self)
Returns the text of the message's SMIL file
source code
 
encode(self)
Convenience funtion that binary-encodes this MMS message
source code
 
toFile(self, filename)
Convenience funtion that writes this MMS message to disk in binary-encoded form.
source code
Static Methods [hide private]
 
fromFile(filename)
Convenience static funtion that loads the specified MMS message file from disk, decodes its data, and returns a new MMSMessage object, which can then be manipulated and re-encoded, for instance.
source code
Properties [hide private]
  contentType
Returns the string representation of this data part's "Content-Type" header.
  pages
Returns a list of all the pages in this message
  dataParts
Returns a list of all the data parts in this message, including data parts that were added to slides in this message
Method Details [hide private]

addPage(self, page)

source code 
Adds a single page/slide (MMSMessagePage object) to the message
Parameters:
  • page (MMSMessagPage) - The message slide/page to add

addDataPart(self, dataPart)

source code 

Adds a single data part (DataPart object) to the message, without connecting it to a specific slide/page in the message.

A data part encapsulates some form of attachment, e.g. an image, audio etc.
Parameters:
  • dataPart (DataPart) - The data part to add

Note: It is not necessary to explicitly add data parts to the message using this function if "addPage" is used; this method is mainly useful if you want to create MMS messages without SMIL support, i.e. messages of type "application/vnd.wap.multipart.mixed"

encode(self)

source code 
Convenience funtion that binary-encodes this MMS message
Returns:
The binary-encode MMS data, as an array of bytes @rtype array.array('B')

Note: This uses the mms_pdu.MMSEncoder class internally

toFile(self, filename)

source code 
Convenience funtion that writes this MMS message to disk in binary-encoded form.
Parameters:
  • filename (str) - The name of the file in which to store the message data
Returns:
The binary-encode MMS data, as an array of bytes @rtype array.array('B')

Note: This uses the mms_pdu.MMSEncoder class internally

fromFile(filename)
Static Method

source code 
Convenience static funtion that loads the specified MMS message file from disk, decodes its data, and returns a new MMSMessage object, which can then be manipulated and re-encoded, for instance.
Parameters:
  • filename (str) - The name of the file to load

Note: This uses the mms_pdu.MMSDecoder class internally


Property Details [hide private]

contentType

Returns the string representation of this data part's "Content-Type" header. No parameter information is returned; to get that, access the "Content-Type" header directly (which has a tuple value)from the message's headers attribute.

This is equivalent to calling DataPart.headers['Content-Type'][0]
Get Method:
unreachable.contentType(self) - Returns the string representation of this data part's "Content-Type" header.

pages

Returns a list of all the pages in this message
Get Method:
unreachable.pages(self) - Returns a list of all the pages in this message

dataParts

Returns a list of all the data parts in this message, including data parts that were added to slides in this message
Get Method:
unreachable.dataParts(self) - Returns a list of all the data parts in this message, including data parts that were added to slides in this message