pyxmpp.xmppstringprep.Profile

Package pyxmpp :: Module xmppstringprep :: Class Profile |
[show private | hide private]
[frames | no frames]

## Class Profile

Base class for stringprep profiles.

Method Summary
| ``__init__`(self, unassigned, mapping, normalization, prohibited, bidi)` Initialize Profile object.
| ``check_bidi`(self, s)` Checks if sting is valid for bidirectional printing.
| ``check_unassigned`(self, s)` Checks for unassigned character codes.
| ``map`(self, s)` Mapping part of string preparation.
| ``prepare`(self, data)` Complete string preparation procedure for 'stored' strings.
| ``prepare_query`(self, s)` Complete string preparation procedure for 'query' strings.
| ``prohibit`(self, s)` Checks for prohibited characters.

Class Variable Summary
`list` | `cache_items` = `[]`

Method Details

### __init__(self, unassigned, mapping, normalization, prohibited, bidi=1) (Constructor) Initialize Profile object. Parameters: `unassigned` - the lookup table with unassigned codes `mapping` - the lookup table with character mappings `normalization` - the normalization function `prohibited` - the lookup table with prohibited characters `bidi` - if True then bidirectional checks should be done

### check_bidi(self, s) Checks if sting is valid for bidirectional printing.

### check_unassigned(self, s) Checks for unassigned character codes.

### map(self, s) Mapping part of string preparation.

### prepare(self, data) Complete string preparation procedure for 'stored' strings. (includes checks for unassigned codes) Parameters: `data` - Unicode string to prepare. Returns: prepared string Raises: `StringprepError` - if the preparation fails

### prepare_query(self, s) Complete string preparation procedure for 'query' strings. (without checks for unassigned codes) Parameters: `s` - Unicode string to prepare. Returns: prepared string Raises: `StringprepError` - if the preparation fails

### prohibit(self, s) Checks for prohibited characters.

Class Variable Details

    ### cache_items Type: `list` Value:
        []