usage.UsageBitSkins.sales_adapter()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nop 0
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