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