# 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 gc
import subprocess
import sys
from mcomix import log
                self._args.append(arg.encode(sys.getfilesystemencoding()))
            else:
                self._args.append(arg)

        self._proc = None

    def _exec(self):
        """Spawns the process, and returns its stdout.
        (NOTE: separate function to make python2.4 exception syntax happy)
        """
        try:
            # Cannot spawn processes with PythonW/Win32 unless stdin and
            # stderr are redirected to a pipe as well.
            self._proc = subprocess.Popen(self._args, stdout=subprocess.PIPE,
                    stdin=subprocess.PIPE, stderr=subprocess.PIPE,
                    startupinfo=self._startupinfo())
            return self._proc.stdout
        except Exception, ex:
            cmd = len(self._args) > 0 and self._args[0] or "<invalid>"
            log.info((
                _('! Error spawning process "%(command)s": %(error)s.')
                + u' '
                + _('"%(command)s" must be on your system PATH to be found.')) %
                { 'command' : unicode(cmd, errors='replace'),
                  'error' : unicode(str(ex), errors='replace')})
            return None

    def _startupinfo(self):
        """ Creates a STARTUPINFO structure on Windows (to hide spawned
        unextract windows). Does nothing on other platforms. """

# 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/process.py
import gc
import subprocess
import sys
from mcomix import log

                self._args.append(arg.encode(sys.getfilesystemencoding()))
            else:
                self._args.append(arg)

        self._proc = None

    def _exec(self):
        """Spawns the process, and returns its stdout.
        (NOTE: separate function to make python2.4 exception syntax happy)
        """
        try:
            # Cannot spawn processes with PythonW/Win32 unless stdin and
            # stderr are redirected to a pipe as well.
            self._proc = subprocess.Popen(self._args, stdout=subprocess.PIPE,
                    stdin=subprocess.PIPE, stderr=subprocess.PIPE,
                    startupinfo=self._startupinfo())
            return self._proc.stdout
        except Exception, ex:
            cmd = len(self._args) > 0 and self._args[0] or "<invalid>"
            log.info((
                _('! Error spawning process "%(command)s": %(error)s.')
                + u' '
                + _('"%(command)s" must be on your system PATH to be found.')) %
                { 'command' : unicode(cmd, errors='replace'),
                  'error' : unicode(str(ex), errors='replace')})
            return None

    def _startupinfo(self):
        """ Creates a STARTUPINFO structure on Windows (to hide spawned
        unextract windows). Does nothing on other platforms. """

        if sys.platform == 'win32':