# Path: lib/SubscriberInterface.py
# class Subscriber(object):
#   __metaclass__ = ABCMeta
#   
#   def __init__(self,  device_name, device_id, host):
#     """
#     
#     :return:
#     """
#     self.device_name = device_name
#     self.device_id = device_id
#     self.host = host
# 
#   @abstractmethod
#   def consume_messages(self, callback):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
#   @abstractmethod
#   def connect(self):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
#     
#   @abstractmethod
#   def disconnect(self):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
# 
# Path: lib/constants.py
# class colors:
#     ENDC = '\033[0m'
#     UNDERLINE = '\033[4m'
#     BLINK = '\033[5m'
# 
#     HEADER = '\033[95m'
#     OKBLUE = '\033[94m'
#     OKGREEN = '\033[92m'
#     FAIL = '\033[91m'
# 
#     BG_RASPBERRY = '\033[46m'
# 
#     DARK_RED = '\033[0;31m'
#     RED = '\033[91m'
#     ORANGE = '\033[1m'
#     YELLOW = '\033[93m'
#     GREEN = '\033[92m'
#     DARK_GREEN = '\033[0;32m'
#     CYAN = '\033[96m'
#     MAGENTA = '\033[0;35m'
#     RASPBERRY = '\033[0;36m'
#     DARK_PURPLE = '\033[0;34m'
# 
#     GOLD = '\033[0;33m'
#     SILVER = '\033[0;37m'
#     GRAY = '\033[90m'
# 
#     BOLD_RED = '\033[1;31m'
#     BOLD_ORANGE = '\033[1m'
#     BOLD_YELLOW = '\033[1;33m'
#     BOLD_GREEN = '\033[1;32m'
#     BOLD_CYAN = '\033[1;36m'
#     BOLD_BLUE  = '\033[1;34m'
#     BOLD_PURPLE = '\033[1;35m'
#     BOLD_GRAY  = '\033[1;30m'
# 
#     CYCLE = [YELLOW, GREEN, ORANGE,  RASPBERRY, DARK_RED, CYAN, RED, DARK_GREEN, MAGENTA, DARK_PURPLE]


import pika
from lib.SubscriberInterface import Subscriber
from lib.constants import colors

class PikaSubscriber(Subscriber):

  def __init__(self, device_name, device_id, rabbitmq_address, metrics):
    super(PikaSubscriber, self).__init__(device_name, device_id, rabbitmq_address)
    self.connection = None
    self.channel = None
    self.queues = {}

# Path: lib/SubscriberInterface.py
# class Subscriber(object):
#   __metaclass__ = ABCMeta
#   
#   def __init__(self,  device_name, device_id, host):
#     """
#     
#     :return:
#     """
#     self.device_name = device_name
#     self.device_id = device_id
#     self.host = host
# 
#   @abstractmethod
#   def consume_messages(self, callback):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
#   @abstractmethod
#   def connect(self):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
#     
#   @abstractmethod
#   def disconnect(self):
#     #TODO: write doc
#     """
#     
#     :return:
#     """
# 
# Path: lib/constants.py
# class colors:
#     ENDC = '\033[0m'
#     UNDERLINE = '\033[4m'
#     BLINK = '\033[5m'
# 
#     HEADER = '\033[95m'
#     OKBLUE = '\033[94m'
#     OKGREEN = '\033[92m'
#     FAIL = '\033[91m'
# 
#     BG_RASPBERRY = '\033[46m'
# 
#     DARK_RED = '\033[0;31m'
#     RED = '\033[91m'
#     ORANGE = '\033[1m'
#     YELLOW = '\033[93m'
#     GREEN = '\033[92m'
#     DARK_GREEN = '\033[0;32m'
#     CYAN = '\033[96m'
#     MAGENTA = '\033[0;35m'
#     RASPBERRY = '\033[0;36m'
#     DARK_PURPLE = '\033[0;34m'
# 
#     GOLD = '\033[0;33m'
#     SILVER = '\033[0;37m'
#     GRAY = '\033[90m'
# 
#     BOLD_RED = '\033[1;31m'
#     BOLD_ORANGE = '\033[1m'
#     BOLD_YELLOW = '\033[1;33m'
#     BOLD_GREEN = '\033[1;32m'
#     BOLD_CYAN = '\033[1;36m'
#     BOLD_BLUE  = '\033[1;34m'
#     BOLD_PURPLE = '\033[1;35m'
#     BOLD_GRAY  = '\033[1;30m'
# 
#     CYCLE = [YELLOW, GREEN, ORANGE,  RASPBERRY, DARK_RED, CYAN, RED, DARK_GREEN, MAGENTA, DARK_PURPLE]


# Path: lib/PikaSubscriber.py
import pika
from lib.SubscriberInterface import Subscriber
from lib.constants import colors


class PikaSubscriber(Subscriber):

  def __init__(self, device_name, device_id, rabbitmq_address, metrics):
    super(PikaSubscriber, self).__init__(device_name, device_id, rabbitmq_address)
    self.connection = None
    self.channel = None
    self.queues = {}

    self.metrics = metrics