summaryrefslogtreecommitdiffstats
path: root/desktop.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-06-20 04:39:53 +0000
committerMatt Wilson <msw@redhat.com>2001-06-20 04:39:53 +0000
commitc4249bbe06e028e95f6514adb7f90ae11ab3b43b (patch)
tree408350beb14885893b86938d27a46688c4986003 /desktop.py
parent8a566ec58b79dc8c583a4610a27a5182b31bacb8 (diff)
downloadanaconda-c4249bbe06e028e95f6514adb7f90ae11ab3b43b.tar.gz
anaconda-c4249bbe06e028e95f6514adb7f90ae11ab3b43b.tar.xz
anaconda-c4249bbe06e028e95f6514adb7f90ae11ab3b43b.zip
merge dispatch to HEAD
Diffstat (limited to 'desktop.py')
-rw-r--r--desktop.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/desktop.py b/desktop.py
new file mode 100644
index 000000000..4ab0caa92
--- /dev/null
+++ b/desktop.py
@@ -0,0 +1,51 @@
+import string
+import kudzu
+import iutil
+import isys
+from log import log
+
+class Desktop:
+#
+# This class represents the default desktop to run and the default runlevel
+# to start in
+#
+
+ def setDefaultDesktop(self, desktop):
+ self.desktop = desktop
+
+ def setDefaultRunLevel(self, runlevel):
+ if str(runlevel) != "3" and str(runlevel) != "5":
+ raise RuntimeError, "Desktop::setDefaultRunLevel() - Must specify runlevel as 3 or 5!"
+ self.runlevel = runlevel
+
+ def getDefaultDesktop(self):
+ return self.desktop
+
+ def getDefaultRunLevel(self):
+ return self.runlevel
+
+ def __init__ (self):
+ self.desktop = None
+ self.runlevel = 3
+
+ def write (self, instPath):
+ #
+ # XXX
+ #
+ return
+
+ try:
+ inittab = open (instPath + '/etc/inittab', 'r')
+ except IOError:
+ log ("WARNING, there is no inittab, bad things will happen!")
+ return
+ lines = inittab.readlines ()
+ inittab.close ()
+ inittab = open (instPath + '/etc/inittab', 'w')
+ for line in lines:
+ if len (line) > 3 and line[:3] == "id:":
+ fields = string.split (line, ':')
+ fields[1] = str (self.runlevel)
+ line = string.join (fields, ':')
+ inittab.write (line)
+ inittab.close ()