diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-30 00:45:48 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-30 00:45:48 -0700 |
commit | 447c88a2bb9dd364f9c67a73bfce5000ac81d375 (patch) | |
tree | 85061cb22960e33a07ae3b29c6a9c6588163fe31 /ipalib/constants.py | |
parent | e14fc84dfccbb06f775bbd5d3de864c7b879453f (diff) | |
download | freeipa-447c88a2bb9dd364f9c67a73bfce5000ac81d375.tar.gz freeipa-447c88a2bb9dd364f9c67a73bfce5000ac81d375.tar.xz freeipa-447c88a2bb9dd364f9c67a73bfce5000ac81d375.zip |
Started moving some core classes and functions from plugable.py to new base.py module
Diffstat (limited to 'ipalib/constants.py')
-rw-r--r-- | ipalib/constants.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/constants.py b/ipalib/constants.py index dc23b1091..5687c53e6 100644 --- a/ipalib/constants.py +++ b/ipalib/constants.py @@ -25,8 +25,14 @@ All constants centralised in one file. # The parameter system treats all these values as None: NULLS = (None, '', u'', tuple(), []) +# regular expression NameSpace member names must match: +NAME_REGEX = r'^[a-z][_a-z0-9]*[a-z0-9]$' + +# Format for ValueError raised when name does not match above regex: +NAME_ERROR = 'name must match %r; got %r' + # Standard format for TypeError message: -TYPE_ERROR = '%s: need a %r; got %r (which is a %r)' +TYPE_ERROR = '%s: need a %r; got %r (a %r)' # Stardard format for TypeError message when a callable is expected: CALLABLE_ERROR = '%s: need a callable; got %r (which is a %r)' @@ -37,7 +43,7 @@ OVERRIDE_ERROR = 'cannot override %s.%s value %r with %r' # Standard format for AttributeError message when a read-only attribute is # already locked: SET_ERROR = 'locked: cannot set %s.%s to %r' -DEL_ERROR = 'locked: cannot del %s.%s' +DEL_ERROR = 'locked: cannot delete %s.%s' # Used for a tab (or indentation level) when formatting for CLI: CLI_TAB = ' ' # Two spaces |