… of how things are done
When a SpiceException was being raised, a new Exception object was being created every time. This did not allow the Python side to correlate that exception with the SpiceException object in the module since they were distinct objects. This patch creates a global reference for SpiceException and it's the one being thrown when an error occurs.
Tests ensure SpiceException is raised properly within the C module.
The setup.py now automatically calls the wrapper generator and can properly name the cspice.a and csupport.a files when needed. It needs to either have the cspice directory in the project root or have the environment variable CSPICE_SRC set.
This allows the ability to call the function and get the buffer rather than it printing to stdout.
* (Using CSPICE version N.0064, GCC 4.0.1, Mac OS X 10.5.8) * The function dafrfr_c has a parameter named 'free'. In the PySPICE wrapper the variable 'free' shadows the C stdlib function free() and causes a compilation error. Fixed this by adding a function fixNameCollision() in mkwrapper.py which checks a variable name against a list of RESERVED_NAMES; if the variable name is in the list it appends a '_' character to avoid the name collision. Future collisions can be fixed by adding new names to RESERVED_NAMES. * Added gfevnt_c and several other functions to mkwrapper.py exclude_list. These functions take a callback in their argument list, and mkwrapper.py doesn't know how to parse callback function types, causing syntax errors in its C output. * Added generated files 'spicemodule.c' and 'build' to .gitignore so they don't show up in 'git status' output.