Richard Gruet, Rev 1 Jan 10, 2002
 

ipy

Overview
Requirements
Installation
    On windows
    On Unix
License

Overview

What's that ?

ipy (alias idl2pyImpl) is a Python/CORBA utility program that generates Python implementation skeletons from IDL sources (IDL files or Interface Repository). It allows to create very quickly a basic but running Python prototype of a CORBA server, given its IDL definition.

What for ?

Did you ever notice that once you have written an IDL specification and generated the stubs using omniidl, you still have a fair amount of work to accomplish to get a working server and a test client ?  Create a Python module (with a header, etc..), an implementation Python class for each IDL interface, with a method for each IDL operation. Of course, you must respect the original signatures while mapping IDL types to  Python ones. And what about the original comments in the IDL ? Would'nt it be nice to get them automatically instead of copy/pasting them (just in case you put comments, I'm kidding) ? And a server requires a main, taking care of all the activation stuff. Probably this main will take some args... And some log capabilities, and also a Name service, and why not - if you have several servers - some administration capability (launch & stop the servers) ? Sure, if your purpose is to write an Echo or a Hello Server, it looks a bit overkill to have all these features, but you still need half of them! But for a more realistic server... After that, you are ready to start the REAL implementation, the one related to your problem... if with all that overhead, you have not forgotten the original purpose of your server !
Ever dreamed of a tool that would generate quickly a skeleton with all these features built-in for you, so you can focus on the implementation of the methods declared in the IDL interface ?

That's precisely where ipy may help :
bulletIt is a generator: it will create  the Python implementation skeletons from the IDL source, defining classes, methods (preserving comments), creating optionally a main and a test client with invocation arguments, and even a help message!  It may also generate the OmniORB stubs on demand. Generation uses a customizable set of templates defined in a Python module.
bulletit is a framework: the default templates used for generating the implementation skeleton relies on a framework of Python classes called scf (Simple Corba Framework) that provides simple implementations for basic functionnalities required by a typical Corba server (log, name service, administration...), so you can dispose of a functional server in a minimum of time. However, you can if you prefer use a different set of templates that don't rely on scf.

To summarize, pros and cons

ipy is great to get in a snap a working Python prototype of a CORBA server, given an IDL specification. It may also be used for an operational -non prototype- server,  but it is not obvious that it will fit your existing context if any, or it might require a significant amount of adaptation in that case. So its primary usage is to get quickly a first implementation to check the validity of IDL interfaces, prototype, or serve as a basis for a more serious implementation. However, I used it in real operational projects (but in that case, it was by chance fitting my context, maybe because I am the author ;-)

Requirements


 
 
bulletOS: portable (tested on Windows 98, NT, 2000, Solaris; should work on other platforms where OmniORB is available)
bulletPython 1.5.2, 2.0 or newer (http://www.python.org). On windows a good distribution of Python 2 (ActivePython) is available at http://www.ActiveState.com/ASPN/Downloads/ActivePython/.
bullet omniORB 3.0 + omniORBpy 1.0 installed and accessible (ie in the PATH). OmniORB is a free, robust and performant implementation of CORBA 2, with mappings for C++ and Python (omniORBpy). The support by the authors is really great. For Windows a binary bundled distribution of OmniORB + OmniORBpy is available at http://www.uk.research.att.com/omniORB/omniORBpy/index.html .

Installation

Assuming that you have already installed Python and omniORBpy (see above):

On Windows


 
bulletDownload  http://rgruet.free.fr/ipy12.zip  and uncompress it (preserving file structure) to the place where you want the ipy directory to be created (e.g. D:\). It will create a directory named 'ipy<version#>' (e.g: D:\ipy12).
bullet Set your environment:

 
set BINDINGS=<a writable directory>
bulletset IPY=<path of install> (e.g. D:\ipy12)
bulletset PATH=%IPY%;%PATH%
bulletset PYTHONPATH=%IPY%;%PYTHONPATH% or in the windows registry, create a key HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\<version>\PythonPath\IPY<version> with a string default value of: %IPY% (expanded) or (my favorite method) create a file ipy.pth in the Python home directory, containing (at least) a line "<IPY install path> ".
bulletIt is optional but recommended to define a variable to point at a directory (typically a shared one) where to exchange IORs between servers and clients:
bullet Open a console and type: ipy -h
You should get the help message of ipy.

On Unix

bulletDownload  http://rgruet.free.fr/ipy12.tgz and uncompress it (preserving file structure) to the place where you want the ipy directory to be created (e.g. /usr/local). It will create a directory named 'ipy<version#>'  (e.g: /usr/local/ipy12).
bullet Set your environment:

set BINDINGS=<a writable directory>
bulletset IPY=<path of install> (e.g. /usr/local/ipy)
bulletset PATH=$IPY%:$PATH
bulletset PYTHONPATH=$IPY:$PYTHONPATH or (my favorite method) create a file ipy.pth in the Python home directory, containing (at least) a line "<IPY install path> ".
bulletIt is optional but recommended to define a variable to point at a directory where to exchange IORs between servers and clients:
bullet Rename the launch script ipy.sh to ipy, and make it executable. bullet Open a shell and type: ipy -h
You should get the help message of ipy.
OmniORBpy 1.4 bug:
You will get the following message when exiting from ipy with OmniORBpy 1.3 or 1.4 :
Exception exceptions.TypeError: 'call of non-function (type None)' in
<method POAManager.__del__ of POAManager instance at 00DE101C> ignored
This is a harmless but anoying  known error, for which Duncan Grisby has provided a patch (see <IPY>/fix001.txt). You can apply it on your OmniORBpy distribution to fix the problem.

 License

  (c) Copyright 2000-2001 by Richard Gruet
        + omniORB & omniORBpy (c) ATT Research Laboratories (http://www.uk.research.att.com/omniORB/)
        + platform.py (c) M. A. Lemburg.

   Permission to use, copy, modify, and distribute this software and its documentation for any purpose
   and without fee or royalty is hereby granted,  provided that the above copyright notice appear in all
   copies and that  both that copyright notice and this permission notice appear in  supporting documentation
   or portions thereof, including modifications, that you make.

THE AUTHOR RICHARD GRUET DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,  INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING  FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,  NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !