<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="sans-serif">you can kick off a %pre in
python using the --interpreter flag.  I just use the vt5 for feedback,
so I just issue <br>
<br>
os.system("chvt 5")<br>
<br>
and write to /dev/tty5 directly, but I'm sure you could manipulate
sys.stdout, and sys.stderr <br>
<br>
Matt<br>
</font></font><br>
Glenn Bailey wrote:
<blockquote
 cite="mid:C9A495C51E57F74B8B168E245C0003B20DCB0DFDF4@MIA20725EXC392.apps.tmrk.corp"
 type="cite">
  <pre wrap="">Howdy folks,

I've been beating my head trying to get this darn thing to work. I can easily grab user input via straight shell in the following example:

%pre
chvt 3
exec </dev/tty3 >/dev/tty3 2>/dev/tty3
echo -n "Enter the hostname: "
read HOSTNAME
echo "You entered: $HOSTNAME"

But, what I am trying to do is use the python snack library, and I'm having no luck. I couldn't find a pure python solution, so I tried some tricks and came up with the following:

%pre
chvt 3
exec </dev/tty3 >/dev/tty3 2>/dev/tty3
/usr/bin/python <<EOF

import os, sys
from snack import *

title = "Linux Build"
buttons = ['Ok', 'Cancel']
width = 40
help = "None"
textItems = "Hello!"
text = "Confirm options"
screen = SnackScreen()
ButtonChoiceWindow(screen, title, textItems, ['Start Build', 'Re-input Items'],
                   width, 0,0,help)
screen.finish()

EOF

Which will display the screen, but it still takes input from tty1. Any ideas to WTH is going on? Looking through the archives I found some pure python examples, but they did nada fer me .. I'd take a solution in shell or python as long as it works ;-)

_______________________________________________
Kickstart-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/kickstart-list">https://www.redhat.com/mailman/listinfo/kickstart-list</a>
  </pre>
</blockquote>
</body>
</html>