@@ -92,7 +92,7 @@ class SimpleLDAPObject:
92
92
}
93
93
94
94
def __init__ (
95
- self ,uri ,
95
+ self ,uri = None ,
96
96
trace_level = 0 ,trace_file = None ,trace_stack_limit = 5 ,bytes_mode = None ,
97
97
bytes_strictness = None ,
98
98
):
@@ -769,13 +769,13 @@ def result4(self,msgid=ldap.RES_ANY,all=1,timeout=None,add_ctrls=0,add_intermedi
769
769
resp_data = self ._bytesify_results (resp_data , with_ctrls = add_ctrls )
770
770
return resp_type , resp_data , resp_msgid , decoded_resp_ctrls , resp_name , resp_value
771
771
772
- def search_ext (self ,base ,scope ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ,sizelimit = 0 ):
772
+ def search_ext (self ,base = None ,scope = ldap . SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ,sizelimit = 0 ):
773
773
"""
774
- search(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]]) -> int
775
- search_s(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]])
776
- search_st(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,timeout=-1]]]])
777
- search_ext(base, scope, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]]]]]]])
778
- search_ext_s(base, scope, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]]]]]]])
774
+ search([ base=None, [ scope=ldap.SCOPE_SUBTREE, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]] ]]]) -> int
775
+ search_s([ base=None, [ scope=ldap.SCOPE_SUBTREE, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]] ]]])
776
+ search_st([ base=None, [ scope=ldap.SCOPE_SUBTREE, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,timeout=-1]] ]]]])
777
+ search_ext([ base=None, [ scope=ldap.SCOPE_SUBTREE, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]] ]]]]]]])
778
+ search_ext_s([ base=None, [ scope=ldap.SCOPE_SUBTREE, [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]] ]]]]]]])
779
779
780
780
Perform an LDAP search operation, with base as the DN of
781
781
the entry at which to start the search, scope being one of
@@ -841,17 +841,17 @@ def search_ext(self,base,scope,filterstr=None,attrlist=None,attrsonly=0,serverct
841
841
timeout ,sizelimit ,
842
842
)
843
843
844
- def search_ext_s (self ,base ,scope ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ,sizelimit = 0 ):
844
+ def search_ext_s (self ,base = None ,scope = ldap . SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ,sizelimit = 0 ):
845
845
msgid = self .search_ext (base ,scope ,filterstr ,attrlist ,attrsonly ,serverctrls ,clientctrls ,timeout ,sizelimit )
846
846
return self .result (msgid ,all = 1 ,timeout = timeout )[1 ]
847
847
848
- def search (self ,base ,scope ,filterstr = None ,attrlist = None ,attrsonly = 0 ):
848
+ def search (self ,base = None ,scope = ldap . SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ):
849
849
return self .search_ext (base ,scope ,filterstr ,attrlist ,attrsonly ,None ,None )
850
850
851
- def search_s (self ,base ,scope ,filterstr = None ,attrlist = None ,attrsonly = 0 ):
851
+ def search_s (self ,base = None ,scope = ldap . SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ):
852
852
return self .search_ext_s (base ,scope ,filterstr ,attrlist ,attrsonly ,None ,None ,timeout = self .timeout )
853
853
854
- def search_st (self ,base ,scope ,filterstr = None ,attrlist = None ,attrsonly = 0 ,timeout = - 1 ):
854
+ def search_st (self ,base = None ,scope = ldap . SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ,timeout = - 1 ):
855
855
return self .search_ext_s (base ,scope ,filterstr ,attrlist ,attrsonly ,None ,None ,timeout )
856
856
857
857
def start_tls_s (self ):
@@ -962,7 +962,7 @@ def search_subschemasubentry_s(self,dn=None):
962
962
except IndexError :
963
963
return None
964
964
965
- def read_s (self ,dn ,filterstr = None ,attrlist = None ,serverctrls = None ,clientctrls = None ,timeout = - 1 ):
965
+ def read_s (self ,dn = None ,filterstr = None ,attrlist = None ,serverctrls = None ,clientctrls = None ,timeout = - 1 ):
966
966
"""
967
967
Reads and returns a single entry specified by `dn'.
968
968
@@ -1005,7 +1005,7 @@ def read_subschemasubentry_s(self,subschemasubentry_dn,attrs=None):
1005
1005
else :
1006
1006
return subschemasubentry
1007
1007
1008
- def find_unique_entry (self ,base ,scope = ldap .SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ):
1008
+ def find_unique_entry (self ,base = None ,scope = ldap .SCOPE_SUBTREE ,filterstr = None ,attrlist = None ,attrsonly = 0 ,serverctrls = None ,clientctrls = None ,timeout = - 1 ):
1009
1009
"""
1010
1010
Returns a unique entry, raises exception if not unique
1011
1011
"""
@@ -1077,7 +1077,7 @@ class ReconnectLDAPObject(SimpleLDAPObject):
1077
1077
}
1078
1078
1079
1079
def __init__ (
1080
- self ,uri ,
1080
+ self ,uri = None ,
1081
1081
trace_level = 0 ,trace_file = None ,trace_stack_limit = 5 ,bytes_mode = None ,
1082
1082
bytes_strictness = None , retry_max = 1 , retry_delay = 60.0
1083
1083
):
0 commit comments