2 # -*- coding: iso-8859-15 -*-
5 """This file contains "validators" that convert between string and python (database) representation
6 of properties used in the "Rodelbahnbox" and "Gasthausbox".
7 The "to_python" method has to get a unicode argument.
10 import formencode.national
13 import xml.dom.minidom as minidom
14 from xml.parsers.expat import ExpatError
17 class NoneValidator(formencode.FancyValidator):
18 """Takes a validator and makes it possible that empty strings are mapped to None."""
19 def __init__(self, validator, python_none=None):
20 self.validator = validator
21 self.python_none = python_none
23 def to_python(self, value):
24 self.assert_string(value, None)
25 if value == u'': return self.python_none
26 return self.validator.to_python(value)
28 def from_python(self, value):
29 if value == self.python_none: return u''
30 return self.validator.from_python(value)
33 class NeinValidator(formencode.FancyValidator):
34 """Take an arbitrary validator and adds the possibility that the
35 string can be u'Nein'.
36 Example together with an UnsignedNone validator:
37 >>> v = NeinValidator(UnsignedNone())
40 >>> v.to_python(u'34')
42 >>> v.to_python(u'Nein')
45 def __init__(self, validator, python_no=u'Nein'):
46 self.validator = validator
47 self.python_no = python_no
49 def to_python(self, value):
50 self.assert_string(value, None)
51 if value == u'Nein': return self.python_no
52 return self.validator.to_python(value)
54 def from_python(self, value):
55 if value == self.python_no: return u'Nein'
56 return self.validator.from_python(value)
59 class Unicode(formencode.FancyValidator):
60 """Converts an unicode string to an unicode string:
61 u'any string' <=> u'any string'"""
62 def to_python(self, value):
63 self.assert_string(value, None)
66 def from_python(self, value):
70 class UnicodeNone(NoneValidator):
71 """Converts an unicode string to an unicode string:
73 u'any string' <=> u'any string'"""
75 NoneValidator.__init__(self, Unicode())
78 class Unsigned(formencode.FancyValidator):
79 """Converts an unsigned number to a string and vice versa:
84 def __init__(self, max=None):
85 self.iv = formencode.validators.Int(min=0, max=max)
87 def to_python(self, value):
88 self.assert_string(value, None)
89 return self.iv.to_python(value)
91 def from_python(self, value):
95 class UnsignedNone(NoneValidator):
96 """Converts an unsigned number to a string and vice versa:
102 def __init__(self, max=None):
103 NoneValidator.__init__(self, Unsigned(max))
106 class UnsignedNeinNone(NoneValidator):
107 """ Translates a number of Nein to a number.
115 NoneValidator.__init__(self, UnsignedNone())
118 class Loop(formencode.FancyValidator):
119 """Takes a validator and calls from_python(to_python(value))."""
120 def __init__(self, validator):
121 self.validator = validator
123 def to_python(self, value):
124 self.assert_string(value, None)
125 return self.validator.from_python(self.validator.to_python(value))
127 def from_python(self, value):
128 # we don't call self.validator.to_python(self.validator.from_python(value))
129 # here because our to_python implementation basically leaves the input untouches
130 # and so should from_python do.
131 return self.validator.from_python(self.validator.to_python(value))
134 class DictValidator(formencode.FancyValidator):
135 """Translates strings to other values via a python directory.
136 >>> boolValidator = DictValidator({u'': None, u'Ja': True, u'Nein': False})
137 >>> boolValidator.to_python(u'')
139 >>> boolValidator.to_python(u'Ja')
142 def __init__(self, dict):
145 def to_python(self, value):
146 self.assert_string(value, None)
147 if not self.dict.has_key(value): raise formencode.Invalid("Key not found in dict.", value, None)
148 return self.dict[value]
150 def from_python(self, value):
151 for k, v in self.dict.iteritems():
152 if type(v) == type(value) and v == value: return k
153 raise formencode.Invalid('Invalid value', value, None)
156 class GermanBoolNone(DictValidator):
157 """Converts German bool values to the python bool type:
163 DictValidator.__init__(self, {u'': None, u'Ja': True, u'Nein': False})
166 class GermanTristateTuple(DictValidator):
167 """Does the following conversion:
169 u'Ja' <=> (True, False)
170 u'Teilweise' <=> (True, True)
171 u'Nein' <=> (False, True)"""
172 def __init__(self, yes_python = (True, False), no_python = (False, True), partly_python = (True, True), none_python = (None, None)):
173 DictValidator.__init__(self, {u'': none_python, u'Ja': yes_python, u'Nein': no_python, u'Teilweise': partly_python})
176 class GermanTristateFloat(GermanTristateTuple):
177 """Converts the a property with the possible values 0.0, 0.5, 1.0 or None
184 GermanTristateTuple.__init__(self, yes_python=1.0, no_python=0.0, partly_python=0.5, none_python=None)
187 class ValueComment(formencode.FancyValidator):
188 """Converts value with a potentially optional comment to a python tuple:
190 u'value' <=> (u'value', None)
191 u'value (comment)' <=> (u'value', u'comment')"""
192 def __init__(self, value_validator=UnicodeNone(), comment_validator=UnicodeNone(), comment_is_optional=True):
193 self.value_validator = value_validator
194 self.comment_validator = comment_validator
195 self.comment_is_optional = comment_is_optional
197 def to_python(self, value):
198 self.assert_string(value, None)
203 left = value.find('(')
204 right = value.rfind(')')
205 if left < 0 and right < 0:
206 if not self.comment_is_optional: raise formencode.Invalid(u'Mandatory comment not present', value, None)
209 elif left >= 0 and right >= 0 and left < right:
210 v = value[:left].strip()
211 c = value[left+1:right].strip()
212 else: raise formencode.Invalid(u'Invalid format', value, None)
213 return self.value_validator.to_python(v), self.comment_validator.to_python(c)
215 def from_python(self, value):
216 assert len(value) == 2
217 v = self.value_validator.from_python(value[0])
218 c = self.comment_validator.from_python(value[1])
220 if len(v) > 0: return u'%s (%s)' % (v, c)
221 else: return u'(%s)' % c
225 class SemicolonList(formencode.FancyValidator):
226 """Applies a given validator to a semicolon separated list of values and returns a python list.
227 For an empty string an empty list is returned."""
228 def __init__(self, validator=Unicode()):
229 self.validator = validator
231 def to_python(self, value):
232 self.assert_string(value, None)
233 return [self.validator.to_python(s.strip()) for s in value.split(';')]
235 def from_python(self, value):
236 return "; ".join([self.validator.from_python(s) for s in value])
239 class ValueCommentList(SemicolonList):
240 """A value-comment list looks like one of the following lines:
242 value (optional comment)
244 value1; value2 (optional comment)
245 value1 (optional comment1); value2 (optional comment2); value3 (otional comment3)
246 value1 (optional comment1); value2 (optional comment2); value3 (otional comment3)
247 This function returns the value-comment list as list of tuples:
248 [(u'value1', u'comment1'), (u'value2', None)]
249 If no comment is present, None is specified.
250 For an empty string, [] is returned."""
251 def __init__(self, value_validator=Unicode(), comments_are_optional=True):
252 SemicolonList.__init__(self, ValueComment(value_validator, comment_is_optional=comments_are_optional))
255 class GenericDateTime(formencode.FancyValidator):
256 """Converts a generic date/time information to a datetime class with a user defined format.
257 '2009-03-22 20:36:15' would be specified as '%Y-%m-%d %H:%M:%S'."""
259 def __init__(self, date_time_format = '%Y-%m-%d %H:%M:%S', **keywords):
260 formencode.FancyValidator.__init__(self, **keywords)
261 self.date_time_format = date_time_format
263 def to_python(self, value, state=None):
264 self.assert_string(value, None)
265 try: return datetime.datetime.strptime(value, self.date_time_format)
266 except ValueError, e: raise formencode.Invalid(str(e), value, None)
268 def from_python(self, value, state=None):
269 return value.strftime(self.date_time_format)
272 class DateTimeNoSec(GenericDateTime):
273 def __init__(self, **keywords):
274 GenericDateTime.__init__(self, '%Y-%m-%d %H:%M', **keywords)
277 class DateNone(NoneValidator):
278 """Converts date information to date classes with the format '%Y-%m-%d' or None."""
280 NoneValidator.__init__(self, GenericDateTime('%Y-%m-%d'))
283 class Geo(formencode.FancyValidator):
284 """Formats to coordinates '47.076207 N 11.453553 E' to the (latitude, longitude) tuplet."""
285 def to_python(self, value):
286 self.assert_string(value, None)
287 r = re.match(u'(\d+\.\d+) N (\d+\.\d+) E', value)
288 if r is None: raise formencode.Invalid(u"Coordinates '%s' have not a format like '47.076207 N 11.453553 E'" % value, value, None)
289 return (float(r.groups()[0]), float(r.groups()[1]))
291 def from_python(self, value):
292 latitude, longitude = value
293 return u'%.6f N %.6f E' % (latitude, longitude)
296 class GeoNone(NoneValidator):
297 """Formats to coordinates '47.076207 N 11.453553 E' to the (latitude, longitude) tuplet."""
299 NoneValidator.__init__(self, Geo(), (None, None))
302 class MultiGeo(formencode.FancyValidator):
303 "Formats multiple coordinates, even in multiple lines to [(latitude, longitude, elevation), ...] or [(latitude, longitude, None), ...] tuplets."
305 # Valid for input_format
306 FORMAT_GUESS = 0 # guesses the input format; default for input_format
307 FORMAT_NONE = -1 # indicates missing formats
309 # Valid for input_format and output_format
310 FORMAT_GEOCACHING = 1 # e.g. "N 47° 13.692 E 011° 25.535"
311 FORMAT_WINTERRODELN = 2 # e.g. "47.222134 N 11.467211 E"
312 FORMAT_GMAPPLUGIN = 3 # e.g. "47.232922, 11.452239"
313 FORMAT_GPX = 4 # e.g. "<trkpt lat="47.181289" lon="11.408827"><ele>1090.57</ele></trkpt>"
315 input_format = FORMAT_GUESS
316 output_format = FORMAT_WINTERRODELN
317 last_input_format = FORMAT_NONE
319 def __init__(self, input_format = FORMAT_GUESS, output_format = FORMAT_WINTERRODELN, **keywords):
320 self.input_format = input_format
321 self.output_format = output_format
322 formencode.FancyValidator.__init__(self, if_empty = (None, None, None), **keywords)
324 def to_python(self, value):
325 self.assert_string(value, None)
326 input_format = self.input_format
327 if not input_format in [self.FORMAT_GUESS, self.FORMAT_GEOCACHING, self.FORMAT_WINTERRODELN, self.FORMAT_GMAPPLUGIN, self.FORMAT_GPX]:
328 raise formencode.Invalid(u"input_format %d is not recognized" % input_format, value, None) # Shouldn't it be an other type of runtime error?
329 lines = [line.strip() for line in value.split("\n") if len(line.strip()) > 0]
333 if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GEOCACHING:
334 r = re.match(u'N ?(\d+)° ?(\d+\.\d+) +E ?(\d+)° ?(\d+\.\d+)', line)
337 result.append((float(g[0]) + float(g[1])/60, float(g[2]) + float(g[3])/60, None))
338 last_input_format = self.FORMAT_WINTERRODELN
341 if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_WINTERRODELN:
342 r = re.match(u'(\d+\.\d+) N (\d+\.\d+) E', line)
344 result.append((float(r.groups()[0]), float(r.groups()[1]), None))
345 last_input_format = self.FORMAT_WINTERRODELN
348 if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GMAPPLUGIN:
349 r = re.match(u'(\d+\.\d+), ?(\d+\.\d+)', line)
351 result.append((float(r.groups()[0]), float(r.groups()[1]), None))
352 last_input_format = self.FORMAT_GMAPPLUGIN
355 if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GPX:
357 xml = minidom.parseString(line)
358 coord = xml.documentElement
359 lat = float(coord.getAttribute('lat'))
360 lon = float(coord.getAttribute('lon'))
361 try: ele = float(coord.childNodes[0].childNodes[0].nodeValue)
362 except (IndexError, ValueError): ele = None
363 result.append((lat, lon, ele))
364 last_input_format = self.FORMAT_GPX
366 except (ExpatError, IndexError, ValueError): pass
368 raise formencode.Invalid(u"Coordinates '%s' have no known format" % line, value, None)
372 def from_python(self, value):
373 output_format = self.output_format
375 for latitude, longitude, height in value:
376 if output_format == self.FORMAT_GEOCACHING:
378 result.append(u'N %02d° %02.3f E %03d° %02.3f' % (latitude, latitude % 1 * 60, longitude, longitude % 1 * 60))
380 elif output_format == self.FORMAT_WINTERRODELN:
381 result.append(u'%.6f N %.6f E' % (latitude, longitude))
383 elif output_format == self.FORMAT_GMAPPLUGIN:
384 result.append(u'%.6f, %.6f' % (latitude, longitude))
386 elif output_format == self.FORMAT_GPX:
387 if not height is None: result.append(u'<trkpt lat="%.6f" lon="%.6f"><ele>%.2f</ele></trkpt>' % (latitude, longitude, height))
388 else: result.append(u'<trkpt lat="%.6f" lon="%.6f"/>' % (latitude, longitude))
391 raise formencode.Invalid(u"output_format %d is not recognized" % output_format, value, None) # Shouldn't it be an other type of runtime error?
393 return "\n".join(result)
397 class AustrianPhoneNumber(formencode.FancyValidator):
399 Validates and converts phone numbers to +##/###/####### or +##/###/#######-### (having an extension)
400 @param default_cc country code for prepending if none is provided, defaults to 43 (Austria)
402 >>> v = AustrianPhoneNumber()
403 >>> v.to_python(u'0512/12345678')
405 >>> v.to_python(u'+43/512/12345678')
407 >>> v.to_python(u'0512/1234567-89') # 89 is the extension
408 u'+43/512/1234567-89'
409 >>> v.to_python(u'+43/512/1234567-89')
410 u'+43/512/1234567-89'
411 >>> v.to_python(u'0512 / 12345678') # Exception
412 >>> v.to_python(u'0512-12345678') # Exception
414 # Inspired by formencode.national.InternationalPhoneNumber
416 default_cc = 43 # Default country code
417 messages = {'phoneFormat': "'%%(value)s' is an invalid format. Please enter a number in the form +43/###/####### or 0###/########."}
419 def to_python(self, value):
420 self.assert_string(value, None)
421 m = re.match(u'^(?:\+(\d+)/)?([\d/]+)(?:-(\d+))?$', value)
423 # u'+43/512/1234567-89' => (u'43', u'512/1234567', u'89')
424 # u'+43/512/1234/567-89' => (u'43', u'512/1234/567', u'89')
425 # u'+43/512/1234/567' => (u'43', u'512/1234/567', None)
426 # u'0512/1234567' => (None, u'0512/1234567', None)
427 if m is None: raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
428 (country, phone, extension) = m.groups()
431 if phone.find(u'//') > -1 or phone.count('/') == 0: raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
435 if phone[0] != '0': raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
437 country = unicode(self.default_cc)
439 if extension is None: return '+%s/%s' % (country, phone)
440 return '+%s/%s-%s' % (country, phone, extension)
444 class AustrianPhoneNumberNone(NoneValidator):
446 NoneValidator.__init__(self, AustrianPhoneNumber())
450 class AustrianPhoneNumberCommentLoop(NoneValidator):
452 NoneValidator.__init__(self, Loop(ValueComment(AustrianPhoneNumber())))
455 class GermanDifficulty(DictValidator):
456 """Converts the difficulty represented in a number from 1 to 3 (or None)
457 to a German representation:
463 DictValidator.__init__(self, {u'': None, u'leicht': 1, u'mittel': 2, u'schwer': 3})
466 class GermanAvalanches(DictValidator):
467 """Converts the avalanches property represented as number from 1 to 4 (or None)
468 to a German representation:
472 u'gelegentlich' <=> 3
475 DictValidator.__init__(self, {u'': None, u'kaum': 1, u'selten': 2, u'gelegentlich': 3, u'häufig': 4})
478 class GermanPublicTransport(DictValidator):
479 """Converts the public_transport property represented as number from 1 to 6 (or None)
480 to a German representation:
489 DictValidator.__init__(self, {u'': None, u'Sehr gut': 1, u'Gut': 2, u'Mittelmäßig': 3, u'Schlecht': 4, u'Nein': 5, u'Ja': 6})
492 class GermanTristateFloatComment(ValueComment):
493 """Converts the a property with the possible values 0.0, 0.5, 1.0 or None and an optional comment
494 in parenthesis to a German text:
496 u'Ja' <=> (1.0, None)
497 u'Teilweise' <=> (0.5, None)
498 u'Nein' <=> (0.0, None)
499 u'Ja (aber schmal)' <=> (1.0, u'aber schmal')
500 u'Teilweise (oben)' <=> (0.5, u'oben')
501 u'Nein (aber breit)' <=> (0.0, u'aber breit')
504 ValueComment.__init__(self, GermanTristateFloat())
507 class UnsignedCommentNone(NoneValidator):
508 """Converts the a property with unsigned values an optional comment
509 in parenthesis to a text:
511 u'2 (Mo, Di)' <=> (2, u'Mo, Di')
515 def __init__(self, max=None):
516 NoneValidator.__init__(self, ValueComment(Unsigned(max=max)), (None, None))
519 class GermanCachet(formencode.FancyValidator):
520 """Converts a "Gütesiegel":
523 u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel' <=> u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel'"""
524 def to_python(self, value):
525 self.assert_string(value, None)
526 if value == u'': return None
527 elif value == u'Nein': return value
528 elif value.startswith(u'Tiroler Naturrodelbahn-Gütesiegel '):
530 Unsigned().to_python(p[2]) # check if year can be parsed
531 if not p[3] in ['leicht', 'mittel', 'schwer']: raise formencode.Invalid("Unbekannter Schwierigkeitsgrad", value, None)
533 else: raise formencode.Invalid(u"Unbekanntes Gütesiegel", value, None)
535 def from_python(self, value):
536 if value == None: return u''
538 return self.to_python(value)
541 class Url(formencode.FancyValidator):
542 """Validates an URL. In contrast to fromencode.validators.URL, umlauts are allowed."""
543 urlv = formencode.validators.URL()
544 def to_python(self, value):
545 self.assert_string(value, None)
547 v = v.replace(u'ä', u'a')
548 v = v.replace(u'ö', u'o')
549 v = v.replace(u'ü', u'u')
550 v = v.replace(u'ß', u'ss')
551 v = self.urlv.to_python(v)
554 def from_python(self, value):
558 class UrlNeinNone(NoneValidator):
559 """Validates an URL. In contrast to fromencode.validators.URL, umlauts are allowed.
560 The special value u"Nein" is allowed."""
562 NoneValidator.__init__(self, NeinValidator(Url()))
565 class ValueCommentListNeinLoopNone(NoneValidator):
566 """Translates a semicolon separated list of values with optional comments in paranthesis or u'Nein' to itself.
567 An empty string is translated to None:
570 u'T-Mobile (gut); A1' <=> u'T-Mobile (gut); A1'"""
572 NoneValidator.__init__(self, NeinValidator(Loop(ValueCommentList())))
575 class PhoneNumber(formencode.FancyValidator):
576 """Telefonnumber in international format, e.g. u'+43-699-1234567'"""
577 def __init__(self, default_cc=43):
578 self.validator = formencode.national.InternationalPhoneNumber(default_cc=lambda: default_cc)
580 def to_python(self, value):
581 return unicode(self.validator.to_python(value))
583 def from_python(self, value):
584 return self.validator.from_python(value)
587 class PhoneCommentListNeinLoopNone(NoneValidator):
588 """List with semicolon-separated phone numbers in international format with optional comment or 'Nein' as string:
591 u'+43-699-1234567 (nicht nach 20:00 Uhr); +43-512-123456' <=> u'+43-699-1234567 (nicht nach 20:00 Uhr); +43-512-123456'
593 def __init__(self, comments_are_optional):
594 NoneValidator.__init__(self, NeinValidator(Loop(ValueCommentList(PhoneNumber(default_cc=43), comments_are_optional=comments_are_optional))))
597 class EmailCommentListNeinLoopNone(NoneValidator):
598 """Converts a semicolon-separated list of email addresses with optional comments to itself.
599 The special value of u'Nein' indicates that there are no email addresses.
600 The empty string translates to None:
603 u'first@example.com' <=> u'first@example.com'
604 u'first@example.com (Nur Winter); second@example.com' <=> u'first@example.com (Nur Winter); second@example.com'
607 NoneValidator.__init__(self, NeinValidator(Loop(ValueCommentList(formencode.validators.Email()))))
610 class WikiPage(formencode.FancyValidator):
611 """Validates wiki page name like u'[[Birgitzer Alm]]'.
612 The page is not checked for existance.
613 An empty string is an error.
614 u'[[Birgitzer Alm]]' <=> u'[[Birgitzer Alm]]'
616 def to_python(self, value):
617 self.assert_string(value, None)
618 if not value.startswith('[[') or not value.endswith(']]'):
619 raise formencode.Invalid('No valid wiki page name', value, None)
622 def from_python(self, value):
626 class WikiPageList(SemicolonList):
627 """Validates a list of wiki pages like u'[[Birgitzer Alm]]; [[Kemater Alm]]'.
628 u'[[Birgitzer Alm]]; [[Kemater Alm]]' <=> [u'[[Birgitzer Alm]]', u'[[Kemater Alm]]']
629 u'[[Birgitzer Alm]]' <=> [u'[[Birgitzer Alm]]']
633 SemicolonList.__init__(self, WikiPage())
636 class WikiPageListLoopNone(NoneValidator):
637 """Validates a list of wiki pages like u'[[Birgitzer Alm]]; [[Kemater Alm]]' as string.
638 u'[[Birgitzer Alm]]; [[Kemater Alm]]' <=> u'[[Birgitzer Alm]]; [[Kemater Alm]]'
639 u'[[Birgitzer Alm]]' <=> u'[[Birgitzer Alm]]'
643 NoneValidator.__init__(self, Loop(WikiPageList()))
646 class TupleSecondValidator(formencode.FancyValidator):
647 """Does not really validate anything but puts the string through
648 a validator in the second part of a tuple.
649 Examples with an Unsigned() validator and the True argument:
651 u'2' <=> (True, 2)"""
652 def __init__(self, first=True, validator=UnicodeNone()):
654 self.validator = validator
656 def to_python(self, value):
657 self.assert_string(value, None)
658 return self.first, self.validator.to_python(value)
660 def from_python(self, value):
661 assert value[0] == self.first
662 return self.validator.from_python(value[1])
665 class BoolUnicodeTupleValidator(NoneValidator):
666 """Translates an unparsed string or u'Nein' to a tuple:
668 u'Nein' <=> (False, None)
669 u'any text' <=> (True, u'any text')
671 def __init__(self, validator=UnicodeNone()):
672 NoneValidator.__init__(self, NeinValidator(TupleSecondValidator(True, validator), (False, None)), (None, None))
675 class GermanLift(BoolUnicodeTupleValidator):
676 """Checks a lift_details property. It is a value comment property with the following
683 Alternatively, the value u'Nein' is allowed.
684 An empty string maps to (None, None).
688 u'Nein' <=> (False, None)
689 u'Sessellift <=> (True, u'Sessellift')
690 u'Gondel (nur bis zur Hälfte)' <=> (True, u'Gondel (nur bis zur Hälfte)')
691 u'Sessellift; Taxi' <=> (True, u'Sessellift; Taxi')
692 u'Sessellift (Wochenende); Taxi (6 Euro)' <=> (True, u'Sessellift (Wochenende); Taxi (6 Euro)')
695 BoolUnicodeTupleValidator.__init__(self, Loop(ValueCommentList(DictValidator({u'Sessellift': u'Sessellift', u'Gondel': u'Gondel', u'Linienbus': u'Linienbus', u'Taxi': u'Taxi', u'Sonstige': u'Sonstige'}))))
698 class SledRental(BoolUnicodeTupleValidator):
699 """The value can be an empty string, u'Nein' or a comma-separated list of unicode strings with optional comments.
701 u'Nein' <=> (False, None)
702 u'Talstation (nur mit Ticket); Schneealm' <=> (True, u'Talstation (nur mit Ticket); Schneealm')"""
704 BoolUnicodeTupleValidator.__init__(self, Loop(ValueCommentList()))