Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 496)
+++ trunk/Makefile.in	(revision 497)
@@ -15,6 +15,6 @@
 	cd -
 #	make RpTcl;
-#	make RpPython;
-#	make RpPerl;
+	make RpPython;
+	make RpPerl;
 
 #############################################################################
@@ -31,8 +31,28 @@
 #############################################################################
 
+RpPython:
+	set -x;
+	cd python; \
+	@PYTHON@ setup.py \
+		build_ext \
+		--library-dirs=@prefix@/lib \
+		--include-dirs=@prefix@/include/core \
+		install \
+		--prefix=@prefix@ \
+
+RpPerl:
+	set -x;
+	cd perl; \
+	@PERL@ Makefile.PL PREFIX=@prefix@; \
+	make; \
+	make test; \
+	make install;
+
 clean:
 	cd examples/app-fermi/cee; make clean; cd -;
 	cd examples/app-fermi/fortran; make clean; cd -;
 	cd examples/c-example; make clean; cd -;
+	cd perl; make clean; cd -;
+	cd python; rm -rf build; cd -;
 	cd src; make clean; cd -;
 	cd src/matlab; make clean; cd -;
@@ -43,4 +63,6 @@
 	cd examples/app-fermi/fortran; make distclean; cd -;
 	cd examples/c-example; make distclean; cd -;
+	cd perl; make clean; cd -;
+	cd python; rm -rf build; cd -;
 	cd src; make distclean; cd -;
 	cd src/matlab; make distclean; cd -;
Index: trunk/configure
===================================================================
--- trunk/configure	(revision 496)
+++ trunk/configure	(revision 497)
@@ -310,5 +310,5 @@
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 VERSION RP_BASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CXX CXXFLAGS ac_ct_CXX CXXCPP F77 FFLAGS ac_ct_F77 PERL PYTHON pythondir PYTHON_VERSION PYTHON_INCLUDES PYTHON_SITE_PACKAGES VERSION RP_BASE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
@@ -858,4 +858,10 @@
   cat <<\_ACEOF
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-perl=DIR         Build Perl bindings if found
+  --with-python=DIR       Build Python bindings if found
+
 Some influential environment variables:
   CC          C compiler command
@@ -4233,5 +4239,5 @@
 
 # Provide some information about the compiler.
-echo "$as_me:4235:" \
+echo "$as_me:4241:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
@@ -4378,8 +4384,163 @@
 
 
+# Check whether --with-perl or --without-perl was given.
+if test "${with_perl+set}" = set; then
+  withval="$with_perl"
+
+fi;
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_PERL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$PERL"; then
+  ac_cv_prog_PERL="$PERL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PERL="perl"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="false"
+fi
+fi
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+PYTHON=
+PYTHON_VERSION=
+PYTHON_INCLUDES=
+PYTHON_SITE_PACKAGES=
+pythondir=
+
+# Check whether --with-python or --without-python was given.
+if test "${with_python+set}" = set; then
+  withval="$with_python"
+
+fi;
+if test "$with_python" != "no" ; then
+    if test -x "$with_python/bin/python"
+    then
+        echo Found python in $with_python/bin/python
+        PYTHON="$with_python/bin/python"
+    else
+        if test -x "$with_python"
+        then
+            echo Found python in $with_python
+            PYTHON="$with_python"
+        else
+            # Extract the first word of "python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args.
+set dummy python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PYTHON+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+
+if test -n "$PYTHON"; then
+  echo "$as_me:$LINENO: result: $PYTHON" >&5
+echo "${ECHO_T}$PYTHON" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+        fi
+    fi
+    if test "$PYTHON" != ""
+    then
+        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[0:3]"`
+    echo Found Python version $PYTHON_VERSION
+    fi
+    if test "$PYTHON_VERSION" != ""
+    then
+    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
+       -d $with_python/lib/python$PYTHON_VERSION/site-packages
+    then
+        PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
+        PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
+    else
+        if test -r $prefix/include/python$PYTHON_VERSION/Python.h
+        then
+            PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
+            PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+        else
+            if test -r /usr/include/python$PYTHON_VERSION/Python.h
+            then
+                PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
+                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+            else
+                echo could not find python$PYTHON_VERSION/Python.h
+            fi
+        fi
+        if test ! -d "$PYTHON_SITE_PACKAGES"
+        then
+            PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
+        fi
+    fi
+    fi
+    if test "$with_python" != ""
+    then
+        pythondir='$(PYTHON_SITE_PACKAGES)'
+    else
+        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
+    fi
+fi
+
+
+
+
+
+
+
+
+
+
 RP_BASE=`pwd`
 
 
-                                                                                          ac_config_files="$ac_config_files Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/c-example/Makefile src/Makefile src/matlab/Makefile src/octave/Makefile test/Makefile gui/apps/rappture"
+                                                                                                              ac_config_files="$ac_config_files Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/c-example/Makefile perl/Makefile.PL python/setup.py src/Makefile src/matlab/Makefile src/octave/Makefile test/Makefile gui/apps/rappture"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4936,4 +5097,6 @@
   "examples/app-fermi/fortran/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/app-fermi/fortran/Makefile" ;;
   "examples/c-example/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/c-example/Makefile" ;;
+  "perl/Makefile.PL" ) CONFIG_FILES="$CONFIG_FILES perl/Makefile.PL" ;;
+  "python/setup.py" ) CONFIG_FILES="$CONFIG_FILES python/setup.py" ;;
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "src/matlab/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/matlab/Makefile" ;;
@@ -5041,4 +5204,10 @@
 s,@FFLAGS@,$FFLAGS,;t t
 s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@PERL@,$PERL,;t t
+s,@PYTHON@,$PYTHON,;t t
+s,@pythondir@,$pythondir,;t t
+s,@PYTHON_VERSION@,$PYTHON_VERSION,;t t
+s,@PYTHON_INCLUDES@,$PYTHON_INCLUDES,;t t
+s,@PYTHON_SITE_PACKAGES@,$PYTHON_SITE_PACKAGES,;t t
 s,@VERSION@,$VERSION,;t t
 s,@RP_BASE@,$RP_BASE,;t t
