source: products/quintagroup.transmogrifier/branches/dictionary/quintagroup/transmogrifier/namespaces/util.py @ 2720

Last change on this file since 2720 was 1414, checked in by piv, 14 years ago

merge plone2.1 branche updates (r2426-2428,2433-2452): manifests with valid xml now, binary files fully dumped, local roles are imported, control characters are handled properly

File size: 471 bytes
Line 
1"""
2    Helpful functions for namespaces
3"""
4
5import re
6
7# control characters from 0-31 and 127 (delete) excluding:
8#   9 (\t, tab)
9#   10 (\n, new line character)
10#   13 (\r, carriage return)
11#   127 (\x1f, delete)
12# which are handled properly by python xml libraries such
13# as xml.dom.minidom and elementtree
14_ctrl_chars = re.compile(r'[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]')
15def has_ctrlchars(value):
16    if _ctrl_chars.search(value):
17        return True
18    return False
Note: See TracBrowser for help on using the repository browser.