2007-12-03 13:48:09 +01:00
# This file was automatically generated by SWIG (http://www.swig.org).
2008-04-11 00:43:23 +02:00
# Version 1.3.35
2007-12-03 13:48:09 +01:00
#
# Don't modify this file, modify the SWIG interface instead.
import _ldb
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
2007-12-11 14:31:01 +01:00
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
2007-12-03 13:48:09 +01:00
SCOPE_DEFAULT = _ldb . SCOPE_DEFAULT
SCOPE_BASE = _ldb . SCOPE_BASE
SCOPE_ONELEVEL = _ldb . SCOPE_ONELEVEL
SCOPE_SUBTREE = _ldb . SCOPE_SUBTREE
CHANGETYPE_NONE = _ldb . CHANGETYPE_NONE
CHANGETYPE_ADD = _ldb . CHANGETYPE_ADD
CHANGETYPE_DELETE = _ldb . CHANGETYPE_DELETE
CHANGETYPE_MODIFY = _ldb . CHANGETYPE_MODIFY
2008-01-25 03:46:47 +01:00
ldb_val_to_py_object = _ldb . ldb_val_to_py_object
2007-12-11 14:31:01 +01:00
class Dn ( object ) :
thisown = _swig_property ( lambda x : x . this . own ( ) , lambda x , v : x . this . own ( v ) , doc = ' The membership flag ' )
2007-12-03 13:48:09 +01:00
def __init__ ( self , * args , * * kwargs ) :
2007-12-11 14:31:01 +01:00
_ldb . Dn_swiginit ( self , _ldb . new_Dn ( * args , * * kwargs ) )
2007-12-03 13:48:09 +01:00
__swig_destroy__ = _ldb . delete_Dn
2008-01-11 04:05:41 +01:00
def __eq__ ( self , other ) :
if isinstance ( other , self . __class__ ) :
return self . __cmp__ ( other ) == 0
if isinstance ( other , str ) :
return str ( self ) == other
return False
2007-12-11 14:31:01 +01:00
Dn . validate = new_instancemethod ( _ldb . Dn_validate , None , Dn )
Dn . get_casefold = new_instancemethod ( _ldb . Dn_get_casefold , None , Dn )
Dn . __str__ = new_instancemethod ( _ldb . Dn___str__ , None , Dn )
Dn . parent = new_instancemethod ( _ldb . Dn_parent , None , Dn )
Dn . __cmp__ = new_instancemethod ( _ldb . Dn___cmp__ , None , Dn )
Dn . is_valid = new_instancemethod ( _ldb . Dn_is_valid , None , Dn )
Dn . is_special = new_instancemethod ( _ldb . Dn_is_special , None , Dn )
Dn . is_null = new_instancemethod ( _ldb . Dn_is_null , None , Dn )
Dn . check_special = new_instancemethod ( _ldb . Dn_check_special , None , Dn )
Dn . __len__ = new_instancemethod ( _ldb . Dn___len__ , None , Dn )
Dn . add_child = new_instancemethod ( _ldb . Dn_add_child , None , Dn )
Dn . add_base = new_instancemethod ( _ldb . Dn_add_base , None , Dn )
Dn . canonical_str = new_instancemethod ( _ldb . Dn_canonical_str , None , Dn )
Dn . canonical_ex_str = new_instancemethod ( _ldb . Dn_canonical_ex_str , None , Dn )
2008-05-19 23:07:04 +02:00
Dn . __repr__ = new_instancemethod ( _ldb . Dn___repr__ , None , Dn )
2007-12-11 14:31:01 +01:00
Dn . __add__ = new_instancemethod ( _ldb . Dn___add__ , None , Dn )
2007-12-03 13:48:09 +01:00
Dn_swigregister = _ldb . Dn_swigregister
Dn_swigregister ( Dn )
2007-12-11 14:31:01 +01:00
class ldb_msg_element ( object ) :
thisown = _swig_property ( lambda x : x . this . own ( ) , lambda x , v : x . this . own ( v ) , doc = ' The membership flag ' )
2008-04-11 00:43:23 +02:00
def __init__ ( self , * args , * * kwargs ) : raise AttributeError , " No constructor defined "
2007-12-03 13:48:09 +01:00
__repr__ = _swig_repr
__swig_destroy__ = _ldb . delete_ldb_msg_element
2008-01-11 00:23:33 +01:00
def __getitem__ ( self , i ) :
ret = self . get ( i )
if ret is None :
raise KeyError ( " no such value " )
return ret
2008-05-19 23:07:04 +02:00
def __repr__ ( self ) :
return " MessageElement([ %s ]) " % ( " , " . join ( repr ( x ) for x in self . __set__ ( ) ) )
2007-12-23 19:19:41 -06:00
def __eq__ ( self , other ) :
2008-01-11 01:55:56 +01:00
if ( len ( self ) == 1 and self . get ( 0 ) == other ) :
2007-12-23 19:19:41 -06:00
return True
2008-01-11 01:55:56 +01:00
if isinstance ( other , self . __class__ ) :
return self . __cmp__ ( other ) == 0
o = iter ( other )
for i in range ( len ( self ) ) :
if self . get ( i ) != o . next ( ) :
return False
return True
2007-12-23 19:19:41 -06:00
2007-12-11 14:31:01 +01:00
ldb_msg_element . __iter__ = new_instancemethod ( _ldb . ldb_msg_element___iter__ , None , ldb_msg_element )
ldb_msg_element . __set__ = new_instancemethod ( _ldb . ldb_msg_element___set__ , None , ldb_msg_element )
2008-01-11 01:02:58 +01:00
ldb_msg_element . __len__ = new_instancemethod ( _ldb . ldb_msg_element___len__ , None , ldb_msg_element )
2008-01-11 00:23:33 +01:00
ldb_msg_element . get = new_instancemethod ( _ldb . ldb_msg_element_get , None , ldb_msg_element )
2007-12-11 14:31:01 +01:00
ldb_msg_element . __cmp__ = new_instancemethod ( _ldb . ldb_msg_element___cmp__ , None , ldb_msg_element )
2007-12-03 13:48:09 +01:00
ldb_msg_element_swigregister = _ldb . ldb_msg_element_swigregister
ldb_msg_element_swigregister ( ldb_msg_element )
def MessageElement ( * args , * * kwargs ) :
val = _ldb . new_MessageElement ( * args , * * kwargs )
return val
ldb_msg_list_elements = _ldb . ldb_msg_list_elements
2007-12-11 14:31:01 +01:00
class Message ( object ) :
thisown = _swig_property ( lambda x : x . this . own ( ) , lambda x , v : x . this . own ( v ) , doc = ' The membership flag ' )
2007-12-03 13:48:09 +01:00
__repr__ = _swig_repr
2007-12-11 14:31:01 +01:00
dn = _swig_property ( _ldb . Message_dn_get , _ldb . Message_dn_set )
2007-12-03 13:48:09 +01:00
def __init__ ( self , * args , * * kwargs ) :
2007-12-11 14:31:01 +01:00
_ldb . Message_swiginit ( self , _ldb . new_Message ( * args , * * kwargs ) )
2007-12-03 13:48:09 +01:00
__swig_destroy__ = _ldb . delete_Message
2008-05-19 23:07:04 +02:00
def get ( self , key , default = None ) :
if key == " dn " :
return self . dn
return self . find_element ( key )
def __getitem__ ( self , key ) :
ret = self . get ( key , None )
if ret is None :
raise KeyError ( " No such element " )
return ret
def iteritems ( self ) :
for k in self . keys ( ) :
yield k , self [ k ]
def items ( self ) :
return list ( self . iteritems ( ) )
def __repr__ ( self ) :
return " Message( %s ) " % repr ( dict ( self . iteritems ( ) ) )
Message . find_element = new_instancemethod ( _ldb . Message_find_element , None , Message )
2007-12-11 14:31:01 +01:00
Message . __setitem__ = new_instancemethod ( _ldb . Message___setitem__ , None , Message )
Message . __len__ = new_instancemethod ( _ldb . Message___len__ , None , Message )
Message . keys = new_instancemethod ( _ldb . Message_keys , None , Message )
Message . __iter__ = new_instancemethod ( _ldb . Message___iter__ , None , Message )
Message . __delitem__ = new_instancemethod ( _ldb . Message___delitem__ , None , Message )
2007-12-03 13:48:09 +01:00
Message_swigregister = _ldb . Message_swigregister
Message_swigregister ( Message )
ldb_ldif_to_pyobject = _ldb . ldb_ldif_to_pyobject
LdbError = _ldb . LdbError
LDB_ERR_OPERATIONS_ERROR = _ldb . LDB_ERR_OPERATIONS_ERROR
LDB_ERR_PROTOCOL_ERROR = _ldb . LDB_ERR_PROTOCOL_ERROR
LDB_ERR_TIME_LIMIT_EXCEEDED = _ldb . LDB_ERR_TIME_LIMIT_EXCEEDED
LDB_ERR_SIZE_LIMIT_EXCEEDED = _ldb . LDB_ERR_SIZE_LIMIT_EXCEEDED
LDB_ERR_COMPARE_FALSE = _ldb . LDB_ERR_COMPARE_FALSE
LDB_ERR_COMPARE_TRUE = _ldb . LDB_ERR_COMPARE_TRUE
LDB_ERR_AUTH_METHOD_NOT_SUPPORTED = _ldb . LDB_ERR_AUTH_METHOD_NOT_SUPPORTED
LDB_ERR_STRONG_AUTH_REQUIRED = _ldb . LDB_ERR_STRONG_AUTH_REQUIRED
LDB_ERR_REFERRAL = _ldb . LDB_ERR_REFERRAL
LDB_ERR_ADMIN_LIMIT_EXCEEDED = _ldb . LDB_ERR_ADMIN_LIMIT_EXCEEDED
LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION = _ldb . LDB_ERR_UNSUPPORTED_CRITICAL_EXTENSION
LDB_ERR_CONFIDENTIALITY_REQUIRED = _ldb . LDB_ERR_CONFIDENTIALITY_REQUIRED
LDB_ERR_SASL_BIND_IN_PROGRESS = _ldb . LDB_ERR_SASL_BIND_IN_PROGRESS
LDB_ERR_NO_SUCH_ATTRIBUTE = _ldb . LDB_ERR_NO_SUCH_ATTRIBUTE
LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE = _ldb . LDB_ERR_UNDEFINED_ATTRIBUTE_TYPE
LDB_ERR_INAPPROPRIATE_MATCHING = _ldb . LDB_ERR_INAPPROPRIATE_MATCHING
LDB_ERR_CONSTRAINT_VIOLATION = _ldb . LDB_ERR_CONSTRAINT_VIOLATION
LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS = _ldb . LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS
LDB_ERR_INVALID_ATTRIBUTE_SYNTAX = _ldb . LDB_ERR_INVALID_ATTRIBUTE_SYNTAX
LDB_ERR_NO_SUCH_OBJECT = _ldb . LDB_ERR_NO_SUCH_OBJECT
LDB_ERR_ALIAS_PROBLEM = _ldb . LDB_ERR_ALIAS_PROBLEM
LDB_ERR_INVALID_DN_SYNTAX = _ldb . LDB_ERR_INVALID_DN_SYNTAX
LDB_ERR_ALIAS_DEREFERENCING_PROBLEM = _ldb . LDB_ERR_ALIAS_DEREFERENCING_PROBLEM
LDB_ERR_INAPPROPRIATE_AUTHENTICATION = _ldb . LDB_ERR_INAPPROPRIATE_AUTHENTICATION
LDB_ERR_INVALID_CREDENTIALS = _ldb . LDB_ERR_INVALID_CREDENTIALS
LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS = _ldb . LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS
LDB_ERR_BUSY = _ldb . LDB_ERR_BUSY
LDB_ERR_UNAVAILABLE = _ldb . LDB_ERR_UNAVAILABLE
LDB_ERR_UNWILLING_TO_PERFORM = _ldb . LDB_ERR_UNWILLING_TO_PERFORM
LDB_ERR_LOOP_DETECT = _ldb . LDB_ERR_LOOP_DETECT
LDB_ERR_NAMING_VIOLATION = _ldb . LDB_ERR_NAMING_VIOLATION
LDB_ERR_OBJECT_CLASS_VIOLATION = _ldb . LDB_ERR_OBJECT_CLASS_VIOLATION
LDB_ERR_NOT_ALLOWED_ON_NON_LEAF = _ldb . LDB_ERR_NOT_ALLOWED_ON_NON_LEAF
LDB_ERR_NOT_ALLOWED_ON_RDN = _ldb . LDB_ERR_NOT_ALLOWED_ON_RDN
LDB_ERR_ENTRY_ALREADY_EXISTS = _ldb . LDB_ERR_ENTRY_ALREADY_EXISTS
LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED = _ldb . LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED
LDB_ERR_AFFECTS_MULTIPLE_DSAS = _ldb . LDB_ERR_AFFECTS_MULTIPLE_DSAS
LDB_ERR_OTHER = _ldb . LDB_ERR_OTHER
2007-12-17 08:20:20 +01:00
class Ldb ( object ) :
2007-12-11 14:31:01 +01:00
thisown = _swig_property ( lambda x : x . this . own ( ) , lambda x , v : x . this . own ( v ) , doc = ' The membership flag ' )
2007-12-17 08:20:20 +01:00
def __init__ ( self , * args , * * kwargs ) :
_ldb . Ldb_swiginit ( self , _ldb . new_Ldb ( * args , * * kwargs ) )
__swig_destroy__ = _ldb . delete_Ldb
2007-12-24 11:02:45 -06:00
def __init__ ( self , url = None , flags = 0 , options = None ) :
_ldb . Ldb_swiginit ( self , _ldb . new_Ldb ( ) )
if url is not None :
self . connect ( url , flags , options )
2008-01-11 03:25:22 +01:00
def search ( self , base = None , scope = SCOPE_DEFAULT , expression = None ,
attrs = None , controls = None ) :
2008-05-19 23:07:04 +02:00
if not ( attrs is None or isinstance ( attrs , list ) ) :
raise TypeError ( " attributes not a list " )
2008-01-11 03:25:22 +01:00
parsed_controls = None
if controls is not None :
parsed_controls = self . parse_control_strings ( controls )
return self . search_ex ( base , scope , expression , attrs ,
parsed_controls )
2007-12-17 08:20:20 +01:00
Ldb . connect = new_instancemethod ( _ldb . Ldb_connect , None , Ldb )
2008-01-11 03:25:22 +01:00
Ldb . search_ex = new_instancemethod ( _ldb . Ldb_search_ex , None , Ldb )
2007-12-17 08:20:20 +01:00
Ldb . delete = new_instancemethod ( _ldb . Ldb_delete , None , Ldb )
Ldb . rename = new_instancemethod ( _ldb . Ldb_rename , None , Ldb )
2008-01-11 02:36:59 +01:00
Ldb . parse_control_strings = new_instancemethod ( _ldb . Ldb_parse_control_strings , None , Ldb )
2007-12-17 08:20:20 +01:00
Ldb . add = new_instancemethod ( _ldb . Ldb_add , None , Ldb )
Ldb . modify = new_instancemethod ( _ldb . Ldb_modify , None , Ldb )
Ldb . get_config_basedn = new_instancemethod ( _ldb . Ldb_get_config_basedn , None , Ldb )
Ldb . get_root_basedn = new_instancemethod ( _ldb . Ldb_get_root_basedn , None , Ldb )
Ldb . get_schema_basedn = new_instancemethod ( _ldb . Ldb_get_schema_basedn , None , Ldb )
Ldb . get_default_basedn = new_instancemethod ( _ldb . Ldb_get_default_basedn , None , Ldb )
2008-01-25 03:46:47 +01:00
Ldb . schema_format_value = new_instancemethod ( _ldb . Ldb_schema_format_value , None , Ldb )
2007-12-17 08:20:20 +01:00
Ldb . errstring = new_instancemethod ( _ldb . Ldb_errstring , None , Ldb )
Ldb . set_create_perms = new_instancemethod ( _ldb . Ldb_set_create_perms , None , Ldb )
Ldb . set_modules_dir = new_instancemethod ( _ldb . Ldb_set_modules_dir , None , Ldb )
Ldb . set_debug = new_instancemethod ( _ldb . Ldb_set_debug , None , Ldb )
Ldb . set_opaque = new_instancemethod ( _ldb . Ldb_set_opaque , None , Ldb )
Ldb . get_opaque = new_instancemethod ( _ldb . Ldb_get_opaque , None , Ldb )
Ldb . transaction_start = new_instancemethod ( _ldb . Ldb_transaction_start , None , Ldb )
Ldb . transaction_commit = new_instancemethod ( _ldb . Ldb_transaction_commit , None , Ldb )
Ldb . transaction_cancel = new_instancemethod ( _ldb . Ldb_transaction_cancel , None , Ldb )
2008-01-25 03:46:47 +01:00
Ldb . schema_attribute_remove = new_instancemethod ( _ldb . Ldb_schema_attribute_remove , None , Ldb )
Ldb . schema_attribute_add = new_instancemethod ( _ldb . Ldb_schema_attribute_add , None , Ldb )
Ldb . setup_wellknown_attributes = new_instancemethod ( _ldb . Ldb_setup_wellknown_attributes , None , Ldb )
2007-12-17 08:20:20 +01:00
Ldb . __contains__ = new_instancemethod ( _ldb . Ldb___contains__ , None , Ldb )
Ldb . parse_ldif = new_instancemethod ( _ldb . Ldb_parse_ldif , None , Ldb )
2008-05-19 23:12:13 +02:00
Ldb . __repr__ = new_instancemethod ( _ldb . Ldb___repr__ , None , Ldb )
2007-12-17 08:20:20 +01:00
Ldb_swigregister = _ldb . Ldb_swigregister
Ldb_swigregister ( Ldb )
2007-12-03 13:48:09 +01:00
valid_attr_name = _ldb . valid_attr_name
timestring = _ldb . timestring
string_to_time = _ldb . string_to_time
2007-12-22 14:28:45 -06:00
register_module = _ldb . register_module
2007-12-03 13:48:09 +01:00