From: Stefan Metzmacher Date: Tue, 28 Jan 2025 11:02:08 +0000 (+0100) Subject: pidl:Python: generate nicer code for PyNdrRpcMethodDef arrays X-Git-Tag: samba-4.20.8~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b301d10f6da4129a1d0da39bf05487d2c06b0194;p=thirdparty%2Fsamba.git pidl:Python: generate nicer code for PyNdrRpcMethodDef arrays BUG: https://bugzilla.samba.org/show_bug.cgi?id=14213 Signed-off-by: Stefan Metzmacher Reviewed-by: Douglas Bagnall (cherry picked from commit fa6d0fd1b00e4836215b4d80f1a9f527db82e01a) --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index c09ee4b784d..53dcf142de6 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1417,9 +1417,23 @@ sub Interface($$$) $self->indent; foreach my $d (@fns) { my ($infn, $outfn, $callfn, $prettyname, $docstring, $opnum) = @$d; - $self->pidl("{ \"$prettyname\", $docstring, (py_dcerpc_call_fn)$callfn, (py_data_pack_fn)$infn, (py_data_unpack_fn)$outfn, $opnum, &ndr_table_$interface->{NAME} },"); + $self->pidl("{"); + $self->indent; + $self->pidl(".name = \"$prettyname\","); + $self->pidl(".doc = $docstring,"); + $self->pidl(".call = (py_dcerpc_call_fn)$callfn,"); + $self->pidl(".pack_in_data = (py_data_pack_fn)$infn,"); + $self->pidl(".unpack_out_data = (py_data_unpack_fn)$outfn,"); + $self->pidl(".opnum = $opnum,"); + $self->pidl(".table = &ndr_table_$interface->{NAME},"); + $self->deindent; + $self->pidl("},"); } - $self->pidl("{0}"); + $self->pidl("{"); + $self->indent; + $self->pidl(".name = NULL,"); + $self->deindent; + $self->pidl("},"); $self->deindent; $self->pidl("};"); $self->pidl("");