[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...
(default1,default2,default3,default4)=('1','2','3','4')
#These are all of my prompts.
prompts = [('Static1',default1), ('Static2',
default2),('Static3',default3),('Static4',default4)]
ok, params = snack.EntryWindow(screen, "This is my title",
"This is my text at top of box",
prompts,
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
(what.__dict__.has_key('g')):
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...
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340366
Thanks,
Chris
More information about the Tutor
mailing list