summaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-11-09 02:07:56 +0000
committerJeremy Katz <katzj@redhat.com>2005-11-09 02:07:56 +0000
commit11794efabe0707a40d7cb46ff237e41a88db2b1a (patch)
treee3083b534d447605ccf82182505da694e1c41c02 /text.py
parent3b5fd8479a66de0add994334c859c353748be4ee (diff)
downloadanaconda-11794efabe0707a40d7cb46ff237e41a88db2b1a.tar.gz
anaconda-11794efabe0707a40d7cb46ff237e41a88db2b1a.tar.xz
anaconda-11794efabe0707a40d7cb46ff237e41a88db2b1a.zip
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.
Diffstat (limited to 'text.py')
-rw-r--r--text.py18
1 files changed, 15 insertions, 3 deletions
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