# 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=cmdline_files):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg):
# 
# Path: pyanaconda/iutil.py
# def augmentEnv():
# def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None, log_output=True, binary_output=False):
#     def chroot():
# def setSysroot(path):
# def getSysroot():
# def execInSysimageRoot(command, argv, **kwargs):
# def execWithRedirect(command, argv, stdin=None, stdout=None,
#                      stderr=None, root='/', env_prune=[], log_output=True, binary_output=False):
# def execWithCapture(command, argv, stdin=None, stderr=None, root='/',
#                     fatal=False, log_output=True):
# def execReadlines(command, argv, stdin=None, root='/', env_prune=None):
#     def queue_lines(out, queue):
#     def chroot():
# def execConsole():
# def getDirSize(dir):
#     def getSubdirSize(dir):
# def mkdirChain(dir):
# def get_active_console(dev="console"):
# def isConsoleOnVirtualTerminal(dev="console"):
# def strip_markup(text):
# def reIPL(ipldev):
# def resetRpmDb():
# def parseNfsUrl(nfsurl):
# def add_po_path(module, dir):
# def setup_translations(module):
# def fork_orphan():
# def _run_systemctl(command, service):
# def start_service(service):
# def stop_service(service):
# def restart_service(service):
# def service_running(service):
# def dracut_eject(device):
# def vtActivate(num):
#     def __init__(self, url=None, protocol="http://", host=None, port="3128",
#                  username=None, password=None):
#     def parse_url(self):
#     def parse_components(self):
#     def dict(self):
#     def __str__(self):
# def getdeepattr(obj, name):
# def setdeepattr(obj, name, value):
# def strip_accents(s):
# def cmp_obj_attrs(obj1, obj2, attr_list):
# def dir_tree_map(root, func, files=True, dirs=True):
# def chown_dir_tree(root, uid, gid, from_uid_only=None, from_gid_only=None):
#     def conditional_chown(path, uid, gid, from_uid=None, from_gid=None):
# def is_unsupported_hw():
# def upcase_first_letter(text):
#     def __init__(self, **kwargs):
#     def __getattr__(self, attr):
#     def __setattr__(self, attr, value):
#     def copy(self):
# def get_mount_paths(devnode):
# class ProxyStringError(Exception):
# class ProxyString(object):
# class DataHolder(dict):
# 
# Path: pyanaconda/progress.py
# def progress_report(message):


import shutil
import logging
from . import *
from pyanaconda.constants import *
from pyanaconda.flags import flags
from pyanaconda import iutil
from pyanaconda.i18n import _
from pyanaconda.progress import progressQ
from gi.repository import GLib
from gi.repository import Gio
from blivet.size import Size
from pyanaconda.errors import *
        from gi.repository import OSTree
                percent = (fetched*1.0 / requested) * 100
            
            progressQ.send_message("Receiving objects: %d%% (%d/%d) %s" % (percent, fetched, requested, formatted_bytes))
        else:
            progressQ.send_message("Writing objects")

    def install(self):
        cancellable = None
        ostreesetup = self.data.ostreesetup
        log.info("executing ostreesetup=%r" % (ostreesetup, ))

        # Initialize the filesystem - this will create the repo as well
        self._safeExecWithRedirect("ostree", ["admin", "--sysroot=" + ROOT_PATH,
                                              "init-fs", ROOT_PATH])

        repo_arg = "--repo=" + ROOT_PATH + '/ostree/repo'

        # Set up the chosen remote
        remote_args = [repo_arg, "remote", "add"]
        if ostreesetup.noGpg:
            remote_args.append("--set=gpg-verify=false")
        remote_args.extend([ostreesetup.remote,
                            ostreesetup.url])
        self._safeExecWithRedirect("ostree", remote_args)

        sysroot_path = Gio.File.new_for_path(ROOT_PATH)
        sysroot = OSTree.Sysroot.new(sysroot_path)
        sysroot.load(cancellable)

        repo = sysroot.get_repo(None)[1]

