# Path: pyanaconda/flags.py
# class Flags(object):
# class BootArgs(OrderedDict):
#     def __setattr__(self, attr, val):
#     def get(self, attr, val=None):
#     def set_cmdline_bool(self, flag):
#     def __init__(self, read_cmdline=True):
#     def read_cmdline(self):
#     def __init__(self, cmdline=None, files=None):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg, touch_live=False):
# 
# Path: pyanaconda/constants.py
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# 
# ROOT_PATH = "/mnt/sysimage"
# 
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# 
# UNSUPPORTED_HW = 1 << 28
# 
# Path: pyanaconda/anaconda_log.py
# DEFAULT_TTY_LEVEL = logging.INFO
# ENTRY_FORMAT = "%(asctime)s,%(msecs)03d %(levelname)s %(name)s: %(message)s"
# TTY_FORMAT = "%(levelname)s %(name)s: %(message)s"
# STDOUT_FORMAT = "%(asctime)s %(message)s"
# DATE_FORMAT = "%H:%M:%S"
# MAIN_LOG_FILE = "/tmp/anaconda.log"
# MAIN_LOG_TTY = "/dev/tty3"
# PROGRAM_LOG_FILE = "/tmp/program.log"
# PROGRAM_LOG_TTY = "/dev/tty5"
# STORAGE_LOG_FILE = "/tmp/storage.log"
# PACKAGING_LOG_FILE = "/tmp/packaging.log"
# SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
# ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
#     SYSLOG_CFGFILE  = "/etc/rsyslog.conf"
#     VIRTIO_PORT = "/dev/virtio-ports/org.fedoraproject.anaconda.log.0"
#         TEMPLATE = "*.* @@%s\n"
#         TEMPLATE = "*.* %s;anaconda_syslog\n"
# def autoSetLevel(handler, value):
# def setHandlersLevel(logr, level):
#     def __init__(self,
#                  address=('localhost', SYSLOG_UDP_PORT),
#                  facility=SysLogHandler.LOG_USER,
#                  tag=''):
#     def emit(self, record):
#     def __init__ (self):
#     def addFileHandler (self, dest, addToLogger, minLevel=DEFAULT_TTY_LEVEL,
#                         fmtStr=ENTRY_FORMAT,
#                         autoLevel=False):
#     def forwardToSyslog(self, logr):
#     def showwarning(self, message, category, filename, lineno,
#                       file=sys.stderr, line=None):
#     def restartSyslog(self):
#     def updateRemote(self, remote_syslog):
#     def setupVirtio(self):
# def init():
# class AnacondaSyslogHandler(SysLogHandler):
# class AnacondaLog:


import glob
import os
import stat
import os.path
import errno
import subprocess
import unicodedata
import string
import types
import logging
from threading import Thread
from Queue import Queue, Empty
from pyanaconda.flags import flags
from pyanaconda.constants import DRACUT_SHUTDOWN_EJECT, ROOT_PATH, TRANSLATIONS_UPDATE_DIR, UNSUPPORTED_HW
from pyanaconda.regexes import PROXY_URL_PARSE
from pyanaconda.anaconda_log import program_log_lock

    return (proc.returncode, out)

def execWithRedirect(command, argv, stdin=None, stdout=None,
                     root='/', env_prune=None):
    """ Run an external program and redirect the output to a file.
        @param command The command to run
        @param argv The argument list
        @param stdin The file object to read stdin from.
        @param stdout Optional file object to redirect stdout and stderr to.
        @param root The directory to chroot to before running command.
        @param env_prune environment variable to remove before execution
        @return The return code of the command
    """
    if flags.testing:
        log.info("not running command because we're testing: %s %s",
                 command, " ".join(argv))
        return 0

    argv = [command] + argv
    return _run_program(argv, stdin=stdin, stdout=stdout, root=root, env_prune=env_prune)[0]

def execWithCapture(command, argv, stdin=None, root='/'):
    """ Run an external program and capture standard out and err.
        @param command The command to run
        @param argv The argument list
        @param stdin The file object to read stdin from.
        @param root The directory to chroot to before running command.
        @return The output of the command
    """

