diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-04-08 02:08:31 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-04-08 02:08:31 +0200 |
commit | b99d24419f9934ab5467f11a5f59d34618686c91 (patch) | |
tree | 30c60a53eebbff0c6a38f155756275b194773f56 /source4 | |
parent | 0bea00f481ffa0fd20457fbe4c448bfac93940b5 (diff) | |
download | samba-b99d24419f9934ab5467f11a5f59d34618686c91.tar.gz samba-b99d24419f9934ab5467f11a5f59d34618686c91.tar.bz2 samba-b99d24419f9934ab5467f11a5f59d34618686c91.zip |
Add signature of connect function to docstrings.
(This used to be commit 51441376d37de01f7f4bd795947fc2c46c38e3f1)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba4/Python.pm | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm index bd124e79e5..40c0cd51cb 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -232,7 +232,7 @@ sub PythonStruct($$$$$$) $self->pidl_hdr("#define $name\_Check(op) PyObject_TypeCheck(op, &$name\_Type)\n"); $self->pidl_hdr("#define $name\_CheckExact(op) ((op)->ob_type == &$name\_Type)\n"); $self->pidl_hdr("\n"); - my $docstring = $self->DocString($d, $name); + my $docstring = ($self->DocString($d, $name) or "NULL"); my $typeobject = "$name\_Type"; $self->pidl("PyTypeObject $typeobject = {"); $self->indent; @@ -374,10 +374,10 @@ sub PythonFunction($$$) $self->pidl("}"); $self->pidl(""); - if ($docstring eq "NULL") { - $docstring = "\"$signature\""; - } else { + if ($docstring) { $docstring = "\"$signature\\n\\n\"$docstring"; + } else { + $docstring = "\"$signature\""; } return ($fnname, $docstring); @@ -468,12 +468,12 @@ sub DocString($$$) { my ($self, $d, $name) = @_; if (has_property($d, "helpstring")) { - my $docstring = "py_doc_$name"; - $self->pidl("static const char ".$docstring."[] = ".has_property($d, "helpstring").";"); + my $docstring = uc("py_doc_$name"); + $self->pidl("#define $docstring ".has_property($d, "helpstring")); return $docstring; } - return "NULL"; + return undef; } sub Interface($$$) @@ -602,8 +602,21 @@ sub Interface($$$) $self->pidl(""); + my $signature = +"\"$interface->{NAME}(binding, lp_ctx=None, credentials=None) -> Connection to DCE/RPC interface.\\n\" +\"\\n\" +\"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\\n\" +\"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\\n\" +\"credentials should be a credentials.Credentials object.\\n\\n\""; my $docstring = $self->DocString($interface, $interface->{NAME}); + + if ($docstring) { + $docstring = "$signature$docstring"; + } else { + $docstring = $signature; + } + $self->pidl("PyTypeObject $interface->{NAME}_InterfaceType = {"); $self->indent; $self->pidl("PyObject_HEAD_INIT(NULL) 0,"); |