l.a.v.name : module documentation

Part of lp.app.validators

Validators for the .name attribute (defined in various schemas.)
Function sanitize_name Remove from the given name all characters that are not allowed
Function valid_name Return True if the name is valid, otherwise False.
Function valid_bug_name Return True if the bug name is valid, otherwise False.
Function name_validator Return True if the name is valid, or raise a
Function bug_name_validator Return True if the name is valid, or raise a
def sanitize_name(name):

Remove from the given name all characters that are not allowed on names.

The characters not allowed in Launchpad names are described by invalid_name_pattern.

>>> sanitize_name('foo_bar')
'foobar'
>>> sanitize_name('baz bar $fd')
'bazbarfd'
def valid_name(name):

Return True if the name is valid, otherwise False.

Launchpad name attributes are designed for use as url components and short unique identifiers to things.

The default name constraints may be too strict for some objects, such as binary packages or arch branches where naming conventions already exists, so they may use their own specialized name validators

>>> valid_name('hello')
True
>>> valid_name('helLo')
False
>>> valid_name('he')
True
>>> valid_name('h')
False
def valid_bug_name(name):
Return True if the bug name is valid, otherwise False.
def name_validator(name):
Return True if the name is valid, or raise a LaunchpadValidationError.
def bug_name_validator(name):
Return True if the name is valid, or raise a LaunchpadValidationError.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.