Beispiel #1
0
    def __init__(self, propagate=1, override=None, excepts=False):
        """
        Constructor.
        
        :param propagate: If this evaluates to false, logging messages are not 
                          passed by this logger or by child loggers to higher 
                          level (ancestor) loggers.
        :type propagate: boolean
        
        :param override: Overrides the default log level for the intern logger.
        :type override: NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL
        """

        Validator.__init__(self)

        self.check_regex = re.compile(constants.CHECK_REGEX)
        self.handler_regex = re.compile(constants.HANDLER_REGEX)

        self.default_profile = False
        self.main = None
        self.errors = 0
        self.excepts = excepts

        self.valid_checks = []
        self.valid_handlers = []

        self.logger = LoggerFactory().create(self.__module__, propagate,
                                             override)

        self.check_manager = CheckManager()
        self.handler_manager = HandlerManager()
Beispiel #2
0
    def __init__(self, hook, repository_path):
        """
        Constructor.
        
        :param hook: The hook that has to be executed. Valid values are 
                     constants.PRECOMMIT or constants.POSTCOMMIT.
        :type hook: constants.PRECOMMIT, constants.POSTCOMMIT.
        :param repository_path: The path to the current repository.
        :type repository_path: string
        """

        self.hook = hook
        self.repository_path = repository_path

        self.checks = CheckManager()
        self.handlers = HandlerManager()
        self.result = constants.SUCCESS
        self.main = None
        self.transaction = None

        self.logger = LoggerFactory().create(self.__module__)
Beispiel #3
0
 def setup_class(cls):
     cls._cache = CheckManager()
     cls._buildin_check_names = [
         "PyLint", "Mantis", "AccessRights", "ASCIIEncoded", "CaseInsensitiveFilenameClash", 
         "Checkout", "Checkstyle", "Keywords", "Log", "RejectTabs", "UnitTests", "XMLValidator"]
     cls._init_pkg_resources_mocks(cls._buildin_check_names)