<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Techies' Stasis Trap

:copyright: (c) 2014 <NAME> (Leo)
:license: The MIT License (MIT), see LICENSE for details.
"""

from logging import Handler, NOTSET

_ref_atributes = [
    '%(levelname)s',
    '%(name)s',
    '%(pathname)s',
    '%(module)s',
    '%(funcName)s',
    '%(lineno)d',
    '%(message)s'
]

'''
Reference log format, best used with UniQueue or CountQueue
'''
REF_LOG_FORMAT = ':'.join(_ref_atributes)


class QueueHandler(Handler):

    '''
    Queue Logging Handler

    Inherits standard logging.Handler that emits to any standard Queue
    compatible implementations. Including the ones in techies.landmines module
    '''

    def __init__(self, q, level=NOTSET):
        super(QueueHandler, self).__init__(level)
        self.q = q
<commit_msg>fix the problem caused by old style class logging.Handler in python 2.6.x<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Techies' Stasis Trap

:copyright: (c) 2014 <NAME> (Leo)
:license: The MIT License (MIT), see LICENSE for details.
"""

import sys
from logging import Handler, NOTSET

_ref_atributes = [
    '%(levelname)s',
    '%(name)s',
    '%(pathname)s',
    '%(module)s',
    '%(funcName)s',
    '%(lineno)d',
    '%(message)s'
]

'''
Reference log format, best used with UniQueue or CountQueue
'''
REF_LOG_FORMAT = ':'.join(_ref_atributes)


class QueueHandler(Handler):

    '''
    Queue Logging Handler

    Inherits standard logging.Handler that emits to any standard Queue
    compatible implementations. Including the ones in techies.landmines module
    '''

    def __init__(self, q, level=NOTSET):
        if sys.version_info[:2] > (2, 6):
            super(QueueHandler, self).__init__(level)
        else:
            Handler.__init__(level)

        self.q = q

{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.008178844056706653, 'mean_word_length': 3.33806146572104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3180532', 'n_tokens_mistral': 636, 'n_tokens_neox': 599, 'n_words': 169}