# Path: common/utils.py
# def read_file(filename):
# def write_file(filename, text):
# def save_obj(filename, data):
# def load_obj(filename):
# def sha1(filename):
# def write_sha1(sha1, filename):
# def url_opener():
# def copy_file_from_url(url, out_file, expect_sha1 = None, max_retry = 4):
# def compress_file_data(out_filename, data, compress_type):
# def compress_file(out_filename, in_filename, compress_type):
# def uncompress_file(filename, compress_type):
# def _retry_on_eintr(func, *args):
# def safe_read(fd):
# def safe_write(fd, text):
# def print_traceback(*kwargs):
# def readline_backward(filename, buf_size=8192):
# 
# Path: common/common_html.py
# def get_head(title, css = None, html5 = False):
# 
# Path: spell/spell.py
# class Speller:
#     def __init__(self, lang):
#     def check(self, word):
#     def suggest(self, word):


import re
import sys
import pywikibot
import pywikibot.pagegenerators as pagegen
import os
import collections
import xml.etree.ElementTree as etree
import hashlib
from pywikibot.data import api
from common import utils
from common import common_html
from spell import spell

    def locate_all_html(self, word):
        for variant in self.variants:
            cache  = self.load_dicts(variant)
            for p in self.get_local_dict_list(variant):
                text = self.load_text(p, variant)

                regex_split = re.compile(u'([' + self.word_chars + u']+)')
                words_list = regex_split.findall(text)

                if p.latestRevision() in cache and word in cache[p.latestRevision()][1]:
                    continue

                local_dict = { word : u'repl' }
                i = 0
                while True:
                    if i >= len(words_list):
                        break
                    repl, glb, new_words, num = self.find_repl(words_list, i,
                                                               local_dict,
                                                               {})

                    if repl:
                        print p.title().encode('utf-8')
                        break
                    else:
                        i += 1

            # No need to iterate over all variant as the html does not depend
            # on the variant.

# Path: common/utils.py
# def read_file(filename):
# def write_file(filename, text):
# def save_obj(filename, data):
# def load_obj(filename):
# def sha1(filename):
# def write_sha1(sha1, filename):
# def url_opener():
# def copy_file_from_url(url, out_file, expect_sha1 = None, max_retry = 4):
# def compress_file_data(out_filename, data, compress_type):
# def compress_file(out_filename, in_filename, compress_type):
# def uncompress_file(filename, compress_type):
# def _retry_on_eintr(func, *args):
# def safe_read(fd):
# def safe_write(fd, text):
# def print_traceback(*kwargs):
# def readline_backward(filename, buf_size=8192):
# 
# Path: common/common_html.py
# def get_head(title, css = None, html5 = False):
# 
# Path: spell/spell.py
# class Speller:
#     def __init__(self, lang):
#     def check(self, word):
#     def suggest(self, word):


# Path: modernization/modernization.py
import re
import sys
import pywikibot
import pywikibot.pagegenerators as pagegen
import os
import collections
import xml.etree.ElementTree as etree
import hashlib
from pywikibot.data import api
from common import utils
from common import common_html
from spell import spell


    def locate_all_html(self, word):
        for variant in self.variants:
            cache  = self.load_dicts(variant)
            for p in self.get_local_dict_list(variant):
                text = self.load_text(p, variant)

                regex_split = re.compile(u'([' + self.word_chars + u']+)')
                words_list = regex_split.findall(text)

                if p.latestRevision() in cache and word in cache[p.latestRevision()][1]:
                    continue

                local_dict = { word : u'repl' }
                i = 0
                while True:
                    if i >= len(words_list):
                        break
                    repl, glb, new_words, num = self.find_repl(words_list, i,
                                                               local_dict,
                                                               {})

                    if repl:
                        print p.title().encode('utf-8')
                        break
                    else:
                        i += 1

            # No need to iterate over all variant as the html does not depend
            # on the variant.

            break