From 53ae9bc9f6f66578948c3995073bdc1f1acae0f1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 13:48:09 +0100 Subject: r26248: Check in SWIG output so SWIG is not required when running out of svn. (This used to be commit 08501fbef38f81ce5ff4885a1696f9cb392fd631) --- source4/scripting/python/misc.py | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 source4/scripting/python/misc.py (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py new file mode 100644 index 0000000000..94625be2c9 --- /dev/null +++ b/source4/scripting/python/misc.py @@ -0,0 +1,53 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.33 +# +# Don't modify this file, modify the SWIG interface instead. +# This file is compatible with both classic and new-style classes. + +import _misc +import new +new_instancemethod = new.instancemethod +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'PySwigObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +random_password = _misc.random_password + + -- cgit From 68dc2dc526e146dd0ac68d5d68eb55b601282caf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 14:31:01 +0100 Subject: r26399: Use -O option for SWIG (less evil generated code). (This used to be commit 3378b6a559272cb702b52966692bf423f67a2b41) --- source4/scripting/python/misc.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 94625be2c9..afe7b723e0 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -2,7 +2,6 @@ # Version 1.3.33 # # Don't modify this file, modify the SWIG interface instead. -# This file is compatible with both classic and new-style classes. import _misc import new @@ -48,6 +47,16 @@ except AttributeError: del types +def _swig_setattr_nondynamic_method(set): + def set_attr(self,name,value): + if (name == "thisown"): return self.this.own(value) + if hasattr(self,name) or (name == "this"): + set(self,name,value) + else: + raise AttributeError("You cannot add attributes to %s" % self) + return set_attr + + random_password = _misc.random_password -- cgit From 0a01f50f9802ecfae430d2218af3b96a3682218d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 16 Dec 2007 15:50:02 +0100 Subject: r26475: Add ldb.set_credentials function. (This used to be commit dbebb4ef477d2c8de7b8d1e5cde9b9dada47044f) --- source4/scripting/python/misc.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index afe7b723e0..94b341ba72 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -57,6 +57,10 @@ def _swig_setattr_nondynamic_method(set): return set_attr +import ldb +import credentials +import param random_password = _misc.random_password +ldb_set_credentials = _misc.ldb_set_credentials -- cgit From 440fd879613b94cc75eb0737af91602d96c89bf9 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 16 Dec 2007 17:17:37 +0100 Subject: r26477: Allow setting loadparm context for a ldb context in python, plus some other minor improvements. (This used to be commit d88527a9d6435203faa8273347d5aa41937e5395) --- source4/scripting/python/misc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 94b341ba72..8a8ff80107 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -62,5 +62,6 @@ import credentials import param random_password = _misc.random_password ldb_set_credentials = _misc.ldb_set_credentials +ldb_set_loadparm = _misc.ldb_set_loadparm -- cgit From b0360e3a8617c59661d0b0fd805666e6cefcd811 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 08:20:20 +0100 Subject: r26496: Move some provision functions to a new SamDB class, support setting session_info on a ldb context from python. (This used to be commit 75cfb0d609687538048a7d72a499a5205af46a34) --- source4/scripting/python/misc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 8a8ff80107..7628dbcb15 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -62,6 +62,7 @@ import credentials import param random_password = _misc.random_password ldb_set_credentials = _misc.ldb_set_credentials +ldb_set_session_info = _misc.ldb_set_session_info ldb_set_loadparm = _misc.ldb_set_loadparm -- cgit From f89c7a6e5eb082794d64b487e69fc442d138ca28 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 12:07:51 +0100 Subject: r26505: Add python bindings for some samdb-related functions, improve provisioning in python. (This used to be commit d2402251666738c0372bbbaeaa1d26c06e254033) --- source4/scripting/python/misc.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 7628dbcb15..525869ff58 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -60,9 +60,12 @@ def _swig_setattr_nondynamic_method(set): import ldb import credentials import param +import security random_password = _misc.random_password ldb_set_credentials = _misc.ldb_set_credentials ldb_set_session_info = _misc.ldb_set_session_info ldb_set_loadparm = _misc.ldb_set_loadparm +samdb_set_domain_sid = _misc.samdb_set_domain_sid +dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file -- cgit From ca74c6e6c426e6b69ba31676e2b06dda29b5409e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 17 Dec 2007 20:03:06 +0100 Subject: r26513: Update substitution dictionary for ldifs. (This used to be commit 60fb2de2119cb2f42f858868e39c3b0d303ac20f) --- source4/scripting/python/misc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 525869ff58..228ab24dbf 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -67,5 +67,6 @@ ldb_set_session_info = _misc.ldb_set_session_info ldb_set_loadparm = _misc.ldb_set_loadparm samdb_set_domain_sid = _misc.samdb_set_domain_sid dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file +version = _misc.version -- cgit From 63f53094efa29b76eb4136cddf19d9c5d325fc5f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 18 Dec 2007 02:21:14 +0100 Subject: r26520: More Python updates. (This used to be commit a8b1fe15ac853082961132ede061fe1556ae29f7) --- source4/scripting/python/misc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 228ab24dbf..ae900a1f62 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -68,5 +68,7 @@ ldb_set_loadparm = _misc.ldb_set_loadparm samdb_set_domain_sid = _misc.samdb_set_domain_sid dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file version = _misc.version +dsdb_set_global_schema = _misc.dsdb_set_global_schema +ldb_register_samba_handlers = _misc.ldb_register_samba_handlers -- cgit From 859b847a68cf10526b9f356ebcb328e7334a8cb1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 24 Jan 2008 22:08:39 +0100 Subject: python: Add bindings for SamDB.set_invocation_id(). (This used to be commit c09efa7b778f9cb29032a6abfd914fcaae8df163) --- source4/scripting/python/misc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index ae900a1f62..998de46504 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -70,5 +70,6 @@ dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file version = _misc.version dsdb_set_global_schema = _misc.dsdb_set_global_schema ldb_register_samba_handlers = _misc.ldb_register_samba_handlers +samdb_set_ntds_invocation_id = _misc.samdb_set_ntds_invocation_id -- cgit From 8afcbdcfe71fad0f6a22314de16ac047148d42b8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 25 Jan 2008 00:51:09 +0100 Subject: python: Make SamDB.set_ntds_invocation_id take a string. (This used to be commit 59bb26772f089cf4d8727c12230cfef8126762b1) --- source4/scripting/python/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 998de46504..2fc7fe37e7 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -70,6 +70,6 @@ dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file version = _misc.version dsdb_set_global_schema = _misc.dsdb_set_global_schema ldb_register_samba_handlers = _misc.ldb_register_samba_handlers -samdb_set_ntds_invocation_id = _misc.samdb_set_ntds_invocation_id +dsdb_set_ntds_invocation_id = _misc.dsdb_set_ntds_invocation_id -- cgit From ca78fa8cae96099055a6ae7a0963c2b2789f2b87 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Apr 2008 11:53:28 +0200 Subject: Re-run SWIG (This used to be commit 2f8010582607ad7389cac3de4945ea0ee46941b3) --- source4/scripting/python/misc.py | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 2fc7fe37e7..f1da4c687a 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -71,5 +71,6 @@ version = _misc.version dsdb_set_global_schema = _misc.dsdb_set_global_schema ldb_register_samba_handlers = _misc.ldb_register_samba_handlers dsdb_set_ntds_invocation_id = _misc.dsdb_set_ntds_invocation_id +private_path = _misc.private_path -- cgit From 73e2fc95901afbc71000461e7613515ca906bcff Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 22 May 2008 17:33:23 +0200 Subject: Add docstrings in misc python module. (This used to be commit 5bf15122e6bb6dcbc2abd325db9522b2084d975f) --- source4/scripting/python/misc.py | 50 ++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index f1da4c687a..25e8d2de8c 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.33 +# Version 1.3.35 # # Don't modify this file, modify the SWIG interface instead. @@ -62,14 +62,50 @@ import credentials import param import security random_password = _misc.random_password -ldb_set_credentials = _misc.ldb_set_credentials -ldb_set_session_info = _misc.ldb_set_session_info -ldb_set_loadparm = _misc.ldb_set_loadparm -samdb_set_domain_sid = _misc.samdb_set_domain_sid + +def ldb_set_credentials(*args, **kwargs): + """ + S.set_credentials(credentials) + Set credentials to use when connecting. + """ + return _misc.ldb_set_credentials(*args, **kwargs) + +def ldb_set_session_info(*args, **kwargs): + """ + S.set_session_info(session_info) + Set session info to use when connecting. + """ + return _misc.ldb_set_session_info(*args, **kwargs) + +def ldb_set_loadparm(*args, **kwargs): + """ + S.set_loadparm(session_info) + Set loadparm context to use when connecting. + """ + return _misc.ldb_set_loadparm(*args, **kwargs) + +def samdb_set_domain_sid(*args, **kwargs): + """ + S.set_domain_sid(sid) + Set SID of domain to use. + """ + return _misc.samdb_set_domain_sid(*args, **kwargs) dsdb_attach_schema_from_ldif_file = _misc.dsdb_attach_schema_from_ldif_file -version = _misc.version + +def version(*args): + """ + version() + Obtain the Samba version. + """ + return _misc.version(*args) dsdb_set_global_schema = _misc.dsdb_set_global_schema -ldb_register_samba_handlers = _misc.ldb_register_samba_handlers + +def ldb_register_samba_handlers(*args, **kwargs): + """ + register_samba_handlers() + Register Samba-specific LDB modules and schemas. + """ + return _misc.ldb_register_samba_handlers(*args, **kwargs) dsdb_set_ntds_invocation_id = _misc.dsdb_set_ntds_invocation_id private_path = _misc.private_path -- cgit From 73b789b6d25698dba15c867c71d0cdd8c264f352 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 May 2008 04:01:57 +0200 Subject: Add docstrings to a couple more python modules. (This used to be commit b4560c90e5e8d3a35367d3a21d361dc4c9c0de23) --- source4/scripting/python/misc.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 25e8d2de8c..0c14944001 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -3,6 +3,10 @@ # # Don't modify this file, modify the SWIG interface instead. +""" +Python bindings for miscellaneous Samba functions. +""" + import _misc import new new_instancemethod = new.instancemethod @@ -61,7 +65,13 @@ import ldb import credentials import param import security -random_password = _misc.random_password + +def random_password(*args, **kwargs): + """ + S.random_password(len) -> string + Generate random password with specified length. + """ + return _misc.random_password(*args, **kwargs) def ldb_set_credentials(*args, **kwargs): """ -- cgit From 9817f3d785ceb67819a9def0e8030272e4ba9e14 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Aug 2008 07:32:44 +1000 Subject: Add a setexpiry operation in samdb.py This makes it easy to set the expiry (or no expiry) for a samdb user (This used to be commit 25171f18a4b242b5a731f4ac1eefc51cc82efd74) --- source4/scripting/python/misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/scripting/python/misc.py') diff --git a/source4/scripting/python/misc.py b/source4/scripting/python/misc.py index 0c14944001..e52d7df11d 100644 --- a/source4/scripting/python/misc.py +++ b/source4/scripting/python/misc.py @@ -1,5 +1,5 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 1.3.35 +# Version 1.3.36 # # Don't modify this file, modify the SWIG interface instead. @@ -118,5 +118,6 @@ def ldb_register_samba_handlers(*args, **kwargs): return _misc.ldb_register_samba_handlers(*args, **kwargs) dsdb_set_ntds_invocation_id = _misc.dsdb_set_ntds_invocation_id private_path = _misc.private_path +unix2nttime = _misc.unix2nttime -- cgit