[cig-commits] r5126 - in long/3D/Gale/trunk/src/StGermain: . Base/Context/Python Base/Python/Bindings/Context

walter at geodynamics.org walter at geodynamics.org
Tue Oct 31 13:27:16 PST 2006


Author: walter
Date: 2006-10-31 13:27:16 -0800 (Tue, 31 Oct 2006)
New Revision: 5126

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Base/Context/Python/Context.py
   long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.c
   long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.h
Log:
 r3109 at earth:  boo | 2006-10-31 13:26:10 -0800
  r3087 at earth (orig r3864):  SteveQuenette | 2006-10-16 02:21:03 -0700
  python bindings updated to newer vmake logic and context form (should compile but not yet tested)
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3085
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3863
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3109
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3864

Modified: long/3D/Gale/trunk/src/StGermain/Base/Context/Python/Context.py
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Context/Python/Context.py	2006-10-31 21:26:25 UTC (rev 5125)
+++ long/3D/Gale/trunk/src/StGermain/Base/Context/Python/Context.py	2006-10-31 21:27:16 UTC (rev 5126)
@@ -39,21 +39,22 @@
 	def Print( self ):
 		return bindings.Print( self._handle )
 	
-	def Init( self ):
-		return bindings.Init( self._handle )
+	def Construct( self ):
+		self._handle = bindings.Construct( self._handle )
+		return Py_None
 	
-	def Run( self ):
-		return bindings.Run( self._handle )
-	
 	def Build( self ):
-		return bindings.Build( self._handle, self.dictionary._handle )
+		return bindings.Build( self._handle )
 	
-	def Setup( self ):
-		return bindings.Setup( self._handle )
-		
 	def Initialise( self ):
 		return bindings.Initialise( self._handle )
 	
+	def Execute( self ):
+		return bindings.Execute( self._handle )
+		
+	def Destroy( self ):
+		return bindings.Destroy( self._handle )
+		
 	def Dt( self ):
 		return bindings.Dt( self._handle )
 	
@@ -68,8 +69,8 @@
 	def handle(self):
 		return self._handle
 
-	def Stg_Class_Delete( self ):
-		return bindings.Stg_Class_Delete( self._handle )
+	def Delete( self ):
+		return bindings.Delete( self._handle )
 
 	def SetTime( self, time ):	
 		bindings.SetTime( self._handle, time )

Modified: long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.c	2006-10-31 21:26:25 UTC (rev 5125)
+++ long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.c	2006-10-31 21:27:16 UTC (rev 5126)
@@ -39,16 +39,16 @@
 	{ Context_Python_copyright__name__,	Context_Python_copyright,	METH_VARARGS, Context_Python_copyright__doc__		},
 	{ Context_Python_Print__name__,		Context_Python_Print,		METH_VARARGS, Context_Python_Print__doc__		},
 	{ Context_Python_Delete__name__,	Context_Python_Delete,		METH_VARARGS, Context_Python_Delete__doc__		},
-	{ Context_Python_Init__name__,		Context_Python_Init,		METH_VARARGS, Context_Python_Init__doc__		},
-	{ Context_Python_Run__name__,		Context_Python_Run,		METH_VARARGS, Context_Python_Run__doc__			},
+	{ Context_Python_Construct__name__,	Context_Python_Construct,	METH_VARARGS, Context_Python_Construct__doc__		},
 	{ Context_Python_Build__name__,		Context_Python_Build,		METH_VARARGS, Context_Python_Build__doc__		},
-	{ Context_Python_Setup__name__,		Context_Python_Setup,		METH_VARARGS, Context_Python_Setup__doc__		},
 	{ Context_Python_Initialise__name__,	Context_Python_Initialise,	METH_VARARGS, Context_Python_Initialise__doc__		},
+	{ Context_Python_Execute__name__,	Context_Python_Execute,		METH_VARARGS, Context_Python_Execute__doc__		},
+	{ Context_Python_Destroy__name__,	Context_Python_Destroy,		METH_VARARGS, Context_Python_Destroy__doc__		},
 	{ Context_Python_Dt__name__,		Context_Python_Dt,		METH_VARARGS, Context_Python_Dt__doc__			},
 	{ Context_Python_Step__name__,		Context_Python_Step,		METH_VARARGS, Context_Python_Step__doc__		},
 	{ Context_Python_GetDictionary__name__,	Context_Python_GetDictionary,	METH_VARARGS, Context_Python_GetDictionary__doc__	},
 	{ Context_Python_SetTime__name__,	Context_Python_SetTime,		METH_VARARGS, Context_Python_SetTime__doc__		},
