[Avida-cvs] [Avida2-svn] r135 - branches/developers/kaben-organism-scope/source/bindings/Boost.Python

kaben at myxo.css.msu.edu kaben at myxo.css.msu.edu
Fri Apr 8 22:50:16 PDT 2005


Author: kaben
Date: 2005-04-09 01:50:16 -0400 (Sat, 09 Apr 2005)
New Revision: 135

Modified:
   branches/developers/kaben-organism-scope/source/bindings/Boost.Python/CMakeLists.txt
   branches/developers/kaben-organism-scope/source/bindings/Boost.Python/test_cpu.pyste
Log:

* Repairs to broken python bindings to cTestCPU.



Modified: branches/developers/kaben-organism-scope/source/bindings/Boost.Python/CMakeLists.txt
===================================================================
--- branches/developers/kaben-organism-scope/source/bindings/Boost.Python/CMakeLists.txt	2005-04-09 05:49:48 UTC (rev 134)
+++ branches/developers/kaben-organism-scope/source/bindings/Boost.Python/CMakeLists.txt	2005-04-09 05:50:16 UTC (rev 135)
@@ -209,6 +209,7 @@
   genesis-fixups.cc
   hardware_cpu-fixups.cc
   py_avida_driver-fixups.cc
+  test_cpu-fixups.cc
 )
 
 ADD_LIBRARY(PyAvidaRepairHacks SHARED ${PyAvida_Extra_Cpp_Files})

Modified: branches/developers/kaben-organism-scope/source/bindings/Boost.Python/test_cpu.pyste
===================================================================
--- branches/developers/kaben-organism-scope/source/bindings/Boost.Python/test_cpu.pyste	2005-04-09 05:49:48 UTC (rev 134)
+++ branches/developers/kaben-organism-scope/source/bindings/Boost.Python/test_cpu.pyste	2005-04-09 05:50:16 UTC (rev 135)
@@ -6,26 +6,24 @@
 Include("population_interface.hh")
 Include("resource_count.hh")
 
-cTestCPU = Class("cTestCPU", "test_cpu.hh")
-print("""
-XXX in test_cpu.pyste: cTestCPU.GetInstSet needs autopointer to protect
-ownership.
-""")
+cTestCPU = Class("cTestCPU", "test_cpu-fixups.hh")
 set_policy(cTestCPU.GetInstSet, return_value_policy(reference_existing_object))
-print("""
-XXX in test_cpu.pyste: cTestCPU.GetEnvironment needs autopointer to protect
-ownership.
-""")
 set_policy(cTestCPU.GetEnvironment, return_value_policy(reference_existing_object))
-print("""
-XXX in test_cpu.pyste: cTestCPU.GetResources needs autopointer to protect
-ownership.
-""")
 set_policy(cTestCPU.GetResources, return_value_policy(reference_existing_object))
 set_policy(cTestCPU.GetResourceCount, return_value_policy(reference_existing_object))
+exclude(cTestCPU.UseResources)
+
+exclude(cTestCPU.UseResources)
+add_method(cTestCPU, "cTestCPU_GetUseResources");
+add_method(cTestCPU, "cTestCPU_SetUseResources");
+rename(cTestCPU.cTestCPU_GetUseResources, "GetUseResources");
+rename(cTestCPU.cTestCPU_SetUseResources, "SetUseResources");
+class_code(cTestCPU, '.add_property("UseResources", &cTestCPU_GetUseResources, &cTestCPU_SetUseResources)');
+
 print("""
-XXX in test_cpu.pyste: cTestCPU.UseResources temporarily disabled
-because it returns a reference to built-in type, which makes Pyste kinda
-cranky.
+XXX in test_cpu.pyste:
+- cTestCPU.GetInstSet needs autopointer to protect ownership.
+- cTestCPU.GetEnvironment needs autopointer to protect ownership.
+- cTestCPU.GetResources needs autopointer to protect ownership.
+- cTestCPU.GetResourceCount needs autopointer to protect ownership.
 """)
-exclude(cTestCPU.UseResources)




More information about the Avida-cvs mailing list