Completed
Pull Request — master (#58)
by
unknown
01:18
created

BaseReportBackend   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A handle_loading() 0 3 1
A handle_saving() 0 3 1
A __init__() 0 10 1
1
import abc
2
3
from ..utils import get_machine_id
4
from ..logger import Logger
5
6
7
class BaseReportBackend:
8
    __metaclass__ = abc.ABCMeta
9
10
    def __init__(self, config):
11
        self.verbose = config.getoption("benchmark_verbose")
12
        self.logger = Logger(self.verbose, config)
13
        self.config = config
14
        self.machine_id = get_machine_id()
15
        self.save = config.getoption("benchmark_save")
16
        self.autosave = config.getoption("benchmark_autosave")
17
        self.save_data = config.getoption("benchmark_save_data")
18
        self.json = config.getoption("benchmark_json")
19
        self.compare = config.getoption("benchmark_compare")
20
21
22
    @abc.abstractmethod
23
    def handle_saving(self, benchmarks, machine_info):
24
        pass
25
26
    @abc.abstractmethod
27
    def handle_loading(self, machine_info):
28
        pass
29
30