~launchpad-results/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to lib/lpresults/xunit/validators.py

  • Committer: Marc Tardif
  • Date: 2012-03-21 22:32:04 UTC
  • Revision ID: marc.tardif@canonical.com-20120321223204-8g7mvzzwmh8ifbrt
Added support for getting systems from a person (LP #899361)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010-2011 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Validator functions."""
 
5
 
 
6
__metaclass__ = type
 
7
 
 
8
__all__ = []
 
9
 
 
10
import re
 
11
 
 
12
 
 
13
INVALID_XML_PATTERN = (
 
14
    ur"(?:(?:[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE-\uFFFF])"
 
15
    ur"|(?:[%s-%s][^%s-%s])|(?:[^%s-%s][%s-%s])|(?:[%s-%s]$)|(?:^[%s-%s]))"
 
16
    % (
 
17
        unichr(0xD800), unichr(0xDBFF), unichr(0xDC00), unichr(0xDFFF),
 
18
        unichr(0xD800), unichr(0xDBFF), unichr(0xDC00), unichr(0xDFFF),
 
19
        unichr(0xD800), unichr(0xDBFF), unichr(0xDC00), unichr(0xDFFF)))
 
20
INVALID_XML_RE = re.compile(INVALID_XML_PATTERN)