Index: trunk/configure.in
===================================================================
--- trunk/configure.in	(revision 496)
+++ trunk/configure.in	(revision 497)
@@ -35,4 +35,101 @@
 AC_PROG_F77([f77 fort77 g77 f90 xlf xlf90 fl32])
 
+dnl perl and python check borrowed from 
+dnl http://www.opensource.apple.com/darwinsource/Current/libxslt-8.1/libxslt/configure.in
+dnl
+dnl Perl is just needed for generating some data for XSLtmark
+dnl
+
+AC_ARG_WITH(perl, [  --with-perl[=DIR]         Build Perl bindings if found])
+AC_CHECK_PROG(PERL, perl, perl, false)
+dnl AM_CONDITIONAL(WITH_PERL, test "$PERL" != "false")
+
+dnl
+dnl check for python
+dnl
+
+PYTHON=
+PYTHON_VERSION=
+PYTHON_INCLUDES=
+PYTHON_SITE_PACKAGES=
+pythondir=
+AC_ARG_WITH(python, [  --with-python[=DIR]       Build Python bindings if found])
+if test "$with_python" != "no" ; then
+    if test -x "$with_python/bin/python"
+    then
+        echo Found python in $with_python/bin/python
+        PYTHON="$with_python/bin/python"
+    else
+        if test -x "$with_python"
+        then
+            echo Found python in $with_python
+            PYTHON="$with_python"
+        else
+            AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5)
+        fi
+    fi
+    if test "$PYTHON" != ""
+    then
+        PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
+    echo Found Python version $PYTHON_VERSION
+dnl    LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1
+dnl except: print 0"`
+dnl     if test "$LIBXML2_PYTHON" = "1"
+dnl     then
+dnl         echo Found libxml2-python module
+dnl     else
+dnl         echo Warning: Missing libxml2-python
+dnl     fi
+    fi
+    if test "$PYTHON_VERSION" != ""
+    then
+    if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \
+       -d $with_python/lib/python$PYTHON_VERSION/site-packages
+    then
+        PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION
+        PYTHON_SITE_PACKAGES=$with_python/lib/python$PYTHON_VERSION/site-packages
+    else
+        if test -r $prefix/include/python$PYTHON_VERSION/Python.h
+        then
+            PYTHON_INCLUDES='$(prefix)/include/python$(PYTHON_VERSION)'
+            PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+        else
+            if test -r /usr/include/python$PYTHON_VERSION/Python.h
+            then
+                PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION
+                PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages'
+            else
+                echo could not find python$PYTHON_VERSION/Python.h
+            fi
+        fi
+        if test ! -d "$PYTHON_SITE_PACKAGES"
+        then
+            PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"`
+        fi
+    fi
+    fi
+    if test "$with_python" != ""
+    then
+        pythondir='$(PYTHON_SITE_PACKAGES)'
+    else
+        pythondir='$(libdir)/python${PYTHON_VERSION}/site-packages'
+    fi
+fi
+dnl AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "")
+dnl if test "$PYTHON_INCLUDES" != ""
+dnl then
+dnl     PYTHON_SUBDIR=python
+dnl else
+dnl     PYTHON_SUBDIR=
+dnl fi
+AC_SUBST(pythondir)
+dnl AC_SUBST(PYTHON_SUBDIR)
+
+AC_SUBST(PERL)
+AC_SUBST(PYTHON)
+AC_SUBST(PYTHON_VERSION)
+AC_SUBST(PYTHON_INCLUDES)
+AC_SUBST(PYTHON_SITE_PACKAGES)
+
 AC_SUBST(VERSION)
 
@@ -45,4 +142,6 @@
             examples/app-fermi/fortran/Makefile \
             examples/c-example/Makefile \
+            perl/Makefile.PL \
+            python/setup.py \
             src/Makefile \
             src/matlab/Makefile \
