Module lisa
source code
Parent class for LISA standards (TMX, TBX, XLIFF)
|
|
LISAunit
A single unit in the file.
|
|
|
LISAfile
A class representing a file store for one of the LISA file formats.
|
|
|
_findAllMatches(text,
re_obj)
generate match objects for all re_obj
matches in text. |
source code
|
|
|
|
_getPhMatches(text)
return list of regexp matchobjects for with all place holders in the
text |
source code
|
|
|
|
placeholders = ['(%[diouxXeEfFgGcrs])', '(\\\\+.?)', '(%[0-9]$...
|
|
|
re_placeholders = [re.compile(r'(%[diouxXeEfFgGcrs])'), re.com...
|
|
|
MULTIWHITESPACE_PATTERN = '[\\n\\r\\t ]+'
|
|
|
MULTIWHITESPACE_RE = re.compile(r'(?m)[\n\r\t ]+')
|
|
|
XML_NS = 'http://www.w3.org/XML/1998/namespace'
|
|
|
ph = '(<.+?>)'
|
|
|
string_xpath = etree.XPath("string()")
|
|
|
string_xpath_normalized = etree.XPath("normalize-space()")
|
|
|
xml_preserve_ancestors = etree.XPath("ancestor-or-self::*[attr...
|
|
|
xml_space_ancestors = etree.XPath("ancestor-or-self::*/attribu...
|
Imports:
re,
base,
data,
etree,
getText,
getXMLlang,
getXMLspace,
namespaced,
normalize_space,
normalize_xml_space,
setXMLlang,
setXMLspace
placeholders
- Value:
['(%[diouxXeEfFgGcrs])',
'(\\\\+.?)',
'(%[0-9]$lx)',
'(%[0-9]\\$[a-z])',
'(<.+?>)']
|
|
re_placeholders
- Value:
[re.compile(r'(%[diouxXeEfFgGcrs])'),
re.compile(r'(\\+.?)'),
re.compile(r'(%[0-9]$lx)'),
re.compile(r'(%[0-9]\$[a-z])'),
re.compile(r'(<.+?>)')]
|
|
xml_preserve_ancestors
- Value:
etree.XPath("ancestor-or-self::*[attribute::xml:space='preserve']")
|
|
xml_space_ancestors
- Value:
etree.XPath("ancestor-or-self::*/attribute::xml:space")
|
|