#!/usr/bin/python
import sys

from useless.base.path import path

from paella.installer.toolkit import InstallerTools

#################################
    
print "config script for desktop trait"

it = InstallerTools()
env = it.env()

display_manager = env['desktop:display_manager'].strip()
if display_manager:
    print "Installing Display Manager: %s" % display_manager
    sys.stdout.flush()
    cmd = ['apt-get', '-y', 'install', display_manager]
    it.chroot(cmd)
else:
    print "No Display Manager defined here, doing nothing."

sys.stdout.flush()
