Part of lp.app.validators
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 |
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'
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