GMime.ContentType¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
changed |
r |
||
params |
r |
a |
|
parent_object |
r |
parent |
|
subtype |
r |
media subtype |
|
type |
r |
media type |
Class Details¶
- class GMime.ContentType(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A data structure representing a Content-Type.
- classmethod new(type, subtype)¶
- Parameters:
- Returns:
a new
GMime.ContentType
object.- Return type:
Creates a Content-Type object with type type and subtype subtype.
- classmethod parse(options, str)¶
- Parameters:
options (
GMime.ParserOptions
orNone
) – aGMime.ParserOptions
orNone
str (
str
) – input string containing a content-type (and params)
- Returns:
a new
GMime.ContentType
object.- Return type:
Parses the input string into a
GMime.ContentType
object.
- encode(options)¶
- Parameters:
options (
GMime.FormatOptions
orNone
) – aGMime.FormatOptions
orNone
- Returns:
a new string containing the encoded header value.
- Return type:
Encodes the Content-Disposition header.
- get_media_subtype()¶
- Returns:
the Content-Type’s media sub-type.
- Return type:
Gets the Content-Type’s media sub-type.
- get_media_type()¶
- Returns:
the Content-Type’s media type.
- Return type:
Gets the Content-Type’s media type.
- get_mime_type()¶
- Returns:
an allocated string containing the type and subtype of the content-type in the format: type/subtype.
- Return type:
Allocates a string buffer containing the type and subtype defined by the self.
- get_parameter(name)¶
- Parameters:
name (
str
) – parameter name (aka attribute)- Returns:
the value of the requested parameter or
None
if the parameter is not set. If the parameter is set, the returned string will be in UTF-8.- Return type:
Gets the parameter value specified by name if it’s available.
- get_parameters()¶
- Returns:
the Content-Type’s parameter list.
- Return type:
Gets the Content-Type’s parameter list.
- is_type(type, subtype)¶
- Parameters:
- Returns:
True
if the MIME types match orFalse
otherwise. You may use “*” in place of type and/or subtype as a wilcard.- Return type:
Compares the given type and subtype with that of the given mime type object.