kuon.watcher.adapters.sales_adapter   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
eloc 17
dl 0
loc 47
ccs 12
cts 16
cp 0.75
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A SalesAdapterBase.get_sold_history() 0 9 1
A SalesAdapterBase.search() 0 9 1
A SalesAdapterBase.__init__() 0 7 1
A SalesAdapterBase.get_item_link() 0 8 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3 1
from abc import ABCMeta, abstractmethod
4
5 1
from kuon.api_response import APIResponse
6
7
8 1
class SalesAdapterBase(object):
9 1
    __metaclass__ = ABCMeta
10
11 1
    def __init__(self, *args, **kwargs) -> None:
12
        """Initializing function to just not display the warning of unexpected arguments
13
14
        :type args: list
15
        :type kwargs: dict
16
        """
17
        pass
18
19 1
    @abstractmethod
20 1
    def search(self, market_name, no_delay=False) -> APIResponse:
21
        """Search for a specific item
22
23
        :type market_name: str
24
        :type no_delay: bool
25
        :return:
26
        """
27
        pass
28
29 1
    @abstractmethod
30 1
    def get_sold_history(self, market_name, no_delay=False) -> APIResponse:
31
        """Get the last available sell history
32
33
        :type market_name: str
34
        :type no_delay: bool
35
        :return:
36
        """
37
        pass
38
39 1
    @staticmethod
40 1
    @abstractmethod
41 1
    def get_item_link(item_id: int) -> str:
42
        """Generate the item link from the item id
43
44
        :return:
45
        """
46
        pass
47