summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--text.py18
-rw-r--r--textw/language_text.py4
3 files changed, 26 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b70dcecba..01d404cc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-11-08 Jeremy Katz <katzj@redhat.com>
+
+ * text.py (InstallInterface.isRealConsole): Add method to check if
+ we're on a "real" console instead of duplicating the code
+ everywhere. Add a check for /proc/xen to imply xen guest (not
+ real console)
+ (InstallInterface.run): Use new method.
+ (InstallInterface.run): Use new method.
+ * textw/language_text.py (LanguageWindow.__call__): Use new method.
+
2005-11-08 Peter Jones <pjones@redht.com>
* dmraid.py: First parts of this, needs pyblock and dm libs.
diff --git a/text.py b/text.py
index f63617342..4a394d7fc 100644
--- a/text.py
+++ b/text.py
@@ -433,13 +433,25 @@ class InstallInterface:
if self.screen:
self.screen.finish()
+ def isRealConsole(self):
+ """Returns True if this is a _real_ console that can do things, False
+ for non-real consoles such as serial, i/p virtual consoles or xen."""
+ if flags.serial or flags.virtpconsole:
+ return False
+ if isys.isPsudoTTY(0):
+ return False
+ if isys.isVioConsole():
+ return False
+ if os.path.exists("/proc/xen"): # this keys us that we're a xen guest
+ return False
+ return True
+
def run(self, id, dispatch):
# set up for CJK text mode if needed
oldlang = None
if (flags.setupFilesystems and
(id.instLanguage.getFontFile(id.instLanguage.getCurrent()) == "bterm")
- and not flags.serial and not flags.virtpconsole
- and not isys.isPsudoTTY(0) and not isys.isVioConsole()):
+ and self.isRealConsole()):
log.info("starting bterm")
rc = 1
try:
@@ -472,7 +484,7 @@ class InstallInterface:
if DEBUG or flags.test:
self.screen.suspendCallback(debugSelf, self.screen)
- if flags.serial or flags.virtpconsole or isys.isPsudoTTY(0) or isys.isVioConsole():
+ if not self.isRealConsole():
self.screen.suspendCallback(spawnShell, self.screen)
# clear out the old root text by writing spaces in the blank
diff --git a/textw/language_text.py b/textw/language_text.py
index 98b711005..ab2a8ab7c 100644
--- a/textw/language_text.py
+++ b/textw/language_text.py
@@ -56,9 +56,7 @@ class LanguageWindow:
if (flags.setupFilesystems and
instLanguage.getFontFile(choice) == "bterm"
- and not flags.serial and not flags.virtpconsole
- and not isys.isPsudoTTY(0)
- and not isys.isVioConsole()):
+ and textInterface.isRealConsole()):
# bterm to the rescue... have to shut down the screen and
# create a new one, though (and do a sleep)
log.info("starting bterm")