[IronPython] Using Wing IDE with IronPython - autocomplete for .NET objects (PI file generator)
Michael Foord
fuzzyman at voidspace.org.uk
Tue Apr 28 11:13:15 CEST 2009
Hello all,
I've created a modified version of the 'generate_pi.py' which generates
the interface files for .NET libraries. It is attached.
At the moment it generates PI files for the following assemblies /
namespaces (hardwired at the bottom of the code):
System
System.Data
System.Drawing
System.Windows.Forms
To run it, create a new directory and add this to the 'Interface File
Path' (File menu -> Preferences -> Source Analysis -> Advanced -> Insert).
Then from the command line switch to this directory (if you are on Vista
you will need to run cmd with admin privileges due to a defect explained
below). Execute the command:
ipy generate_pi_for_net.py
This generates the pi files. It doesn't work *as well* on 64 bit windows
because the .NET XML help files (or whatever they are called) are in a
different location so the docstrings are not always available - which is
why I am not just distributing the pi files yet.
The script doesn't yet understand static properties on classes - so it
actually *fetches* static properties rather than looking at the
descriptor (which is available in the class __dict__ so should be easy
to fix). This is what causes inadvertent registry lookups etc and
therefore requires admin privileges.
It doesn't yet understand multiple overloads. This may require a change
to Wing or may not matter.
It isn't yet able to do anything with the information about return types
- which would allow Wing to know the type of objects returned by
methods. This may be easy to add?
It is late so I am going to bed. At some point I will explain the simple
changes I had to make to the standard generate_pi.py script (although
they are mostly straightforward). I will also do further work on it as
it will be very useful to me...
All the best,
Michael
--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: generate_pi_for_net.py
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090428/4e379efd/attachment.ksh>
More information about the Ironpython-users
mailing list