# Path: pyqi/core/log.py
# class NullLogger(Logger):
#     """Ignore log messages"""
#     def _debug(self, msg):
#         pass
#     def _info(self, msg):
#         pass
#     def _warn(self, msg):
#         pass
#     def _fatal(self, msg):
#         pass
# 
# Path: pyqi/core/exception.py
# class IncompetentDeveloperError(CommandError):
#     pass
# 
# class InvalidReturnTypeError(IncompetentDeveloperError):
#     pass
# 
# class UnknownParameterError(IncompetentDeveloperError):
#     pass
# 
# class MissingParameterError(CommandError):
#     pass


import sys, traceback
import re
from pyqi.core.log import NullLogger
from pyqi.core.exception import (IncompetentDeveloperError,
                                 InvalidReturnTypeError,
                                 UnknownParameterError,
                                 MissingParameterError)
        return result

    def _validate_kwargs(self, kwargs):
        """Validate input kwargs prior to executing a ``Command``

        This method can be overridden by subclasses. The baseclass defines only
        a basic validation.
        """
        self_str = str(self.__class__)

        # check required parameters
        for p in self.CommandIns.values():
            if p.Required and p.Name not in kwargs:
                err_msg = 'Missing required CommandIn %s in %s' % (p.Name,
                                                                   self_str)
                self._logger.fatal(err_msg)
                raise MissingParameterError(err_msg)

            if p.Name in kwargs and p.ValidateValue:
                if not p.ValidateValue(kwargs[p.Name]):
                    err_msg = "CommandIn %s cannot take value %s in %s" % \
                                (p.Name, kwargs[p.Name], self_str)
                    self._logger.fatal(err_msg)
                    raise ValueError(err_msg)

        # make sure we only have things we expect
        for opt in kwargs:
            if opt not in self.CommandIns:
                err_msg = 'Unknown CommandIn %s in %s' % (opt, self_str)
                self._logger.fatal(err_msg)

# Path: pyqi/core/log.py
# class NullLogger(Logger):
#     """Ignore log messages"""
#     def _debug(self, msg):
#         pass
#     def _info(self, msg):
#         pass
#     def _warn(self, msg):
#         pass
#     def _fatal(self, msg):
#         pass
# 
# Path: pyqi/core/exception.py
# class IncompetentDeveloperError(CommandError):
#     pass
# 
# class InvalidReturnTypeError(IncompetentDeveloperError):
#     pass
# 
# class UnknownParameterError(IncompetentDeveloperError):
#     pass
# 
# class MissingParameterError(CommandError):
#     pass


# Path: pyqi/core/command.py
import sys, traceback
import re
from pyqi.core.log import NullLogger
from pyqi.core.exception import (IncompetentDeveloperError,
                                 InvalidReturnTypeError,
                                 UnknownParameterError,
                                 MissingParameterError)

        return result

    def _validate_kwargs(self, kwargs):
        """Validate input kwargs prior to executing a ``Command``

        This method can be overridden by subclasses. The baseclass defines only
        a basic validation.
        """
        self_str = str(self.__class__)

        # check required parameters
        for p in self.CommandIns.values():
            if p.Required and p.Name not in kwargs:
                err_msg = 'Missing required CommandIn %s in %s' % (p.Name,
                                                                   self_str)
                self._logger.fatal(err_msg)
                raise MissingParameterError(err_msg)

            if p.Name in kwargs and p.ValidateValue:
                if not p.ValidateValue(kwargs[p.Name]):
                    err_msg = "CommandIn %s cannot take value %s in %s" % \
                                (p.Name, kwargs[p.Name], self_str)
                    self._logger.fatal(err_msg)
                    raise ValueError(err_msg)

        # make sure we only have things we expect
        for opt in kwargs:
            if opt not in self.CommandIns:
                err_msg = 'Unknown CommandIn %s in %s' % (opt, self_str)
                self._logger.fatal(err_msg)

                raise UnknownParameterError(err_msg)