vendor Package¶
vendor
Package¶
An app which enables Distro Tracker to access vendor-specific functionality.
Vendors can define their own specific set of rules for mail dispatch and the Web interface or provide additional data which Distro Tracker can plug in to appropriate functions.
Each rule should be implemented as a callable which takes a defined set of
arguments with a predefined name. The supported callables are listed in the
distro_tracker.vendor.skeleton.rules
module of the
distro_tracker.vendor.skeleton
package which can serve as a starting
point for the implementation of the vendor-specific functions.
Note
You should copy this package to a new directory and give it a descriptive name.
Note
Make sure the package is a valid Django app.
common
Module¶
A module which defines functions to allow other parts of Distro Tracker to hook into the vendor-specific functionality.
-
exception
distro_tracker.vendor.common.
PluginProcessingError
[source]¶ Bases:
RuntimeError
-
distro_tracker.vendor.common.
call
(name, *args, **kwargs)[source]¶ Function which executes the vendor-specific function with the given name by passing it the given arguments.
It returns a tuple
(result, implemented)
where the values represent:- result – the corresponding function’s return value. If the function was
not found,
None
is given. - implemented – a Boolean indicating whether the package implements the given function. This way clients can differentiate between functions with no return value and non-implemented functions.
Parameters: name – The name of the vendor-specific function that should be called. - result – the corresponding function’s return value. If the function was
not found,
-
distro_tracker.vendor.common.
get_callable
(name)[source]¶ Returns a callable object from the vendor-provided module based on the string name given as the parameter. If no callable object with the given name is found in the vendor module an exception is raised.
Parameters: name (string) – The name of the callable which should be returned
models
Module¶
tests
Module¶
Tests for the distro_tracker.vendor
app.
The test suite automatically includes any tests available in a tests
module of all subpackages.
-
class
distro_tracker.vendor.tests.
DispatchBaseNoVendorModuleTest
(methodName='runTest')[source]¶ Bases:
distro_tracker.mail.tests.tests_dispatch.DispatchBaseTest
Tests that the base dispatch tests pass even when there is no vendor specific module set.
-
distro_tracker.vendor.tests.
get_subpackages
()[source]¶ Helper function returns all subpackages of the
distro_tracker.vendor
package.
-
distro_tracker.vendor.tests.
get_test_cases
(tests_module)[source]¶ Returns a list of all
django.test.SimpleTestCase
subclasses from the given module.Parameters: tests_module – The module from which django.test.SimpleTestCase
should be extracted.
-
distro_tracker.vendor.tests.
suite
()[source]¶ Loads tests found in all subpackages of the
distro_tracker.vendor
package.