Passed
Push — master ( d34d79...6ea268 )
by Steffen
01:16
created

SalesAdapterBase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 3
Metric Value
c 3
b 0
f 3
dl 0
loc 40
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A search() 0 8 1
A get_sold_history() 0 8 1
A get_sold_history_no_delay() 0 9 1
A search_no_delay() 0 9 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
4
from abc import ABCMeta, abstractmethod
5
6
7
class SalesAdapterBase:
8
    __metaclass__ = ABCMeta
9
10
    @abstractmethod
11
    def search(self, market_name):
12
        """Search for a specific item
13
14
        :param market_name:
15
        :return:
16
        """
17
        pass
18
19
    @abstractmethod
20
    def search_no_delay(self, market_name):
21
        """Search for a specific item without delay
22
        (some APIs delay responses to prevent bot sniping, use workarounds)
23
24
        :param market_name:
25
        :return:
26
        """
27
        pass
28
29
    @abstractmethod
30
    def get_sold_history(self, market_name):
31
        """Get the last available sell history
32
33
        :param market_name:
34
        :return:
35
        """
36
        pass
37
38
    @abstractmethod
39
    def get_sold_history_no_delay(self, market_name):
40
        """Get the last available sell history without delay
41
        (some APIs delay responses to prevent bot sniping, use workarounds)
42
43
        :param market_name:
44
        :return:
45
        """
46
        pass
47