The Komodo team have been working on creating tools for the automatic generation of the codeintel description files for python binary modules.
Attached are CIX files that covers both qt3 and qt4 (PyQt4). This means you should be able to get completions from code like this:
for qt3:
from qt qt.<|> # et all...
or a PyQt4 sample:
from PyQt4 import QtGui QtGui.<|> # et all...
More PyQt4 samples here:
http://zetcode.com/tutorials/pyqt4/firstprograms/
Installation
Unzip the attached file(s). Inside Komodo, go to your preferences and select the "Code Intelligence" category, then in the API Catalogs section, click on the "Add an API Catalog...", navigate to the cix file you previously extracted and add this. You should now have the qt completions (if not, try a restart to ensure all the codeintel information is synced).
Cheers,
Todd
| Attachment | Size |
|---|---|
| PyQt4-2-0.cix_.zip | 44.58 KB |
| qt-3-3-6.cix_.zip | 43.83 KB |
| PyQt4-3-3.cix_.zip | 7.9 KB |
Is there no newer version of this file available?
I've added an updated version for PyQt 4.3.3.
Let me know if you have any problems with it.
Cheers,
Todd
(Thanks for the 4.3 update!)
FYI...
As with the 4.2.0 version, once I add the API catalog, two entries appear in the listing. Both are for PyQt4 and are the same version. If I remove one of the entries, the other disappears, I had the same behavior with 4.2.0.
CI works fine as long as only one of the entries are checked.
If I delete and re-add the catalog, I get two entries again... I'm running Komodo IDE, version 4.4.1, build 20896, platform macosx-x86 on OSX 10.5.5.
I'm not sure why this is occurring, it seems to be only occurring on the Mac OS X version of Komodo 4.4.1, with Komodo 5.0.3 Mac version not showing these symptoms either.
The API catalog should still work, even if there are two instances that are checked.
You could also try manually copying the API catalog to the Komodo application directory, example:
Cheers,
Todd
That worked, thanks!
Hi,
I have PyQt-win-gpl-4.5-snapshot-20090430 on my system. The latest cix file here is for the version 4.3.3.
It would be great if you can post an update for pyqt-4.5 version or even better would be to detail the process you are following to generate these cix files.
I will update the generated cix files here for others.
regards,
raja
Here are the steps I used to create the qt cix file:
# to manually copy/update the URL link from below
svn co http://svn.openkomodo.com/repos/openkomodo/trunk/src/codeintel/support/g... python_gencix
cd python_gencix
I'm not sure if this is still required, but looking at the PyQt4.3 cix file it looks as though it is. I added a base PyQt4.so with a bunch of the modules names that I converted, so that the "from PyQt4 import xxx" should work:
<scope ilk="blob" lang="Python" name="PyQt4">
<import module="QtCore" />
<import module="QtGui" />
<import module="QtNetwork" />
<import module="QtOpenGL" />
<import module="QtScript" />
<import module="QtSql" />
<import module="QtSvg" />
<import module="QtTest" />
<import module="QtXml" />
<import module="QtAssistant" />
<import module="QtDesigner" />
</scope>
</file>
<file lang="Python" mtime="1228847885" path="PyQt4.so"> <scope ilk="blob" lang="Python" name="PyQt4"> <import module="QtCore" /> <import module="QtGui" /> <import module="QtNetwork" /> <import module="QtOpenGL" /> <import module="QtScript" /> <import module="QtSql" /> <import module="QtSvg" /> <import module="QtTest" /> <import module="QtXml" /> <import module="QtAssistant" /> <import module="QtDesigner" /> </scope> </file>Cheers,
Todd
Thanks for your posting.
I followed your instructions. But I am not able to generate.
I am working on windows with python 2.6.2 & pyqt-4.5(latest snapshot).
I am getting following errro:
--------------------------------------------------------------------
D:\sources\python_gencix>python gencix.py --onefile=PyQt4-5-1.cix --name="PyQt4" --description="Python QT bindings - version 4.5.1" PyQt4.QtCore
-------------------------------------------------------------
'import site' failed; use -v for traceback
Generating CIX for PyQt4.QtCore
Traceback (most recent call last):
File "gencix.py", line 427, in
docmodule(arg, root, options.force, usefile=True)
File "gencix.py", line 351, in docmodule
process_class(moduleElt, value, key, callables)
File "gencix.py", line 248, in process_class
[(name, getattr(obj, name)) for name in obj.__dict__])
AttributeError: 'MSG' object attribute 'wParam' is an instance attribute
------------------------------------------------------------------------
please advice.
thanks & regards,
raja