[Tutor] "Snack" python-newt version incompatibilities.. (anaconda kickstart)

Chris Mueller worminater at gmail.com
Mon Nov 16 23:15:41 CET 2009

Hello all.

I'm working on a CentOS 5.2 kickstart interface; and have been happily using

    %pre --interpreter /usr/bin/python

to do my management for awhile now with the snack module.  My problem
comes in when I am attempting to use the snack.EntryWindow function;
and setting default values.

The simplified version of my code is below...

    #These are all of my prompts.
    prompts = [('Static1',default1), ('Static2',
    ok, params = snack.EntryWindow(screen, "This is my title",
                                   "This is my text at top of box",
                                   help = "")

On my desktop, I have...
$>python -V
Python 2.5.2
The defualt python in CentOS5.2 is..
$>python -V
Python 2.4.3

The snack window behaves as expected on my desktop (default values all
populate and change values as I want/expect), but when I try and run
on the 2.4 python, i get the following(output cleaned up a little bit
as it splays the entire window)...

    <my file and pointing to the snack.EntryWindow call>
    File "/usr/lib/python2.4/site-packages/snack.py", line 796, in EntryWindow
    sg.setField(e, 1, count, anchorLeft = 1)
    File "/usr/lib/python2.4/site-packages/snack.py", line 388, in setField
    AttributeError: 'str' object has no attribute '__dict__' selects

With some googling, I managed to find references to a bug in the
python snack module that was fixed, but I was unable to find a working
format of the "prompts" variable to work in my Python 2.4.3.

I tried the above code, as well the suggestion from the link below of

    prompts = [Entry(20, 'ham'), Entry(20, 'egg', hidden=True)]

But to no avail. Any help would be greatly appreciated...



More information about the Tutor mailing list