usage   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 30
dl 0
loc 65
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A UsageBitSkins.pricing_interface() 0 9 1
A UsageWatcher.watcher() 0 7 1
A UsageBitSkins.inventory_interface() 0 8 1
A UsageBitSkins.sales_adapter() 0 4 1
A UsageBitSkins.sales_interface() 0 9 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
#
4
# This is an example usage
5
import logging
6
from pprint import pprint
7
8
import kuon.bitskins.api.interfaces as bitskins_interfaces
9
import kuon.watcher.adapters.bitskins as bitskins_adapters
10
from kuon.watcher import Watcher
11
12
13
class UsageWatcher(object):
14
    """Example usage for the watcher class of Kuon"""
15
16
    @staticmethod
17
    def watcher() -> None:
18
        """Example watcher usage
19
20
        :return:
21
        """
22
        Watcher(adapter=bitskins_adapters.BitSkinsSalesAdapter, log_level=logging.DEBUG).start()
23
24
25
class UsageBitSkins(object):
26
    """Example usages for the implementation of the BitSkins API"""
27
28
    @staticmethod
29
    def sales_adapter() -> None:
30
        sales_adapter = bitskins_adapters.BitSkinsSalesAdapter()
31
        pprint(sales_adapter.search("m4 howl min"))
32
33
    @staticmethod
34
    def sales_interface() -> None:
35
        """Example sales interface usage
36
37
        :return:
38
        """
39
        sales_interface = bitskins_interfaces.ISales()
40
41
        pprint(sales_interface.get_sales_info(market_hash_name="M4A4 | Howl (Factory New)"))
42
43
    @staticmethod
44
    def pricing_interface() -> None:
45
        """Example pricing interface usage
46
47
        :return:
48
        """
49
        pricing_interface = bitskins_interfaces.IPricing()
50
        pprint(pricing_interface.get_all_item_prices())
51
        pprint(pricing_interface.get_price_data_for_items_on_sale())
52
53
    @staticmethod
54
    def inventory_interface() -> None:
55
        """Example pricing interface usage
56
57
        :return:
58
        """
59
        inventory_interface = bitskins_interfaces.IInventory()
60
        pprint(inventory_interface.get_my_inventory())
61
62
63
if __name__ == '__main__':
64
    UsageWatcher().watcher()
65