Package translate :: Package storage :: Package placeables :: Module general :: Class PunctuationPlaceable
[hide private]
[frames] | no frames]

Class PunctuationPlaceable

source code


Placeable handling punctuation.

Instance Methods [hide private]

Inherited from strelem.StringElem: __add__, __contains__, __eq__, __ge__, __getitem__, __getslice__, __gt__, __init__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __radd__, __repr__, __rmul__, __str__, __unicode__, apply_to_strings, copy, delete_elem, delete_range, depth_first, elem_at_offset, elem_offset, encode, find, find_elems_with, flatten, get_ancestor_where, get_index_data, get_parent_elem, insert, insert_between, isleaf, iter_depth_first, map, print_tree, prune, remove_type, translate

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
parse(cls, pstr)
A parser method to extract placeables from a string based on a regular expression.
source code
Class Variables [hide private]
  iseditable = False
Whether this string should be changable by the user.
  istranslatable = False
Whether this string is translatable into other languages.
  regex = re.compile(r'(?x)([\u2122\xa9\xae]|[\u2103\u2109\xb0]|...

Inherited from base.Ph: has_content

Inherited from strelem.StringElem: isfragile, isvisible, renderer, sub

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

parse(cls, pstr)
Class Method

source code 

A parser method to extract placeables from a string based on a regular expression. Use this function as the @parse() method of a placeable class.

Parameters:
  • pstr - The string to parse into an instance of this class.
Returns:
An instance of the current class, or None if the string not parseable by this class.
Overrides: strelem.StringElem.parse

Class Variable Details [hide private]

regex

Value:
re.compile(r'(?x)([\u2122\xa9\xae]|[\u2103\u2109\xb0]|[\xb1\u03c0\u03b\
8\xd7\xf7\u2212\u221a\u221e\u2206\u03a3\u2032\u2033]|[\u2018\u2019\u02\
bc\u201a\u201b\u201c\u201d\u201e\u201f]|[\xa3\xa5]|\u2026|\u2014|\u201\
3|\u202f)+')