# Path: lib/baseClass.py
# class AbstractClass(object):
#     """
#     Generic parent class for all class
#     """
#     __metaclass__ = ABCMeta
# 
#     @classmethod
#     def get_config(cls):
#         return {}
# 
#     """
#     __init__ params'name must be the same with config
#     """
#     @classmethod
#     def get_instance(cls):
#         config = cls.get_config()
#         instance = cls(**config)
#         return instance
# 
#     @classmethod
#     @abstractmethod
#     def is_available(cls):
#         return true
# 
#     def __init__(self, **kwargs):
#         self._logger = lib.util.init_logger(__name__)


import sys,os,time
import logging
import yaml
import RPi.GPIO as GPIO
import lib.appPath
from lib.baseClass import AbstractClass
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# look this: http://www.toptechboy.com/raspberry-pi/raspberry-pi-lesson-28-controlling-a-servo-on-raspberry-pi-with-python/



class Servo(AbstractClass):

    @classmethod
    def is_available(cls):
        return (super(cls, cls).is_available() and
                lib.diagnose.check_python_import('RPi.GPIO'))

    @classmethod
    def get_config(cls):
        config = {}

# Path: lib/baseClass.py
# class AbstractClass(object):
#     """
#     Generic parent class for all class
#     """
#     __metaclass__ = ABCMeta
# 
#     @classmethod
#     def get_config(cls):
#         return {}
# 
#     """
#     __init__ params'name must be the same with config
#     """
#     @classmethod
#     def get_instance(cls):
#         config = cls.get_config()
#         instance = cls(**config)
#         return instance
# 
#     @classmethod
#     @abstractmethod
#     def is_available(cls):
#         return true
# 
#     def __init__(self, **kwargs):
#         self._logger = lib.util.init_logger(__name__)


# Path: lib/gpio/servo.py
import sys,os,time
import logging
import yaml
import RPi.GPIO as GPIO
import lib.appPath
from lib.baseClass import AbstractClass

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# look this: http://www.toptechboy.com/raspberry-pi/raspberry-pi-lesson-28-controlling-a-servo-on-raspberry-pi-with-python/



class Servo(AbstractClass):

    @classmethod
    def is_available(cls):
        return (super(cls, cls).is_available() and
                lib.diagnose.check_python_import('RPi.GPIO'))

    @classmethod
    def get_config(cls):
        config = {}

        config_path = os.path.join(lib.appPath.CONFIG_PATH, 'gpio.yml');