dbus/service.py, dbus/_dbus_bindings-types.pxi: Move VariantSignature
[dbus-python-phuang.git] / dbus / _util.py
blobc254178ec59d8e9ff1f0f73ff2fa67b8f4d15814
1 import re
2 from exceptions import ValidationException
4 def _validate_interface_or_name(value):
5 elements = value.split('.')
6 if len(elements) <= 1:
7 raise ValidationException("%s must contain at least two elements seperated by a period ('.')"%(value))
9 validate = re.compile('[A-Za-z][\w_]*')
10 for element in elements:
11 if not validate.match(element):
12 raise ValidationException("Element %s of %s has invalid characters"%(element ,value))