# Path: mcomix/log.py
# def print_(*args, **options):
#     def print_generic(text):
#     def print_win32(text):
#     def __init__(self):
#     def emit(self, record):
#         INVALID_HANDLE_VALUE, STD_OUTPUT_HANDLE = -1, -11
# class PrintHandler(logging.Handler):


import os
import zipfile
import threading
from mcomix import log
        self._pack_thread.setDaemon(False)
        self._pack_thread.start()

    def wait(self):
        """Block until the packer thread has finished. Return True if the
        packer finished its work successfully.
        """
        if self._pack_thread != None:
            self._pack_thread.join()

        return self._packing_successful

    def _thread_pack(self):
        try:
            zfile = zipfile.ZipFile(self._archive_path, 'w')
        except Exception:
            log.error(_('! Could not create archive at path "%s"'),
                      self._archive_path)
            return

        used_names = []
        pattern = '%%0%dd - %s%%s' % (len(str(len(self._image_files))),
            self._base_name)

        for i, path in enumerate(self._image_files):
            filename = pattern % (i + 1, os.path.splitext(path)[1])

            try:
                zfile.write(path, filename, zipfile.ZIP_STORED)
            except Exception:

# Path: mcomix/log.py
# def print_(*args, **options):
#     def print_generic(text):
#     def print_win32(text):
#     def __init__(self):
#     def emit(self, record):
#         INVALID_HANDLE_VALUE, STD_OUTPUT_HANDLE = -1, -11
# class PrintHandler(logging.Handler):


# Path: mcomix/archive_packer.py
import os
import zipfile
import threading
from mcomix import log

        self._pack_thread.setDaemon(False)
        self._pack_thread.start()

    def wait(self):
        """Block until the packer thread has finished. Return True if the
        packer finished its work successfully.
        """
        if self._pack_thread != None:
            self._pack_thread.join()

        return self._packing_successful

    def _thread_pack(self):
        try:
            zfile = zipfile.ZipFile(self._archive_path, 'w')
        except Exception:
            log.error(_('! Could not create archive at path "%s"'),
                      self._archive_path)
            return

        used_names = []
        pattern = '%%0%dd - %s%%s' % (len(str(len(self._image_files))),
            self._base_name)

        for i, path in enumerate(self._image_files):
            filename = pattern % (i + 1, os.path.splitext(path)[1])

            try:
                zfile.write(path, filename, zipfile.ZIP_STORED)
            except Exception:

                log.error(_('! Could not add file %(sourcefile)s '