-	{ Context_Python_SetTimeStep__name__,	Context_Python_SetTimeStep,		METH_VARARGS, Context_Python_SetTimeStep__doc__		},
+	{ Context_Python_SetTimeStep__name__,	Context_Python_SetTimeStep,	METH_VARARGS, Context_Python_SetTimeStep__doc__		},
 	{ 0, 0, 0, 0 }
 };
 
@@ -75,9 +75,9 @@
 	return Py_None;
 }
 
-/* "Stg_Class_Delete" member */
-char Context_Python_Delete__doc__[] = "Stg_Class_Delete/destroy the Context";
-char Context_Python_Delete__name__[] = "Stg_Class_Delete";
+/* "Delete" member */
+char Context_Python_Delete__doc__[] = "Delete/destroy the Context";
+char Context_Python_Delete__name__[] = "Delete";
 PyObject* Context_Python_Delete( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
 	Context*	context;
@@ -96,31 +96,30 @@
 	return Py_None;
 }
 
-/* "Init" member */
-char Context_Python_Init__doc__[] = "Build and initialise the Context";
-char Context_Python_Init__name__[] = "Init";
-PyObject* Context_Python_Init( PyObject* self, PyObject* args ) {
+/* "Construct" member */
+char Context_Python_Construct__doc__[] = "Construct the Context...";
+char Context_Python_Construct__name__[] = "Construct";
+PyObject* Context_Python_Construct( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
 	Context*	context;
-	
+
 	/* Obtain arguements */
 	if( !PyArg_ParseTuple( args, "O:", &pyContext ) ) {
 		return NULL;
 	}
 	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
-	
-	/* Run function */
-	AbstractContext_Setup( context );
-	
+
+	Stg_Component_Construct( context, 0 /* dummy */, &context, True );
+
 	/* Return */
 	Py_INCREF( Py_None );
-	return Py_None;
-}
+	return PyCObject_FromVoidPtr( context, 0 );
+	}
 
-/* "Run" member */
-char Context_Python_Run__doc__[] = "Run the Context";
-char Context_Python_Run__name__[] = "Run";
-PyObject* Context_Python_Run( PyObject* self, PyObject* args ) {
+/* "Build" member */
+char Context_Python_Build__doc__[] = "Build the Context... allocates memory (builds arrays)";
+char Context_Python_Build__name__[] = "Build";
+PyObject* Context_Python_Build( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
 	Context*	context;
 	
@@ -130,84 +129,59 @@
 	}
 	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
 	
-	/* Run function */
-	_AbstractContext_Execute( context, NULL );
+	Stg_Component_Build( context, 0 /* dummy */, False );
 	
 	/* Return */
 	Py_INCREF( Py_None );
 	return Py_None;
 }
 
-/* "Build" member */
-char Context_Python_Build__doc__[] = "Build the Context... allocates memory (builds arrays)";
-char Context_Python_Build__name__[] = "Build";
-PyObject* Context_Python_Build( PyObject* self, PyObject* args ) {
+/* "Initialise" member */
+char Context_Python_Initialise__doc__[] = "Initialise the Context ... initialises memory (fills arrays with initial values)";
+char Context_Python_Initialise__name__[] = "Initialise";
+PyObject* Context_Python_Initialise( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
-	PyObject*	pyDictionary;
 	Context*	context;
-	Dictionary*	dictionary;
-	Dictionary*	componentDict;
 	
 	/* Obtain arguements */
-	if( !PyArg_ParseTuple( args, "OO:", &pyContext, &pyDictionary ) ) {
+	if( !PyArg_ParseTuple( args, "O:", &pyContext ) ) {
 		return NULL;
 	}
 	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
-	dictionary = (Dictionary*)( PyCObject_AsVoidPtr( pyDictionary ) );
 	
 	/* Run function */
-	componentDict = Dictionary_GetDictionary( dictionary, "components" );
-
-	if ( componentDict == NULL ) {
-		componentDict = Dictionary_New();
-	}
-	context->CF = Stg_ComponentFactory_New( dictionary, componentDict, context->register_Register );
-
-	LiveComponentRegister_Add( context->CF->LCRegister, (Stg_Component*) context );
-	PluginsManager_Load( context->plugins, context, dictionary );
-
-	Stg_ComponentFactory_CreateComponents( context->CF );
-	Stg_ComponentFactory_ConstructComponents( context->CF );
-	PluginsManager_ConstructPlugins( context->plugins, context->CF );
-
-	PluginsManager_Load( context->plugins, context, dictionary );
-	KeyCall( context, context->constructExtensionsK, EntryPoint_VoidPtr_CallCast* )( KeyHandle(context,context->constructExtensionsK), context );
-	Journal_ReadFromDictionary( dictionary );
-
-	EntryPoint_Remove( Context_GetEntryPoint( context, AbstractContext_EP_Build ), "BuildAllLiveComponents" );
-
-	KeyCall( context, context->buildK, EntryPoint_VoidPtr_CallCast* )( KeyHandle(context,context->buildK), context );
-/*	AbstractContext_Build( context ); */
+	Stg_Component_Initialise( context, 0 /* dummy */, False );
 	
 	/* Return */
 	Py_INCREF( Py_None );
 	return Py_None;
 }
 
-/* "Setup" member */
-char Context_Python_Setup__doc__[] = "Setup the Context...";
-char Context_Python_Setup__name__[] = "Setup";
-PyObject* Context_Python_Setup( PyObject* self, PyObject* args ) {
+/* "Execute" member */
+char Context_Python_Execute__doc__[] = "Run the Context";
+char Context_Python_Execute__name__[] = "Run";
+PyObject* Context_Python_Execute( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
 	Context*	context;
-
+	
 	/* Obtain arguements */
 	if( !PyArg_ParseTuple( args, "O:", &pyContext ) ) {
 		return NULL;
 	}
 	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
-
-	AbstractContext_Setup( context );
-
+	
+	/* Run function */
+	Stg_Component_Execute( context, 0 /* dummy */, False );
+	
 	/* Return */
 	Py_INCREF( Py_None );
 	return Py_None;
 }
 
-/* "Init" member */
-char Context_Python_Initialise__doc__[] = "Initialise the Context ... initialises memory (fills arrays with initial values)";
-char Context_Python_Initialise__name__[] = "Initialise";
-PyObject* Context_Python_Initialise( PyObject* self, PyObject* args ) {
+/* "Destroy" member */
+char Context_Python_Destroy__doc__[] = "Destroy the Context";
+char Context_Python_Destroy__name__[] = "Destroy";
+PyObject* Context_Python_Destroy( PyObject* self, PyObject* args ) {
 	PyObject*	pyContext;
 	Context*	context;
 	
@@ -218,7 +192,7 @@
 	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
 	
 	/* Run function */
-	_AbstractContext_Initialise( context, NULL );
+	Stg_Component_Destroy( context, 0 /* dummy */, False );
 	
 	/* Return */
 	Py_INCREF( Py_None );

Modified: long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.h	2006-10-31 21:26:25 UTC (rev 5125)
+++ long/3D/Gale/trunk/src/StGermain/Base/Python/Bindings/Context/bindings.h	2006-10-31 21:27:16 UTC (rev 5126)
@@ -50,26 +50,26 @@
 	extern char Context_Python_Delete__doc__[];
 	PyObject* Context_Python_Delete( PyObject* self, PyObject* args );
 	
-	extern char Context_Python_Init__name__[];
-	extern char Context_Python_Init__doc__[];
-	PyObject* Context_Python_Init( PyObject* self, PyObject* args );
+	extern char Context_Python_Construct__name__[];
+	extern char Context_Python_Construct__doc__[];
+	PyObject* Context_Python_Construct( PyObject* self, PyObject* args );
 	
-	extern char Context_Python_Run__name__[];
-	extern char Context_Python_Run__doc__[];
-	PyObject* Context_Python_Run( PyObject* self, PyObject* args );
-	
 	extern char Context_Python_Build__name__[];
 	extern char Context_Python_Build__doc__[];
 	PyObject* Context_Python_Build( PyObject* self, PyObject* args );
 	
-	extern char Context_Python_Setup__name__[];
-	extern char Context_Python_Setup__doc__[];
-	PyObject* Context_Python_Setup( PyObject* self, PyObject* args );
-	
 	extern char Context_Python_Initialise__name__[];
 	extern char Context_Python_Initialise__doc__[];
 	PyObject* Context_Python_Initialise( PyObject* self, PyObject* args );
 	
+	extern char Context_Python_Execute__name__[];
+	extern char Context_Python_Execute__doc__[];
+	PyObject* Context_Python_Execute( PyObject* self, PyObject* args );
+	
+	extern char Context_Python_Destroy__name__[];
+	extern char Context_Python_Destroy__doc__[];
+	PyObject* Context_Python_Destroy( PyObject* self, PyObject* args );
+	
 	extern char Context_Python_Dt__name__[];
 	extern char Context_Python_Dt__doc__[];
 	PyObject* Context_Python_Dt( PyObject* self, PyObject* args );



More information about the cig-commits mailing list