----- Original Message -----
From: "Martin Kolman" <mkolman(a)redhat.com>
To: anaconda-patches(a)lists.fedorahosted.org
Sent: Friday, November 14, 2014 3:30:22 PM
Subject: [PATCH] Provide useful hints on TTY1 during the installation
Until now TTY1 was not really used for anything other than printing
current Anaconda version. This has been changed and the Anaconda
version is now followed by useful hints for Anaconda users with
special emphasis of Anaconda debugging (where are the log files stored,
how can I get a shell, etc.).
The hints are also parametrized to be displayed only when appropriate
(no need to tell users that Anaconda has a text mode if they already
are in textmode) and are translatable.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/anaconda b/anaconda
index a3f527c..c61dc71 100755
--- a/anaconda
+++ b/anaconda
@@ -988,11 +988,39 @@ if __name__ == "__main__":
verdesc = "%s for %s %s" % (getAnacondaVersionString(),
product.productName, product.productVersion)
+
+ logs_note = _(" * installation log files are stored in /tmp during the
installation")
+ shell_note = _(" * shell is available on TTY2 and in second TMUX pane
(ctrl+b, then press 2)")
+ tmux_only_note = _(" * shell is available in second TMUX pane (ctrl+b,
then press 2)")
+ text_mode_note = _(" * if the graphical installation interface fails to
start, try again with the\n\
+ inst.text bootoption to start text installation")
+ separate_attachements_note = _(" * when reporting a bug attach logs as
separate text/plain attachments")
+
if product.isFinal:
print("anaconda %s started." % verdesc)
else:
print("anaconda %s (pre-release) started." % verdesc)
+ # we are past the --version and --help shortcut so we can import Blivet
+ # now without slowing down anything critical
+
+ # pylint: disable=import-error
+ from blivet import arch
+
+ if not opts.images and not opts.dirinstall:
+ print(logs_note)
+ # no fancy stuff like TTYs on a s390...
+ if not arch.isS390():
+ print(shell_note)
+ # ...but there is apparently TMUX during the manual installation!
+ elif not opts.ksfile:
+ print(tmux_only_note)
+ # no need to tell users how to switch to text mode
+ # if already in text mode
+ if opts.display_mode == 'g':
+ print(text_mode_note)
+ print(separate_attachements_note)
+
from pyanaconda.anaconda import Anaconda
anaconda = Anaconda()
iutil.setup_translations(gettext)
--
1.9.3
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
This task is a little like showing the command-line options...except
these need to be translated, and a little like the help documentation work.
Is there any way you could leverage some of the ideas from that work
to better modularize what you're doing here?
Also, AFAICT those lines won't actually be translated if iutil.setup_translations()
is not called until after they're displayed (which is what is happening here).
- mulhern