Package mms :: Module wsp_pdu :: Class WSPEncodingAssignments
[hide private]
[frames] | no frames]

Class WSPEncodingAssignments

source code

Static class containing the constant values defined in [5] for well-known content types, parameter names, etc.

It also defines some function for combining assigned number-tables for specific WSP encoding versions, where appropriate.

This is used by both the Encoder and Decoder classes during well-known assigned number lookups (usually these functions have the string WellKnown in their names).

Static Methods [hide private]
dict
wellKnownParameters(encodingVersion='1.2')
Formats list of assigned values for well-known parameter names, for the specified WSP encoding version.
source code
list
headerFieldNames(encodingVersion='1.2')
Formats list of assigned values for header field names, for the specified WSP encoding version.
source code
Class Variables [hide private]
  wspPDUTypes = {1: 'Connect', 2: 'ConnectReply', 3: 'Redirect',...
  wkParameters = {0: ('Q', 'QValue'), 1: ('Charset', 'WellKnownC...
  wkContentTypes = ['*/*', 'text/*', 'text/html', 'text/plain', ...
  wkCharSets = {3: 'us-ascii', 4: 'iso-8859-1', 5: 'iso-8859-2',...
  hdrFieldNames = ['Accept', 'Accept-Charset', 'Accept-Encoding'...
  hdrFieldEncodings = {'Accept': 'AcceptValue', 'Pragma': 'Pragm...
Method Details [hide private]

wellKnownParameters(encodingVersion='1.2')
Static Method

source code 
Formats list of assigned values for well-known parameter names, for the specified WSP encoding version.
Parameters:
  • encodingVersion (str) - The WSP encoding version to use. This defaults to "1.2", but may be "1.1", "1.2", "1.3" or "1.4" (see table 38 in [5] for details).
Returns: dict
A dictionary containing the well-known parameters with assigned numbers for the specified encoding version (and lower). Entries in this dict follow the format: {<int:assigned_number> : (<str:param_name>, <str:expected_type>)}
Raises:
  • ValueError - The specified encoding version is invalid.

headerFieldNames(encodingVersion='1.2')
Static Method

source code 
Formats list of assigned values for header field names, for the specified WSP encoding version.
Parameters:
  • encodingVersion (str) - The WSP encoding version to use. This defaults to "1.2", but may be "1.1", "1.2", "1.3" or "1.4" (see table 39 in [5] for details).
Returns: list
A list containing the WSP header field names with assigned numbers for the specified encoding version (and lower).
Raises:
  • ValueError - The specified encoding version is invalid.

Class Variable Details [hide private]

wspPDUTypes

Value:
{1: 'Connect',
 2: 'ConnectReply',
 3: 'Redirect',
 4: 'Reply',
 5: 'Disconnect',
 6: 'Push',
 7: 'ConfirmedPush',
 8: 'Suspend',
...

wkParameters

Value:
{0: ('Q', 'QValue'),
 1: ('Charset', 'WellKnownCharset'),
 2: ('Level', 'VersionValue'),
 3: ('Type', 'IntegerValue'),
 5: ('Name', 'TextString'),
 6: ('Filename', 'TextString'),
 7: ('Differences', 'Field-name'),
 8: ('Padding', 'ShortInteger'),
...

wkContentTypes

Value:
['*/*',
 'text/*',
 'text/html',
 'text/plain',
 'text/x-hdml',
 'text/x-ttml',
 'text/x-vCalendar',
 'text/x-vCard',
...

wkCharSets

Value:
{3: 'us-ascii',
 4: 'iso-8859-1',
 5: 'iso-8859-2',
 6: 'iso-8859-3',
 7: 'iso-8859-4',
 8: 'iso-8859-5',
 9: 'iso-8859-6',
 10: 'iso-8859-7',
...

hdrFieldNames

Value:
['Accept',
 'Accept-Charset',
 'Accept-Encoding',
 'Accept-Language',
 'Accept-Ranges',
 'Age',
 'Allow',
 'Authorization',
...

hdrFieldEncodings

Value:
{'Accept': 'AcceptValue', 'Pragma': 'PragmaValue'}