When I run this small script from the command line (ubuntu 11.10) all is
good.
from traits.etsconfig.etsconfig import ETSConfig
ETSConfig.toolkit = 'qt4'
print 'toolkit: ',ETSConfig.toolkit
from pyface.api import FileDialog, OK
fdialog = FileDialog(action='open files',title='Choose files to open')
if fdialog.open() == OK:
for fname in fdialog.paths:
print fname
print 'finished'
However, when running from within Spyder 2.1.1 (F5) I get the error
messages shown below. If I set the toolkit to 'wx', both command line
and running from within Spyder is OK. What is the meaning of the messages??
toolkit: qt4
Warning/PyQt4-Spyder (API 'QString' has already been set to version 1)
Warning/PyQt4-Spyder (API 'QVariant' has already been set to version 1)
Traceback (most recent call last):
File "/home/......./test_fileopen.py", line 7, in <module>
if fdialog.open() == OK:
File "/usr/lib/python2.7/dist-packages/pyface/i_dialog.py", line 122,
in open
self.close()
File "/usr/lib/python2.7/dist-packages/pyface/ui/qt4/file_dialog.py",
line 100, in close
self.wildcard_index = self.control.nameFilters().index(
AttributeError: 'QStringList' object has no attribute 'index'
Thanks, Janwillem
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/spyderlib?hl=en.