# 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=cmdline_files):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg):
# 
# Path: pyanaconda/iutil.py
# def augmentEnv():
# def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None, log_output=True, binary_output=False):
#     def chroot():
# def setSysroot(path):
# def getSysroot():
# def execInSysimageRoot(command, argv, **kwargs):
# def execWithRedirect(command, argv, stdin=None, stdout=None,
#                      stderr=None, root='/', env_prune=[], log_output=True, binary_output=False):
# def execWithCapture(command, argv, stdin=None, stderr=None, root='/',
#                     fatal=False, log_output=True):
# def execReadlines(command, argv, stdin=None, root='/', env_prune=None):
#     def queue_lines(out, queue):
#     def chroot():
# def execConsole():
# def getDirSize(dir):
#     def getSubdirSize(dir):
# def mkdirChain(dir):
# def get_active_console(dev="console"):
# def isConsoleOnVirtualTerminal(dev="console"):
# def strip_markup(text):
# def reIPL(ipldev):
# def resetRpmDb():
# def parseNfsUrl(nfsurl):
# def add_po_path(module, dir):
# def setup_translations(module):
# def fork_orphan():
# def _run_systemctl(command, service):
# def start_service(service):
# def stop_service(service):
# def restart_service(service):
# def service_running(service):
# def dracut_eject(device):
# def vtActivate(num):
#     def __init__(self, url=None, protocol="http://", host=None, port="3128",
#                  username=None, password=None):
#     def parse_url(self):
#     def parse_components(self):
#     def dict(self):
#     def __str__(self):
# def getdeepattr(obj, name):
# def setdeepattr(obj, name, value):
# def strip_accents(s):
# def cmp_obj_attrs(obj1, obj2, attr_list):
# def dir_tree_map(root, func, files=True, dirs=True):
# def chown_dir_tree(root, uid, gid, from_uid_only=None, from_gid_only=None):
#     def conditional_chown(path, uid, gid, from_uid=None, from_gid=None):
# def is_unsupported_hw():
# def upcase_first_letter(text):
#     def __init__(self, **kwargs):
#     def __getattr__(self, attr):
#     def __setattr__(self, attr, value):
#     def copy(self):
# def get_mount_paths(devnode):
# class ProxyStringError(Exception):
# class ProxyString(object):
# class DataHolder(dict):
# 
# Path: pyanaconda/progress.py
# def progress_report(message):


# Path: pyanaconda/packaging/ostreepayload.py
import shutil
import logging
from . import *
from pyanaconda.constants import *
from pyanaconda.flags import flags
from pyanaconda import iutil
from pyanaconda.i18n import _
from pyanaconda.progress import progressQ
from gi.repository import GLib
from gi.repository import Gio
from blivet.size import Size
from pyanaconda.errors import *
        from gi.repository import OSTree

                percent = (fetched*1.0 / requested) * 100
            
            progressQ.send_message("Receiving objects: %d%% (%d/%d) %s" % (percent, fetched, requested, formatted_bytes))
        else:
            progressQ.send_message("Writing objects")

    def install(self):
        cancellable = None
        ostreesetup = self.data.ostreesetup
        log.info("executing ostreesetup=%r" % (ostreesetup, ))

        # Initialize the filesystem - this will create the repo as well
        self._safeExecWithRedirect("ostree", ["admin", "--sysroot=" + ROOT_PATH,
                                              "init-fs", ROOT_PATH])

        repo_arg = "--repo=" + ROOT_PATH + '/ostree/repo'

        # Set up the chosen remote
        remote_args = [repo_arg, "remote", "add"]
        if ostreesetup.noGpg:
            remote_args.append("--set=gpg-verify=false")
        remote_args.extend([ostreesetup.remote,
                            ostreesetup.url])
        self._safeExecWithRedirect("ostree", remote_args)

        sysroot_path = Gio.File.new_for_path(ROOT_PATH)
        sysroot = OSTree.Sysroot.new(sysroot_path)
        sysroot.load(cancellable)

        repo = sysroot.get_repo(None)[1]

        progressQ.send_message(_("Starting pull of %s from %s") % (ostreesetup.ref, ostreesetup.remote))