<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module allows you to monitorize the file system looking for changes
and fires actions based on user handlers that are attached to the flow core.

There are two threads involved, main thread process event queue and the
second monitorize FS for changes.

Example:
        $ flowmonitor.py pelican . pelican ~/Documents/blog

TODO:
    * Be ready for huge changes (e.g. swaping git branches)

"""
import sys
import random
import os
import re
import time
import datetime
import logging
import sqlite3
import threading
from collections import namedtuple
from logging import info as loginfo

from watchdog.observers import Observer
from watchdog.events import FileMovedEvent, \
     FileSystemEventHandler, LoggingEventHandler
# from cjson import encode, decode

# from queuelib import FifoDiskQueue, PriorityQueue
# qfactory = lambda priority: FifoDiskQueue('/tmp/queue-dir-%s' % priority)<commit_msg>pylint cosmetic changes<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module allows you to monitorize the file system looking for changes
and fires actions based on user handlers that are attached to the flow core.

There are two threads involved, main thread process event queue and the
second monitorize FS for changes.

Example:
        $ flowmonitor.py pelican . pelican ~/Documents/blog

TODO:
    * Be ready for huge changes (e.g. swaping git branches)

"""
import sys
import random
import os
import re
import time
import datetime
import sqlite3
import threading
import logging
from logging import info as loginfo
from collections import namedtuple
from watchdog.observers import Observer
from watchdog.events import FileMovedEvent, \
     FileSystemEventHandler, LoggingEventHandler
# from cjson import encode, decode

# from queuelib import FifoDiskQueue, PriorityQueue
# qfactory = lambda priority: FifoDiskQueue('/tmp/queue-dir-%s' % priority)
{'fraction_non_alphanumeric': 0.06285419886656363, 'fraction_numerical': 0.0020607934054611026, 'mean_word_length': 4.548571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7340598', 'n_tokens_mistral': 516, 'n_tokens_neox': 508, 'n_words': 233}