Index: trunk/perl/Makefile.PL.in
===================================================================
--- trunk/perl/Makefile.PL.in	(revision 497)
+++ trunk/perl/Makefile.PL.in	(revision 497)
@@ -0,0 +1,176 @@
+use 5.008;
+use ExtUtils::MakeMaker;
+use Config;
+use File::Spec;
+
+$CC = $Config{"cc"};
+$LD = $Config{"ld"};
+
+if ($ARGV[0] eq "DEBUG") {
+	shift @ARGV;
+	$DEBUG = 1;
+}
+
+if ($^O ne "MSWin32") {
+    $CC = '@CXX@';
+    $LD = '@CXX@';
+    @SCEW_INC_SEARCHPATH = ( "@prefix@/include",
+        "/apps/rappture/include", "/opt/rappture/include",
+        "/usr/local/include", "/opt/include", "../../scew-0.4.0", 
+        "../../scew", "/apps/scew-0.4.0", "/apps/scew", "/opt/scew-0.4.0",
+        "/opt/scew" );
+    $SCEW_INC="scew/scew.h";
+    @EXPAT_INC_SEARCHPATH = ( "@prefix@/include",
+        "/apps/rappture/include", "/opt/rappture/include", 
+        "/usr/local/include", "/opt/include", "../../expat-2.0.0/lib", 
+        "../../expat/lib", "/apps/expat-2.0.0/lib", "/apps/expat/lib", 
+        "/opt/expat-2.0.0/lib", "/opt/expat/lib" );
+    $EXPAT_INC="expat.h";
+    @RAPPTURE_INC_SEARCHPATH = ( "@prefix@/include",
+        "/apps/rappture/include", 
+        "/opt/rappture/include", "/usr/local/include", "/opt/include", 
+        "../include" );
+    $RAPPTURE_INC = "core/rappture.h";
+    @SCEW_LIB_SEARCHPATH = ( "@prefix@/lib",
+        "/apps/rappture/lib", "/opt/rappture/lib", 
+        "/usr/local/lib", "/opt/lib", "../../scew-0.4.0/scew", 
+        "../../scew/scew", "/apps/scew-0.4.0/scew", "/apps/scew/scew", 
+        "/opt/scew-0.4.0/scew", "/opt/scew/scew" );
+    @SCEW_LIBS=("libscew.so","libscew.a");
+    @EXPAT_LIB_SEARCHPATH = ( "@prefix@/lib",
+        "/apps/rappture/lib", "/opt/rappture/lib", 
+        "/usr/local/lib", "/opt/lib", "../../expat-2.0.0/lib", 
+        "../../expat/lib", "/apps/expat-2.0.0/lib", "/apps/expat/lib", 
+        "/opt/expat-2.0.0/lib", "/opt/expat/lib" );
+    @EXPAT_LIBS=("libexpat.so", "libexpat.a");
+    @RAPPTURE_LIB_SEARCHPATH = ( "@prefix@/lib",
+        "/apps/rappture/lib", "/opt/rappture/lib", 
+        "/usr/local/lib", "/opt/lib", "../src" );
+    @RAPPTURE_LIBS=("librappture.so","librappture.a");
+} 
+else {
+    if ($Config{"cc"} eq "cl") {
+	$CFLAGS = "/TP /EHsc";
+        @LIBS = ("msvcprt.lib");
+    }
+
+    @SCEW_INC_SEARCHPATH = ( "C:\\Program Files\\Rappture\\include", 
+        "C:\\opt\\rappture\\include", "C:\\opt\\include", "..\\..\\scew-0.4.0", 
+        "..\\..\\scew", "C:\\Program Files\\scew-0.4.0", 
+        "C:\\Program Files\\scew", "C:\\opt\\scew-0.4.0", "C:\\opt\\scew" );
+    $SCEW_INC="scew\\scew.h";
+    @EXPAT_INC_SEARCHPATH = ( "C:\\Program Files\\Rappture\\include", 
+        "C:\\opt\\rappture\\include", "C:\\opt\\include", 
+        "..\\..\\expat-2.0.0\\lib", "..\\..\\expat\\lib", 
+        "C:\\Program Files\\Expat-2.0.0\\Source\\lib", 
+        "C:\\Program Files\\Expat\\Source\\lib", 
+        "C:\\opt\\expat-2.0.0\\lib", "C:\\opt\\expat\\lib" );
+    $EXPAT_INC="expat.h";
+    @RAPPTURE_INC_SEARCHPATH = ( "C:\\Program Files\\Rappture\\include", 
+        "C:\\opt\\rappture\\include", "C:\\opt\\include", "..\\include" );
+    $RAPPTURE_INC = "core\\rappture.h";
+    @SCEW_LIB_SEARCHPATH = ( "C:\\Program Files\\Rappture\\lib", 
+        "C:\\opt\\rappture\\lib", "C:\\opt\\lib", 
+        "..\\..\\scew-0.4.0\\win32\\lib", "..\\..\\scew\\win32\\lib", 
+        "C:\\Program Files\\scew-0.4.0\\win32\\lib",
+        "C:\\Program Files\\scew\\win32\\lib", 
+        "C:\\opt\\scew-0.4.0\\win32\\lib", "C:\\opt\\scew\\win32\\lib" );
+    @SCEW_LIBS=("scew_s.lib", "libscew_s.lib", "scew.lib", "libscew.lib");
+    @SCEWD_LIBS=("scew_sd.lib", "libscew_sd.lib", "scewd.lib", "libscewd.lib");
+    @EXPAT_LIB_SEARCHPATH = ( "C:\\Program Files\\Rappture\\lib", 
+        "C:\\opt\\rappture\\lib", "C:\\opt\\lib", 
+        "..\\..\\expat-2.0.0\\lib\\Release_static", 
+        "..\\..\\expat\\lib\\Release_static", 
+        "C:\\Program Files\\Expat-2.0.0\\StaticLibs",
+        "C:\\Program Files\\Expat\\StaticLibs", 
+        "C:\\opt\\expat-2.0.0\\lib\\Release_static", 
+        "C:\\opt\\expat\\lib\\Release_static" );
+    @EXPAT_LIBS=("libexpat.lib", "libexpatMT.lib");
+    @RAPPTURE_LIB_SEARCHPATH = ( "C:\\Program Files\\Rappture\\lib", 
+        "C:\\opt\\rappture\\lib", "C:\\opt\\lib", "..\\src" );
+    @RAPPTURE_LIBS=("librappture.lib");
+}
+
+sub
+find_include {
+    my ($dirs, $filename, $incref) = @_;
+    foreach $component (@$dirs) {
+        if (-e File::Spec->catfile($component, $filename)) {
+            ($sdir = $component) =~ s/\\/\\\\/g;
+            if (!(grep /^-I$sdir/, @$incref)) { 
+                push @$incref, "-I$component"; 
+            }
+	    return 1;
+            last;
+        }
+    }
+
+    return 0;
+}
+
+sub
+find_lib {
+    my ($dirs, $filenames, $libref) = @_;
+
+    SEARCH: foreach $component (@$dirs) {
+        foreach $lib (@$filenames) {
+            $file = File::Spec->catfile($component, $lib);
+            if (-e $file) {
+                if ($lib =~ /^lib(.+)(.a|.so)$/) {
+                    if (grep /^-L$component/, @$libref) {
+                        push @$libref, "-l$1";
+                    }
+                    else {
+                        push @$libref, "-L$component -l$1";
+                    }
+                }
+                else {
+                    push @$libref, $file;
+                }
+		return 1;
+                last SEARCH;
+            }
+        }
+    }
+    return 0;
+}
+
+find_include(\@SCEW_INC_SEARCHPATH, $SCEW_INC, \@INCLUDES);
+find_include(\@EXPAT_INC_SEARCHPATH, $EXPAT_INC, \@INCLUDES);
+find_include(\@RAPPTURE_INC_SEARCHPATH, $RAPPTURE_INC, \@INCLUDES);
+find_lib(\@EXPAT_LIB_SEARCHPATH, \@EXPAT_LIBS, \@LIBS);
+find_lib(\@RAPPTURE_LIB_SEARCHPATH, \@RAPPTURE_LIBS, \@LIBS);
+if ($DEBUG) {
+    if (!find_lib(\@SCEW_LIB_SEARCHPATH, \@SCEWD_LIBS, \@LIBS)) {
+        find_lib(\@SCEW_LIB_SEARCHPATH, \@SCEW_LIBS, \@LIBS);
+    }
+}
+
+WriteMakefile(
+    NAME              => 'Rappture',
+    VERSION_FROM      => 'lib/Rappture.pm', # finds $VERSION
+    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
+    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
+      (ABSTRACT_FROM  => 'lib/Rappture.pm', # retrieve abstract from module
+       AUTHOR         => 'Nicholas J. Kisseberth') : ()),
+    LIBS              => ["@LIBS"],
+    DEFINE            => "$CFLAGS", 
+    INC               => "@INCLUDES", 
+    CC                => $CC,
+    LD                => $LD,
+    XSOPT             => '-C++',
+);
+
+package MY;
+use Config;
+
+sub dynamic_lib {
+	my $inherited = shift->SUPER::dynamic_lib(@_);
+        if (($^O eq "MSWin32") && ($Config{'cc'} eq "cl")) {
+	    $inherited .= "\tMT.EXE -manifest \$@.manifest -outputresource:\$@;2\n";
+	    $inherited .= "\t\$(RM_F) \$@.manifest\n";
+        }
+	return($inherited);
+}
+
+
Index: trunk/python/Rappture/queue.py
===================================================================
--- trunk/python/Rappture/queue.py	(revision 497)
+++ trunk/python/Rappture/queue.py	(revision 497)
@@ -0,0 +1,641 @@
+# ----------------------------------------------------------------------
+#
+# ======================================================================
+#  AUTHOR:  Derrick Kearney, Purdue University
+#  Copyright (c) 2005  Purdue Research Foundation, West Lafayette, IN
+# ======================================================================
+
+import sys,os
+import re
+import time
+import shutil
+
+# import Rappture Related libs
+from tools import *
+
+#######################################################################
+
+# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52235
+class CallbaseError(AttributeError):
+    pass
+
+def callbase(obj, base, methodname='__init__', args=(), raiseIfMissing=None):
+    try: method = getattr(base, methodname)
+    except AttributeError:
+        if raiseIfMissing:
+            raise CallbaseError, methodname
+        return None
+    if args is None: args = ()
+    return method(obj, *args)
+
+class RpQueueError(Exception):
+    pass
+
+class queue:
+
+    def __init__(self):
+
+        # initialize the general queue variable with safe, default values
+        self._queue_vars = {}
+        self.__initQueueVars__()
+
+    def __initQueueVars__(self):
+        self._queue_vars['walltime'] = 1
+        self._queue_vars['resultsDir'] = ""
+        self._queue_vars['executable'] = ""
+        self._queue_vars['execArgs'] = ""
+        self._queue_vars['nodes'] = 1
+        self._queue_vars['ppn'] = 1
+        self._queue_vars['queue'] = ""
+        self._queue_vars['outFile'] = ""
+        self._queue_vars['errFile'] = ""
+        self._queue_vars['logFile'] = ""
+        self._queue_vars['jobName'] = ""
+
+    def walltime(self,walltime=''):
+        walltime = str(walltime)
+        if (walltime == '') or (walltime == 'None'):
+            return self._queue_vars['walltime']
+        elif re.match(r'^\d{2}:\d{2}:\d{2}',walltime):
+            self._queue_vars['walltime'] = walltime
+        else:
+            error = "Incorrect walltime format: should be 00:00:00"
+            raise RpQueueError,error
+
+#        walltime = str(walltime)
+#        if re.match(r'^\d{2}:\d{2}:\d{2}',walltime):
+#        else:
+#            try:
+#                walltime = int(walltime)
+#            except:
+#                error = "walltime must match format"
+#        if (walltime <= 0):
+#            return self._queue_vars['walltime']
+#        else:
+#            self._queue_vars['walltime'] = walltime
+
+    def resultsDir(self,resultsDir=''):
+        resultsDir = str(resultsDir)
+        if (resultsDir == 'None') or (resultsDir == ''):
+            return self._queue_vars['resultsDir']
+        else:
+            self._queue_vars['resultsDir'] = resultsDir
+
+    def executable(self,executable=''):
+        executable = str(executable)
+        if (executable == 'None') or (executable == ''):
+            return self._queue_vars['executable']
+        else:
+            self._queue_vars['executable'] = executable
+
+    def execArgs(self,execArgs=''):
+        execArgs = str(execArgs)
+        if (execArgs == 'None') or (execArgs == ''):
+            return self._queue_vars['execArgs']
+        else:
+            self._queue_vars['execArgs'] = execArgs
+
+    def nodes(self,nodes=''):
+        if nodes == '':
+            return self._queue_vars['nodes']
+        nodes = int(nodes)
+        if nodes > 0:
+            self._queue_vars['nodes'] = nodes
+        else:
+            error = 'nodes must be a positive integer'
+            raise RpQueueError, error
+
+    def ppn(self,ppn=''):
+        if ppn == '':
+            return self._queue_vars['ppn']
+        ppn = int(ppn)
+        if ppn > 0:
+            self._queue_vars['ppn'] = ppn
+        else:
+            error = 'ppn must be a positive integer'
+            raise RpQueueError, error
+
+    def queue(self,queue=''):
+        queue = str(queue)
+        if (queue == 'None') or (queue == ''):
+            return self._queue_vars['queue']
+        else :
+            self._queue_vars['queue'] = queue
+
+    def outFile(self,outFile=''):
+        outFile = str(outFile)
+        if (outFile == 'None') or (outFile == ''):
+            return self._queue_vars['outFile']
+        else:
+            self._queue_vars['outFile'] = outFile
+
+    def errFile(self,errFile=''):
+        errFile = str(errFile)
+        if (errFile == 'None') or (errFile == ''):
+            return self._queue_vars['errFile']
+        else:
+            self._queue_vars['errFile'] = errFile
+
+    def logFile(self,logFile=''):
+        logFile = str(logFile)
+        if (logFile == 'None') or (logFile == ''):
+            return self._queue_vars['logFile']
+        else:
+            self._queue_vars['logFile'] = logFile
+
+    def jobName(self,jobName=''):
+        jobName = str(jobName)
+        if jobName == 'None' or (jobName == ''):
+            return self._queue_vars['jobName']
+        else: 
+            self._queue_vars['jobName'] = jobName
+
+    def __convertWalltime__(self):
+        minutesu
+
+    def submit(self):
+        pass
+
+    def status(self):
+        pass
+
+class pbs(queue):
+    """the pbs class organizes the information needed to submit jobs to 
+nanohub's pbs queues through Rappture"""
+
+    def __init__(   self,
+                    jobName,
+                    resultsDir,
+                    nodes,
+                    executable,
+                    execArgs='',
+                    walltime='00:01:00' ):
+
+        # call the base class's init
+        for base in self.__class__.__bases__:
+            callbase(self, base)
+
+        self._pbs_msgs = {}
+        self.__fillStatusDict__()
+
+        # initialize pbs script vars
+        self._pbs_vars = {}
+        self.__initPbsScriptVars__()
+
+        # initialize jobId for this object
+        self._jobId = ""
+
+        # set vars based on user input
+        self.resultsDir(resultsDir)
+        self.jobName(jobName)
+        self.nodes(nodes)
+        self.walltime(walltime)
+        self.executable(executable)
+        self.execArgs(execArgs)
+        self.queue("@vma118.punch.purdue.edu")
+
+    def __initPbsScriptVars__(self):
+        self._pbs_vars['cmd'] = ""
+
+    def __fillStatusDict__(self):
+        # Possible PBS Job States 
+        # From qstat manpage on hamlet.rcac.purdue.edu
+        #   E -  Job is exiting after having run.
+        #   H -  Job is held.
+        #   Q -  job is queued, eligible to run or routed.
+        #   R -  job is running.
+        #   T -  job is being moved to new location.
+        #   W -  job is waiting for its execution time
+        #         (-a option) to be reached.
+        #   S -  job is suspended.
+
+        self._pbs_msgs['E'] = 'Job is exiting after having run'
+        self._pbs_msgs['H'] = 'Job is held'
+        self._pbs_msgs['Q'] = 'Simulation Queued'
+        self._pbs_msgs['R'] = 'Running Simulation'
+        self._pbs_msgs['T'] = 'Job is being moved to new location. Please Wait...'
+        self._pbs_msgs['W'] = 'Job is waiting for its execution time. Please Wait...'
+        self._pbs_msgs['S'] = 'Job is suspended'
+        self._pbs_msgs['DEFAULT'] = 'Returning Results...'
+
+    def __makePbsScript__(self):
+        # create the directory where output should be placed
+        self._resultDirPath = os.path.join(os.getcwd(),self.resultsDir())
+
+        # if os.path.exists(self._resultDirPath):
+        #     shutil.rmtree(self._resultDirPath)
+        # os.mkdir(self._resultDirPath)
+
+        # set the out and err files
+        if self.outFile() == '':
+            self.outFile(os.path.join(self.resultsDir(),self.jobName()+".out"))
+
+        if self.errFile() == '':
+            self.errFile(os.path.join(self.resultsDir(),self.jobName()+".err"))
+
+        # remove existing "FLAG" files if they exist
+        if os.path.isfile(self.outFile()):
+            os.remove(self.outFile())
+        if os.path.isfile(self.errFile()):
+            os.remove(self.errFile())
+
+        if self.cmd() == '':
+            # find the mpirun command
+            mpiCommand = getCommandOutput('which mpirun')
+            if mpiCommand == '':
+                # command not found?
+                error = 'mpirun command not found'
+                raise RpQueueError, error
+            else :
+                mpiCommand = mpiCommand.strip()
+
+            # check to make sure user specified an executable
+            if self._queue_vars['executable'] == '':
+                error = 'executable not set within pbs queue'
+                raise RpQueueError, error
+
+            self.cmd('%s -np %d -machinefile $PBS_NODEFILE %s %s' % \
+                (mpiCommand, self.nodes(), self.executable(), self.execArgs()))
+
+        return """#PBS -S /bin/bash
+#PBS -l nodes=%s:ppn=%s
+#PBS -l walltime=%s
+#PBS -q %s
+#PBS -o %s
+#PBS -e %s
+#PBS -mn
+#PBS -N %s
+cd $PBS_O_WORKDIR
+
+cmd="%s"
+echo == running from $HOSTNAME:
+echo $cmd
+$cmd
+
+touch %s
+""" % ( self.nodes(),
+        self.ppn(),
+        self.walltime(),
+        self.queue(),
+        self.outFile(),
+        self.errFile(),
+        self.jobName(),
+        self.cmd(),
+        self.errFile()   )
+
+    def __checkErrFiles__(self,chkFileName):
+        retVal = False
+        if not os.path.isfile(chkFileName):
+            retVal = True
+        return retVal
+
+    def cmd(self,cmd=''):
+        cmd = str(cmd)
+        if (cmd == 'None') or (cmd == ''):
+            return self._pbs_vars['cmd']
+        else :
+            self._pbs_vars['cmd'] = cmd
+
+    def getCurrentStatus(self):
+        retVal = self._pbs_msgs['DEFAULT']
+        if self._jobId:
+            cmdOutput = getCommandOutput("qstat -a | grep \'^ *%s\'" % (self._jobId))
+            # parse a string that should look like this: 
+            # 32049.hamlet.rc kearneyd ncn      run.21557.   6104   8   8    --  24:00 R 00:00
+            parseResults = cmdOutput.split() # re.compile(r'\W+').split(cmdOutput)
+            # results should look like this:
+            # ['32049.hamlet.rc','kearneyd','ncn','run.21557.','6104','8','8','--','24:00','R','00:00']
+
+            if len(parseResults) > 9:
+                qstat = parseResults[9]
+                retVal = self._pbs_msgs[qstat]
+
+        return '('+self._jobId+') '+retVal
+
+    def submit(self):
+        submitFileData = self.__makePbsScript__()
+        submitFileName = self._resultDirPath+'/'+self.jobName()+'.pbs'
+        writeFile(submitFileName,submitFileData)
+
+        myCWD = os.getcwd()
+        os.chdir(self._resultDirPath)
+        cmdOutData = getCommandOutput('qsub %s' % (submitFileName))
+        os.chdir(myCWD)
+
+        self._prevStatus = ''
+        self._currStatus = ''
+
+        # a successful submission (on hamlet/lear) follows this regexp
+        if re.match(r'[0-9]+',cmdOutData):
+            self._jobId = re.search(r'[0-9]+',cmdOutData).group()
+        else:
+            error = 'Submission to PBS Queue Failed'
+            raise RpQueueError, error
+
+    def status(self):
+        min = 0
+        tCount = 0
+        sleepTime = 10
+
+        while self.__checkErrFiles__(self.errFile()):
+            if tCount == 60 :
+                min += 1
+                tCount = 0
+
+            self._currStatus = self.getCurrentStatus()
+            if (self._currStatus != self._prevStatus):
+                sys.stdout.write("%s: %s\n" % ( self._currStatus, time.ctime() ) )
+                sys.stdout.flush()
+                self._prevStatus = self._currStatus
+
+            time.sleep(sleepTime)
+            tCount += sleepTime
+
+
+
+class condor (queue):
+    # this class is not working!
+
+    USE_MPI = 1
+
+    def __init__(self,walltime='00:01:00',flags=0):
+        # call the base class's init
+        for base in self.__class__.__bases__:
+            callbase(self, base)
+
+        self._condor_msgs = {}
+
+        self._flags = flags
+        self.__setWorkingDir__()
+
+        # set vars based on user input
+        self.resultsDir(resultsDir)
+        self.jobName(jobName)
+        self.nodes(nodes)
+        self.walltime(walltime)
+        self.executable(executable)
+        self.execArgs(execArgs)
+        self.queue("tg_workq@lear")
+        self.outFile("out.$(cluster).$(process)")
+        self.errFile("err.$(cluster).$(process)")
+        self.logFile("log.$(cluster)")
+
+    def __fillStatusDict__(self):
+        self._condor_msgs['I'] = 'Simulation Queued'
+        self._condor_msgs['H'] = 'Simulation Held'
+        self._condor_msgs['R'] = 'Running Simulation'
+        self._condor_msgs['C'] = 'Simulation Complete'
+        self._condor_msgs['X'] = 'Simulation Marked For Deletion'
+        self._condor_msgs['DEFAULT'] = 'Returning Results...'
+
+    def __setWorkingDir__(self):
+        session = os.getenv("SESSION","00000X")
+        epoch = int(time.mktime(datetime.datetime.utcnow().timetuple()))
+        self._workingdir = str(epoch) + "_" + session
+
+    def __makeCondorTemplate__(self):
+#        return """universe=grid
+#    gridresource = gt2 tg-gatekeeper.purdue.teragrid.org:2120/jobmanager-pbs
+#    executable = EXECUTABLE
+#    output = out.$(cluster).$(process)
+#    error = err.$(cluster).$(process)
+#    should_transfer_files = YES
+#    when_to_transfer_output = ON_EXIT
+#    initialDir = MY_RESULT_DIR
+#    log = log.$(cluster)
+#    #globusrsl = (project=TG-ECD060000N)(jobType=mpi)(count=2)(hostcount=2)(maxWallTime=WALLTIME)
+#    globusrsl = (project=TG-ECD060000N)(maxWallTime=WALLTIME)MPIRSL(queue=tg_workq@lear)
+#    notification = never
+#    """
+
+        self._mpirsl = ''
+        if (self.flags & self.USE_MPI):
+            self._mpirsl = "(jobType=mpi)(count=%d)(hostcount=%d)" % \
+                            (self.nodes(), self.nodes())
+
+        return """universe=grid
+    gridresource = gt2 tg-gatekeeper.purdue.teragrid.org:2120/jobmanager-pbs
+    executable = %s
+    output = %s
+    error = %s
+    should_transfer_files = YES
+    when_to_transfer_output = ON_EXIT
+    initialDir = %s
+    log = %s
+    #globusrsl = (project=TG-ECD060000N)(jobType=mpi)(count=2)(hostcount=2)(maxWallTime=WALLTIME)
+    globusrsl = (project=TG-ECD060000N)(maxWallTime=%s)%s(queue=%s)
+    notification = never
+    """ % ( self.executable(),
+            self.outFile(),
+            self.errFile(),
+            self.resultsDir(),
+            self.logFile(),
+            self.resultsDir(),
+            self.walltime(),
+            self._mpirsl,
+            self.queue()    )
+
+    def addProcess(self,argsList,inputFiles=[],):
+#        return """arguments = ARGUMENT resultsID.tar.gz WORKINGDIR_ID
+#    transfer_input_files = INFILE,\\
+#                           APPROOT/data/circle-1.e,\\
+#                           APPROOT/data/circle-1.n,\\
+#                           APPROOT/data/circle-1.d,\\
+#                           APPROOT/data/circle-1.s,\\
+#                           APPROOT/data/circle-1_ni,\\
+#                           APPROOT/data/circle-1.edge,\\
+#                           APPROOT/data/circle-1.ele,\\
+#                           APPROOT/data/circle-1.node
+#    transfer_output_files = resultsID.tar.gz
+#    Queue
+#    """
+        transInFiles = ",\\\\\n\t\t".join(inputFiles)
+        nextProcId = len(self._processList)
+        newProcess = """arguments = %s results%d.tar.gz %s_%d
+    transfer_input_files = %s
+    transfer_output_files = resultsID.tar.gz
+    Queue
+
+    """ % (argList,nextProcId,self._workingdir,nextProcId,transInFiles)
+        self._processList.append(newProcess)
+
+
+#    def chkCondorStatus(chkID):
+    def getCurrentStatus(self):
+        global condor_msgs
+        if chkID:
+            chkCmd = 'condor_q'
+            cmdOutput = getCommandOutput("%s | grep \'^ *%s\'" % (chkCmd,chkID))
+
+            # parse a string that should look like this: 
+            # 61.0   dkearney       12/9  22:47   0+00:00:00 I  0   0.0  nanowire.sh input-
+
+            parseResults = cmdOutput.split() # re.compile(r'\W+').split(cmdOutput)
+
+            # results should look like this:
+            # ['61.0', 'dkearney', '12/9', '22:47', '0+00:00:00', 'I', '0', '0.0', 'nanowire.sh', 'input-']
+
+            retVal = ''
+
+            if len(parseResults) > 6:
+                qstat = parseResults[5]
+                retVal = condor_msgs[qstat]
+
+            if retVal == '':
+                retVal = condor_msgs['DEFAULT']
+
+        return retVal
+
+    def chkCondorLoop(resultTarPathPrefix,numJobs):
+
+        retVal = numJobs
+        for i in xrange(numJobs):
+            resultTarPath = resultTarPathPrefix + str(i) + ".tar.gz"
+
+            # this might be the point of a race condition,
+            # might need to change this to a try/catch statement.
+            # check to see that the result file exists, if not raise error
+            if (not os.path.exists(resultTarPath)):
+                error = 'Condor Result file not created: %s' % (resultTarPath)
+                raise RuntimeError, error
+                sys.exit(-1)
+
+            # check to see that the result tar size is greater than 0
+            resultTarSize = os.path.getsize(resultTarPath)
+            if (resultTarSize):
+                retVal -= 1
+
+        return retVal
+
+    def runCondor ( inputs,
+                    condorScriptPath,
+                    resultDirName ):
+
+        # prepare the user output for printing our job submission info to screen
+
+        jobNodeCnt = int(inputs['Nvg'])
+
+        sys.stdout.write ("Your job is set to use %d node(s)\n" % (jobNodeCnt) )
+        # sys.stdout.write ("with %d processor(s) per node\n" % int(ppn))
+        sys.stdout.write ("Submitting job to queue\n")
+        sys.stdout.flush()
+
+        # submit the condor job
+        condorCmd = 'condor_submit'
+        cmdOutData = getCommandOutput('%s %s' % (condorCmd,condorScriptPath))
+
+        # grab the qID from the return data of the command
+        global qID
+        qID.append(re.search('cluster [0-9]+', cmdOutData).group().split()[1])
+
+        # track condor's progress
+        min = 0
+        tCount = 0
+        sleepTime = 10
+        prevStatus = '?'
+        currStatus = '?'
+        resultTarNamePrefix = 'results'
+        resultTarPathPrefix = resultDirName+'/'+resultTarNamePrefix
+
+        while chkCondorLoop(resultTarPathPrefix,int(inputs['Nvg'])):
+            currStatus = chkCondorStatus(qID[0])
+            if tCount == 60 :
+                min += 1
+                tCount = 0
+            if (currStatus != prevStatus) :
+                sys.stdout.write("%s: %s\n" % ( currStatus, time.ctime() ) )
+                prevStatus = currStatus
+
+            sys.stdout.flush()
+            time.sleep(sleepTime)
+            tCount += sleepTime
+
+
+        outFiles = {}
+        errFiles = {}
+        outfileNamePrefix = "out."
+        errfileNamePrefix = "err."
+        logfileNamePrefix = "log."
+        logfileName = resultDirName + logfileNamePrefix + qID[0]
+
+        for i in xrange(int(inputs['Nvg'])):
+            resultTarName = resultTarNamePrefix + str(i) + ".tar.gz"
+            resultTarPath = resultDirName+'/'+resultTarName
+
+            # check to see that the result file exists, if not raise error
+            if (not os.path.exists(resultTarPath)):
+                error = 'Returned data not found at %s' % (resultTarPath)
+                raise RuntimeError, error
+                sys.exit(-1)
+
+            # prepare to return error files and outfiles
+            outFiles[i] = resultDirName+'/'+outfileNamePrefix+qID[0]+'.'+str(i)
+            errFiles[i] = resultDirName+'/'+errfileNamePrefix+qID[0]+'.'+str(i)
+
+            # check to see that the result tar size is greater than 0
+            resultTarSize = os.path.getsize(resultTarPath)
+            if (resultTarSize):
+                # untar the output and return out and err file texts
+    #           print 'tar --directory %s -xzf %s' % (resultDirName,resultTarPath)
+                untarRslt = getCommandOutput('tar --directory %s -xzf %s' % (resultDirName,resultTarPath))
+    #           print 'untarRslt = %s' % (untarRslt)
+
+            else:
+                # tar file is of zero size, simulation did not have ended properly
+                error = 'Returned file does not contain any data\n Unsuccessful Run'
+                raise RuntimeError, error
+                sys.exit(-1)
+
+        return (logfileName, outFiles, errFiles)
+
+#######################################################################
+# main python script
+#######################################################################
+
+#######################################################################
+
+def createDir(dirName):
+    resultDirPath = os.getcwd() + "/" + dirName
+    if os.path.exists(resultDirPath):
+        shutil.rmtree(resultDirPath)
+    os.mkdir(resultDirPath)
+    return resultDirPath
+
+if __name__ == '__main__':
+
+    nodes = 5
+    walltime = '01:00:00'
+    mpiCommand = getCommandOutput('which mpirun')
+
+    if mpiCommand == '':
+        # command not found?
+        sys.exit(-1)
+    else :
+        mpiCommand = mpiCommand.strip()
+
+    sys.stdout.write("testing hello\n")
+    jobName = 'helloMPITest'
+    resultsDir = createDir('1234')
+    executable = 'hello'
+    shutil.copy('hello/hello',resultsDir)
+    myPBSObj =  pbs(jobName,resultsDir,nodes,executable)
+    myPBSObj.submit()
+    myPBSObj.status()
+    sys.stdout.flush()
+
+    sys.stdout.write("testing cycle\n")
+    jobName = 'cycleMPITest'
+    resultsDir = createDir('5678')
+    cmd = '%s -np %d -machinefile $PBS_NODEFILE cycle' % (mpiCommand,nodes)
+    shutil.copy('cycle/cycle',resultsDir)
+    myPBSObj =  pbs(jobName,resultsDir,nodes,"")
+    myPBSObj.cmd(cmd)
+    myPBSObj.walltime('00:02:00')
+    myPBSObj.submit()
+    myPBSObj.status()
+    sys.stdout.flush()
+
+    # exit the program
+    sys.exit()
+
+#######################################################################
Index: trunk/python/Rappture/signalHandler.py
===================================================================
--- trunk/python/Rappture/signalHandler.py	(revision 497)
+++ trunk/python/Rappture/signalHandler.py	(revision 497)
@@ -0,0 +1,78 @@
+# ----------------------------------------------------------------------
+#
+# ======================================================================
+#  AUTHOR:  Derrick Kearney, Purdue University
+#  Copyright (c) 2005  Purdue Research Foundation, West Lafayette, IN
+# ======================================================================
+
+import sys
+import signal
+
+qID = []
+queue_type = ''
+
+def sigGEN_handler(signal, frame):
+    global qID
+    global queue_type
+    if qID :
+        for id in xrange(len(qID)):
+            sys.stdout.write("Killing job with qID = :%s:\n" % (qID[id]))
+            sys.stdout.flush()
+            if queue_type == 'PBS':
+                rmCmdOut = getCommandOutput('qdel %s' % (qID[id]))
+            elif queue_type == 'Condor':
+                rmCmdOut = getCommandOutput('condor_rm %s' % (qID[id]))
+            else:
+                # unrecognized queue_type
+                break
+            sys.stdout.write("\n%s\n" % rmCmdOut)
+            sys.stdout.flush()
+            time.sleep(10)
+    sys.stdout.write("\nEXITING...\n")
+    sys.stdout.flush()
+    sys.exit(-1)
+
+
+def sigINT_handler(signal, frame):
+    sys.stdout.write('Received SIGINT!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigHUP_handler(signal, frame):
+    sys.stdout.write('Received SIGHUP!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigQUIT_handler(signal, frame):
+    sys.stdout.write('Received SIGQUIT!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigABRT_handler(signal, frame):
+    sys.stdout.write('Received SIGABRT!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigTERM_handler(signal, frame):
+    sys.stdout.write('Received SIGTERM!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigSTOP_handler(signal, frame):
+    sys.stdout.write('Received SIGSTOP!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+def sigKILL_handler(signal, frame):
+    sys.stdout.write('Received SIGKILL!\n')
+    sys.stdout.flush()
+    sigGEN_handler(signal, frame)
+
+signal.signal(signal.SIGINT, sigINT_handler)
+signal.signal(signal.SIGHUP, sigHUP_handler)
+signal.signal(signal.SIGQUIT, sigQUIT_handler)
+signal.signal(signal.SIGABRT, sigABRT_handler)
+signal.signal(signal.SIGTERM, sigTERM_handler)
+#signal.signal(signal.SIGSTOP, sigSTOP_handler)
+#signal.signal(signal.SIGKILL, sigKILL_handler)
+
Index: trunk/python/Rappture/tools.py
===================================================================
--- trunk/python/Rappture/tools.py	(revision 497)
+++ trunk/python/Rappture/tools.py	(revision 497)
@@ -0,0 +1,33 @@
+# ----------------------------------------------------------------------
+#
+# ======================================================================
+#  AUTHOR:  Derrick Kearney, Purdue University
+#  Copyright (c) 2005  Purdue Research Foundation, West Lafayette, IN
+# ======================================================================
+
+import sys, os
+
+def getCommandOutput(command):
+    childin,childout,childerr = os.popen3(command)
+    data = childout.read()
+    err = childerr.read()
+    errcode = childout.close()
+    if err:
+        error = '%s->%s' % (command, err)
+        raise RuntimeError, error
+    return data
+
+def getDriverNumber(driverFileName):
+    driverNumRslt = re.search(r'[0-9]+',os.path.split(driverFileName)[1])
+    if driverNumRslt == None:
+        return None
+    return driverNumRslt.group()
+
+
+def writeFile(fileName,text):
+    file_object = open(fileName, "w")
+    if file_object:
+        file_object.write(text)
+        file_object.close()
+    else:
+        raise RuntimeError, 'could not open %s for writing' % (fileName)
Index: trunk/python/setup.py.in
===================================================================
--- trunk/python/setup.py.in	(revision 497)
+++ trunk/python/setup.py.in	(revision 497)
@@ -0,0 +1,23 @@
+from distutils.core import setup, Extension
+
+rp_install_dir = '@prefix@'
+
+module = Extension('Rappture.Units',
+                   include_dirs = [rp_install_dir+'/include/core'],
+                   sources = [ 'Rappture/PyRpUnits.cc' ],
+                   library_dirs = [ rp_install_dir+'/lib' ],
+                   libraries = [ 'rappture' ] )
+
+setup(  name='Rappture',
+        version='0.1',
+        description='Rapid Application Infrastructure library for nanoHUB.org',
+        url='http://www.nanohub.org/',
+        py_modules=[ 'Rappture.library',
+                     'Rappture.interface',
+                     'Rappture.number',
+                     'Rappture.queue',
+                     'Rappture.signalHandler',
+                     'Rappture.tools',
+                     'Rappture.result'],
+        ext_modules=[module]
+  )
