# Path: alienfx/core/prober.py
# class AlienFXProber(object):
#     
#     """ Provides facilities for probing the USB bus for supported Alien FX
#     controllers.
#     """
#         
#     @staticmethod
#     def get_controller():
#         """ Go through the supported_controllers list in AlienFXController
#         and see if any of them exist on the USB bus, Return the first one
#         found, or None if none are found.
#         """
#         for controller in AlienFXController.supported_controllers:
#             vid = controller.vendor_id
#             pid = controller.product_id
#             dev = usb.core.find(idVendor=vid, idProduct=pid)
#             if dev is not None:
#                 return controller
#         return None
# 
#     @staticmethod
#     def find_controllers(vendor):
#         """Go through the usb-bus and find devices(and most likely controllers) by vendor-id"""
#         vid = int(vendor, 16)  # Convert our given Vendor-HEX-String to an equivalent intenger
# 
#         devs = usb.core.find(find_all=1)  # All USB devices
#         devices = []  # List of found AFX-Controllers
#         for dev in devs:
#             if dev is not None:
#                 if dev.idVendor is not None:
#                     if dev.idVendor == vid:
#                         devices.append(dev)
#         if len(devices):
#             return devices
#         return None


from alienfx.core.prober import AlienFXProber
from builtins import str,hex
import alienfx.core.controller as alienfx_controller
import os
import sys
import logging
        self.blinkcolor=[0xF, 0xF, 0xF]  # In which color should the zones blink while searching?
        self.staticcolor=[0xF, 0xF, 0xF]  # In which color should the zones light, when zone is found?
        self.speed = 200  # Which speed (for loop/blink) should be used?
        # self.slot1command = [2, 8, 1, 0, 0, 0, 0, 0, 0]
        self.zonesfound = {}  # A Dictionary of all zones found

    def askuser(self, question):
        while "Your answer was invalid.":
            # Python 2.x => raw_input / python 3.x => input
            if sys.version_info < (3, 0):
                # Python 2.x
                reply = raw_input((question + ' (y/n): ').lower().strip())
            else:
                # Python 3.x
                reply = input((question + ' (y/n): ').lower().strip())
            if reply.__len__() > 0:
                if reply[0] == 'y':
                    return True
                if reply[0] == 'n':
                    return False

    def askzonename(self):
        question = "Please enter a name for this zone."
        # Python 2.x => raw_input / python 3.x => input
        if sys.version_info < (3, 0):
            # Python 2.x
            reply = raw_input((question + ' : ').lower().strip())
        else:
            # Python 3.x
            reply = input((question + ' : ').lower().strip())

# Path: alienfx/core/prober.py
# class AlienFXProber(object):
#     
#     """ Provides facilities for probing the USB bus for supported Alien FX
#     controllers.
#     """
#         
#     @staticmethod
#     def get_controller():
#         """ Go through the supported_controllers list in AlienFXController
#         and see if any of them exist on the USB bus, Return the first one
#         found, or None if none are found.
#         """
#         for controller in AlienFXController.supported_controllers:
#             vid = controller.vendor_id
#             pid = controller.product_id
#             dev = usb.core.find(idVendor=vid, idProduct=pid)
#             if dev is not None:
#                 return controller
#         return None
# 
#     @staticmethod
#     def find_controllers(vendor):
#         """Go through the usb-bus and find devices(and most likely controllers) by vendor-id"""
#         vid = int(vendor, 16)  # Convert our given Vendor-HEX-String to an equivalent intenger
# 
#         devs = usb.core.find(find_all=1)  # All USB devices
#         devices = []  # List of found AFX-Controllers
#         for dev in devs:
#             if dev is not None:
#                 if dev.idVendor is not None:
#                     if dev.idVendor == vid:
#                         devices.append(dev)
#         if len(devices):
#             return devices
#         return None


# Path: alienfx/core/zonescanner.py
from alienfx.core.prober import AlienFXProber
from builtins import str,hex
import alienfx.core.controller as alienfx_controller
import os
import sys
import logging

        self.blinkcolor=[0xF, 0xF, 0xF]  # In which color should the zones blink while searching?
        self.staticcolor=[0xF, 0xF, 0xF]  # In which color should the zones light, when zone is found?
        self.speed = 200  # Which speed (for loop/blink) should be used?
        # self.slot1command = [2, 8, 1, 0, 0, 0, 0, 0, 0]
        self.zonesfound = {}  # A Dictionary of all zones found

    def askuser(self, question):
        while "Your answer was invalid.":
            # Python 2.x => raw_input / python 3.x => input
            if sys.version_info < (3, 0):
                # Python 2.x
                reply = raw_input((question + ' (y/n): ').lower().strip())
            else:
                # Python 3.x
                reply = input((question + ' (y/n): ').lower().strip())
            if reply.__len__() > 0:
                if reply[0] == 'y':
                    return True
                if reply[0] == 'n':
                    return False

    def askzonename(self):
        question = "Please enter a name for this zone."
        # Python 2.x => raw_input / python 3.x => input
        if sys.version_info < (3, 0):
            # Python 2.x
            reply = raw_input((question + ' : ').lower().strip())
        else:
            # Python 3.x
            reply = input((question + ' : ').lower().strip())

        if reply.__len__() > 0: