Module instant :: Class instant
[hide private]
[frames] | no frames]

Class instant

source code

Instance Methods [hide private]
 
__init__(self)
instant constructor
source code
 
parse_args(self, dict)
A method for parsing arguments.
source code
 
create_extension(self, **args)
Call this function to instantly create an extension module.
source code
 
debug(self)
print out all instance variable
source code
 
clean(self)
Clean up files the current session.
source code
 
generate_Interfacefile(self)
Use this function to generate a SWIG interface file.
source code
 
check_md5sum(self)
Check if the md5sum of the generated interface file has changed since the last time the module was compiled.
source code
 
generate_setup(self)
Generates a setup.py file
source code
 
generate_Makefile(self)
Generates a project dependent Makefile, which includes and uses SWIG's own Makefile to create an extension module of the supplied C/C++ code.
source code
Method Details [hide private]

create_extension(self, **args)

source code 
Call this function to instantly create an extension module. SWIG is used to generate code that can be compiled and used as an ordinary Python module.

Arguments:

  • code:
    • A Python string containing C or C++ function, class, ....
  • module:
    • The name you want for the module (Default is 'instant_swig_module'.). String.
  • swigopts:
    • Options to swig, for instance -lpointers.i to include the SWIG pointers.i library. String.
  • init_code:
    • Code that should be executed when the instant extension is imported. String.
  • system_headers:
    • A list of system header files required by the instant code.
  • local_headers:
    • A list of local header files required by the instant code.
  • wrap_headers:
    • A list of local header files that should be wrapped by SWIG.
  • include_dirs:
    • A list of directories to search for header files.
  • sources:
    • A list of source files to compile and link with the extension.
  • cppargs:
    • Flags like -D, -U, etc. String.
  • lddargs:
    • Flags like -D, -U, etc. String.
  • libraries:
    • A list of libraries needed by the instant extension.
  • library_dirs:
    • A list of directories to search for libraries (-l).
  • object_files:
    • If you want to compile the files yourself. NOT YET SUPPORTED.
  • arrays:
    • A list of the C arrays to be made from NumPy arrays.
  • additional_definitions:
    • A list of additional definitions (typically needed for inheritance)
  • additional_declarations:
    • A list of additional declarations (typically needed for inheritance)
  • signature:
    • A signature string to identify the form instead of the source code.

generate_Interfacefile(self)

source code 

Use this function to generate a SWIG interface file.

To generate an interface file it uses the following class-variables:
  • code
  • ifile_name (The SWIG input file)
  • init_code (Code to put in the init section of the interface file)
  • system_headers (A list of system headers with declarations needed)
  • local_headers (A list of local headers with declarations needed)
  • wrap_headers (A list of local headers that will be wrapped by SWIG)

check_md5sum(self)

source code 
Check if the md5sum of the generated interface file has changed since the last time the module was compiled. If it has changed then recompilation is necessary.