# Path: pyanaconda/flags.py
# class Flags(object):
# class BootArgs(OrderedDict):
#     def __setattr__(self, attr, val):
#     def get(self, attr, val=None):
#     def set_cmdline_bool(self, flag):
#     def __init__(self, read_cmdline=True):
#     def read_cmdline(self):
#     def __init__(self, cmdline=None, files=None):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg, touch_live=False):
# 
# Path: pyanaconda/constants.py
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# 
# ROOT_PATH = "/mnt/sysimage"
# 
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# 
# UNSUPPORTED_HW = 1 << 28
# 
# Path: pyanaconda/anaconda_log.py
# DEFAULT_TTY_LEVEL = logging.INFO
# ENTRY_FORMAT = "%(asctime)s,%(msecs)03d %(levelname)s %(name)s: %(message)s"
# TTY_FORMAT = "%(levelname)s %(name)s: %(message)s"
# STDOUT_FORMAT = "%(asctime)s %(message)s"
# DATE_FORMAT = "%H:%M:%S"
# MAIN_LOG_FILE = "/tmp/anaconda.log"
# MAIN_LOG_TTY = "/dev/tty3"
# PROGRAM_LOG_FILE = "/tmp/program.log"
# PROGRAM_LOG_TTY = "/dev/tty5"
# STORAGE_LOG_FILE = "/tmp/storage.log"
# PACKAGING_LOG_FILE = "/tmp/packaging.log"
# SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
# ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
#     SYSLOG_CFGFILE  = "/etc/rsyslog.conf"
#     VIRTIO_PORT = "/dev/virtio-ports/org.fedoraproject.anaconda.log.0"
#         TEMPLATE = "*.* @@%s\n"
#         TEMPLATE = "*.* %s;anaconda_syslog\n"
# def autoSetLevel(handler, value):
# def setHandlersLevel(logr, level):
#     def __init__(self,
#                  address=('localhost', SYSLOG_UDP_PORT),
#                  facility=SysLogHandler.LOG_USER,
#                  tag=''):
#     def emit(self, record):
#     def __init__ (self):
#     def addFileHandler (self, dest, addToLogger, minLevel=DEFAULT_TTY_LEVEL,
#                         fmtStr=ENTRY_FORMAT,
#                         autoLevel=False):
#     def forwardToSyslog(self, logr):
#     def showwarning(self, message, category, filename, lineno,
#                       file=sys.stderr, line=None):
#     def restartSyslog(self):
#     def updateRemote(self, remote_syslog):
#     def setupVirtio(self):
# def init():
# class AnacondaSyslogHandler(SysLogHandler):
# class AnacondaLog:


# Path: pyanaconda/iutil.py
import glob
import os
import stat
import os.path
import errno
import subprocess
import unicodedata
import string
import types
import logging
from threading import Thread
from Queue import Queue, Empty
from pyanaconda.flags import flags
from pyanaconda.constants import DRACUT_SHUTDOWN_EJECT, ROOT_PATH, TRANSLATIONS_UPDATE_DIR, UNSUPPORTED_HW
from pyanaconda.regexes import PROXY_URL_PARSE
from pyanaconda.anaconda_log import program_log_lock


    return (proc.returncode, out)

def execWithRedirect(command, argv, stdin=None, stdout=None,
                     root='/', env_prune=None):
    """ Run an external program and redirect the output to a file.
        @param command The command to run
        @param argv The argument list
        @param stdin The file object to read stdin from.
        @param stdout Optional file object to redirect stdout and stderr to.
        @param root The directory to chroot to before running command.
        @param env_prune environment variable to remove before execution
        @return The return code of the command
    """
    if flags.testing:
        log.info("not running command because we're testing: %s %s",
                 command, " ".join(argv))
        return 0

    argv = [command] + argv
    return _run_program(argv, stdin=stdin, stdout=stdout, root=root, env_prune=env_prune)[0]

def execWithCapture(command, argv, stdin=None, root='/'):
    """ Run an external program and capture standard out and err.
        @param command The command to run
        @param argv The argument list
        @param stdin The file object to read stdin from.
        @param root The directory to chroot to before running command.
        @return The output of the command
    """

    if flags.testing: