svn commit: samba r26658 - in branches/SAMBA_4_0: . source/librpc source/pidl/lib/Parse/Pidl/Samba4 source/scripting/python

jelmer at samba.org jelmer at samba.org
Thu Jan 3 21:45:19 GMT 2008


Author: jelmer
Date: 2008-01-03 21:45:18 +0000 (Thu, 03 Jan 2008)
New Revision: 26658

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26658

Log:
pidl: Register Python modules.
librpc: Build Python module for the echo pipe, for testing purposes.

Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/librpc/config.mk
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
   branches/SAMBA_4_0/source/scripting/python/modules.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:file-ids
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/librpc/config.mk
===================================================================
--- branches/SAMBA_4_0/source/librpc/config.mk	2008-01-03 21:21:16 UTC (rev 26657)
+++ branches/SAMBA_4_0/source/librpc/config.mk	2008-01-03 21:45:18 UTC (rev 26658)
@@ -594,3 +594,7 @@
 [PYTHON::swig_dcerpc]
 SWIG_FILE = rpc/dcerpc.i
 PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-CONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
+
+[PYTHON::python_echo]
+OBJ_FILES = gen_ndr/py_echo.o
+PRIVATE_DEPENDENCIES = NDR_ECHO

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Python.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Python.pm	2008-01-03 21:21:16 UTC (rev 26657)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Python.pm	2008-01-03 21:45:18 UTC (rev 26658)
@@ -54,7 +54,7 @@
     my($self,$basename,$ndr,$hdr) = @_;
     
     my $py_hdr = $hdr;
-    $py_hdr =~ s/^/py_/g;
+    $py_hdr =~ s/ndr_([^\/]+)$/py_$1/g;
 
     $self->pidl_hdr("/* header auto-generated by pidl */\n\n");
 	
@@ -66,10 +66,20 @@
 #include \"$py_hdr\"
 
 ");
+	
+	$self->pidl("static PyMethodDef $basename\_methods[] = {");
+	$self->indent;
+	$self->pidl("{ NULL, NULL, 0, NULL }");
+	$self->deindent;
+	$self->pidl("};");
 
+	$self->pidl("");
+
 	$self->pidl("void init$basename(void)");
 	$self->pidl("{");
 	$self->indent;
+	$self->pidl("PyObject *m;");
+	$self->pidl("m = Py_InitModule((char *)\"$basename\", $basename\_methods);");
 	# FIXME
 	$self->deindent;
 	$self->pidl("}");

Modified: branches/SAMBA_4_0/source/scripting/python/modules.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/modules.c	2008-01-03 21:21:16 UTC (rev 26657)
+++ branches/SAMBA_4_0/source/scripting/python/modules.c	2008-01-03 21:45:18 UTC (rev 26658)
@@ -34,6 +34,7 @@
 extern void init_events(void);
 extern void inituuid(void);
 extern void init_net(void);
+extern void initecho(void);
 
 static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };
 



More information about the samba-cvs mailing list