Skip to content

Documentation for the provider module

Generic Provider class which provides an abstraction for the different drivers we would like to use.

Provider

Each driver will be derive from this Abstract provider class.

This class also contains generic methods which needs to be implemented in the concrete provider classes.

Source code in src/speed_sleuth/provider/__init__.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class Provider(metaclass=abc.ABCMeta):
    """Each driver will be derive from this Abstract provider class.

    This class also contains generic methods which needs to be
    implemented in the concrete provider classes.

    """

    @classmethod
    def __subclasshook__(cls, subclass):
        return (
            hasattr(subclass, "run")
            and callable(subclass.run)
            and hasattr(subclass, "parse_results")
            and callable(subclass.parse_results)
            or NotImplemented
        )

    @classmethod
    @abc.abstractmethod
    def run(cls, filename):
        """Actual method that would trigger the test for the given provider."""

    @classmethod
    @abc.abstractmethod
    def parse_results(cls):
        """Method that would gather results from the speedtest for the given
        provider."""

parse_results() abstractmethod classmethod

Method that would gather results from the speedtest for the given provider.

Source code in src/speed_sleuth/provider/__init__.py
33
34
35
36
37
@classmethod
@abc.abstractmethod
def parse_results(cls):
    """Method that would gather results from the speedtest for the given
    provider."""

run(filename) abstractmethod classmethod

Actual method that would trigger the test for the given provider.

Source code in src/speed_sleuth/provider/__init__.py
28
29
30
31
@classmethod
@abc.abstractmethod
def run(cls, filename):
    """Actual method that would trigger the test for the given provider."""