home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / dbus / _util.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  760 b   |  19 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.4)
  3.  
  4. import re
  5. from exceptions import ValidationException
  6.  
  7. def _validate_interface_or_name(value):
  8.     elements = value.split('.')
  9.     if len(elements) <= 1:
  10.         raise ValidationException("%s must contain at least two elements seperated by a period ('.')" % value)
  11.     
  12.     validate = re.compile('[A-Za-z][\\w_]*')
  13.     for element in elements:
  14.         if not validate.match(element):
  15.             raise ValidationException('Element %s of %s has invalid characters' % (element, value))
  16.             continue
  17.     
  18.  
  19.