]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pylibsmb: Add template code
authorVolker Lendecke <vl@samba.org>
Thu, 3 Nov 2022 11:37:58 +0000 (12:37 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 22 Nov 2022 18:27:33 +0000 (18:27 +0000)
I've looked this up in my samples too often :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/pylibsmb.c

index 2cee63a76c3bf417608018944971229841950107..dea156d623ccda5309497d19177ca63977d69b09 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+/*
+Template code to use this library:
+
+-------------------------
+from samba.samba3 import libsmb_samba_internal as libsmb
+from samba.samba3 import param as s3param
+from samba import (credentials,NTSTATUSError)
+
+lp = s3param.get_context()
+lp.load("/etc/samba/smb.conf");
+
+creds = credentials.Credentials()
+creds.guess(lp)
+creds.set_username("administrator")
+creds.set_password("1234")
+
+c = libsmb.Conn("127.0.0.1",
+                "tmp",
+                lp,
+                creds,
+                multi_threaded=True)
+-------------------------
+*/
+
 #include <Python.h>
 #include "includes.h"
 #include "python/py3compat.h"