# Path: pyanaconda/constants.py
# ROOT_PATH = "/mnt/sysimage"
# 
# RUNLEVELS = {3: 'multi-user.target', 5: 'graphical.target'}
# 
# Path: pyanaconda/iutil.py
# def augmentEnv():
# def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None):
#     def chroot():
# def execWithRedirect(command, argv, stdin=None, stdout=None,
#                      root='/', env_prune=None):
# def execWithCapture(command, argv, stdin=None, root='/'):
# def execReadlines(command, argv, stdin=None, root='/', env_prune=None):
#     def queue_lines(out, queue):
#     def chroot():
# def execConsole():
# def getDirSize(directory):
#     def getSubdirSize(directory):
# def mkdirChain(directory):
# 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, directory):
# 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 _toASCII(s):
# def upperASCII(s):
# def lowerASCII(s):
# def upcase_first_letter(text):
# class ProxyStringError(Exception):
# class ProxyString(object):


import os
import logging
from pyanaconda.constants import ROOT_PATH, RUNLEVELS
from pyanaconda import iutil
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): Matt Wilson <msw@redhat.com>
#            Chris Lumens <clumens@redhat.com>
#


log = logging.getLogger("anaconda")

class Desktop(object):
    def __init__(self):
        self._runlevel = 3
        self.desktop = None

    @property
    def runlevel(self):
        return self._runlevel

    @runlevel.setter
    def runlevel(self, runlevel):
        if int(runlevel) not in RUNLEVELS:
            raise RuntimeError("Desktop::setDefaultRunLevel() - Must specify runlevel as one of %s" % RUNLEVELS.keys())

        self._runlevel = runlevel

    def write(self):
        if self.desktop:
            with open(ROOT_PATH + "/etc/sysconfig/desktop", "w") as f:
                f.write("DESKTOP=%s\n" % self.desktop)


# Path: pyanaconda/constants.py
# ROOT_PATH = "/mnt/sysimage"
# 
# RUNLEVELS = {3: 'multi-user.target', 5: 'graphical.target'}
# 
# Path: pyanaconda/iutil.py
# def augmentEnv():
# def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None):
#     def chroot():
# def execWithRedirect(command, argv, stdin=None, stdout=None,
#                      root='/', env_prune=None):
# def execWithCapture(command, argv, stdin=None, root='/'):
# def execReadlines(command, argv, stdin=None, root='/', env_prune=None):
#     def queue_lines(out, queue):
#     def chroot():
# def execConsole():
# def getDirSize(directory):
#     def getSubdirSize(directory):
# def mkdirChain(directory):
# 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, directory):
# 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 _toASCII(s):
# def upperASCII(s):
# def lowerASCII(s):
# def upcase_first_letter(text):
# class ProxyStringError(Exception):
# class ProxyString(object):


# Path: pyanaconda/desktop.py
import os
import logging
from pyanaconda.constants import ROOT_PATH, RUNLEVELS
from pyanaconda import iutil

# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): Matt Wilson <msw@redhat.com>
#            Chris Lumens <clumens@redhat.com>
#


log = logging.getLogger("anaconda")

class Desktop(object):
    def __init__(self):
        self._runlevel = 3
        self.desktop = None

    @property
    def runlevel(self):
        return self._runlevel

    @runlevel.setter
    def runlevel(self, runlevel):
        if int(runlevel) not in RUNLEVELS:
            raise RuntimeError("Desktop::setDefaultRunLevel() - Must specify runlevel as one of %s" % RUNLEVELS.keys())

        self._runlevel = runlevel

    def write(self):
        if self.desktop:
            with open(ROOT_PATH + "/etc/sysconfig/desktop", "w") as f:
                f.write("DESKTOP=%s\n" % self.desktop)


        if not os.path.isdir(ROOT_PATH + '/etc/systemd/system'):