Part of canonical.launchpad.mail.commands View In Hierarchy
Implements interfaces: canonical.launchpad.interfaces.mail.IBugTaskEmailCommand
Class Method | getBugTarget | Return the IBugTarget with the given path. |
Method | execute | See IEmailCommand. |
Class Method | _splitPath | Split the path part into two. |
Class Method | _normalizePath | Normalize the path. |
Method | _targetBug | Try to target the bug the given distroseries. |
Method | _create_bug_task | Creates a new bug task with bug_target as the target. |
Inherited from EmailCommand:
Method | __init__ | Undocumented |
Method | convertArguments | Converts the string argument to Python objects. |
Method | __str__ | See IEmailCommand. |
Method | _ensureNumberOfArguments | Check that the number of arguments is correct. |
Split the path part into two.
The first part is the part before any slash, and the other is the part behind the slash:
>>> AffectsEmailCommand._splitPath('foo/bar/baz') ('foo', 'bar/baz')
If No slash is in the path, the other part will be empty.
>>> AffectsEmailCommand._splitPath('foo') ('foo', '')
Normalize the path.
Previously the path had to start with either /distros/ or /products/. Simply remove any such prefixes to stay backward compatible.
>>> AffectsEmailCommand._normalizePath('/distros/foo/bar') 'foo/bar' >>> AffectsEmailCommand._normalizePath('/distros/foo/bar') 'foo/bar'
Also remove a starting slash, since that's a common mistake.
>>> AffectsEmailCommand._normalizePath('/foo/bar') 'foo/bar'
Return the IBugTarget with the given path.
Path should be in any of the following forms:
$product $product/$product_series $distribution $distribution/$source_package $distribution/$distro_series $distribution/$distro_series/$source_package