Browse Source

HUE-50. Removing desktop/core/ext-py/python-ldap-2.3.11.

python-ldap-2.3.11 is not used by hue. Updating README.rst to not list the ldap packages. Tested by building without python-ldap-2.3.11 or the ldap package on ubuntu and ran all the tests.
vinithra 15 years ago
parent
commit
c109d9369b
100 changed files with 0 additions and 10344 deletions
  1. 0 2
      README.rst
  2. 0 7
      desktop/core/ext-py/python-ldap-2.3.11/.cvsignore
  3. 0 31
      desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/Makefile
  4. 0 1
      desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/COMMENT
  5. 0 2
      desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/DESCR
  6. 0 3
      desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/PLIST
  7. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/_ldap.so
  8. 0 301
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/dsml.py
  9. 0 56
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/__init__.py
  10. 0 316
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/async.py
  11. 0 125
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/cidict.py
  12. 0 133
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/controls.py
  13. 0 110
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/dn.py
  14. 0 56
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/filter.py
  15. 0 124
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/functions.py
  16. 0 822
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/ldapobject.py
  17. 0 115
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/modlist.py
  18. 0 33
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/resiter.py
  19. 0 111
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/sasl.py
  20. 0 12
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/__init__.py
  21. 0 617
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/models.py
  22. 0 423
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/subentry.py
  23. 0 85
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/tokenizer.py
  24. 0 424
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldapurl.py
  25. 0 454
      desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldif.py
  26. 0 35
      desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.mingw
  27. 0 33
      desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.suse-linux
  28. 0 33
      desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.win32
  29. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/LDAPObject.o
  30. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/berval.o
  31. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/common.o
  32. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/constants.o
  33. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/errors.o
  34. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/functions.o
  35. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/ldapcontrol.o
  36. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/ldapmodule.o
  37. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/message.o
  38. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/options.o
  39. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/schema.o
  40. BIN
      desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/version.o
  41. 0 808
      desktop/core/ext-py/python-ldap-2.3.11/CHANGES
  42. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/.cvsignore
  43. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/.cvsignore
  44. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/.cvsignore
  45. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/.cvsignore
  46. 0 80
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/deltree.py
  47. 0 42
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/ldifwriter.py
  48. 0 42
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/sizelimit.py
  49. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldapurl/.cvsignore
  50. 0 32
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldapurl/urlsearch.py
  51. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/.cvsignore
  52. 0 226
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/filterldif.py
  53. 0 28
      desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/ldifcopy.py
  54. 0 144
      desktop/core/ext-py/python-ldap-2.3.11/Demo/dn_search.py
  55. 0 98
      desktop/core/ext-py/python-ldap-2.3.11/Demo/initialize.py
  56. 0 33
      desktop/core/ext-py/python-ldap-2.3.11/Demo/ldapcontrols.py
  57. 0 63
      desktop/core/ext-py/python-ldap-2.3.11/Demo/matchedvalues.py
  58. 0 38
      desktop/core/ext-py/python-ldap-2.3.11/Demo/ms_ad_bind.py
  59. 0 39
      desktop/core/ext-py/python-ldap-2.3.11/Demo/ms_ad_specific_controls.py
  60. 0 29
      desktop/core/ext-py/python-ldap-2.3.11/Demo/options.py
  61. 0 57
      desktop/core/ext-py/python-ldap-2.3.11/Demo/page_control.py
  62. 0 32
      desktop/core/ext-py/python-ldap-2.3.11/Demo/passwd_ext_op.py
  63. 0 12
      desktop/core/ext-py/python-ldap-2.3.11/Demo/pickle_ldapobject.py
  64. 0 3
      desktop/core/ext-py/python-ldap-2.3.11/Demo/pyasn1/README
  65. 0 58
      desktop/core/ext-py/python-ldap-2.3.11/Demo/pyasn1/prereadcontrol.py
  66. 0 24
      desktop/core/ext-py/python-ldap-2.3.11/Demo/reconnect.py
  67. 0 52
      desktop/core/ext-py/python-ldap-2.3.11/Demo/rename.py
  68. 0 26
      desktop/core/ext-py/python-ldap-2.3.11/Demo/resiter.py
  69. 0 84
      desktop/core/ext-py/python-ldap-2.3.11/Demo/sasl_bind.py
  70. 0 61
      desktop/core/ext-py/python-ldap-2.3.11/Demo/schema.py
  71. 0 100
      desktop/core/ext-py/python-ldap-2.3.11/Demo/schema_tree.py
  72. 0 106
      desktop/core/ext-py/python-ldap-2.3.11/Demo/simple.py
  73. 0 128
      desktop/core/ext-py/python-ldap-2.3.11/Demo/simplebrowse.py
  74. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Doc/.cvsignore
  75. 0 68
      desktop/core/ext-py/python-ldap-2.3.11/Doc/Makefile
  76. 0 133
      desktop/core/ext-py/python-ldap-2.3.11/Doc/conf.py
  77. 0 44
      desktop/core/ext-py/python-ldap-2.3.11/Doc/index.rst
  78. 0 90
      desktop/core/ext-py/python-ldap-2.3.11/Doc/installing.rst
  79. 0 89
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-async.rst
  80. 0 83
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-controls.rst
  81. 0 106
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-dn.rst
  82. 0 41
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-filter.rst
  83. 0 43
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-modlist.rst
  84. 0 41
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-resiter.rst
  85. 0 21
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-schema.rst
  86. 0 1196
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap.rst
  87. 0 120
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldapurl.rst
  88. 0 63
      desktop/core/ext-py/python-ldap-2.3.11/Doc/ldif.rst
  89. 0 27
      desktop/core/ext-py/python-ldap-2.3.11/INSTALL
  90. 0 13
      desktop/core/ext-py/python-ldap-2.3.11/LICENCE
  91. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Lib/.cvsignore
  92. 0 301
      desktop/core/ext-py/python-ldap-2.3.11/Lib/dsml.py
  93. 0 4
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/.cvsignore
  94. 0 56
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/__init__.py
  95. 0 316
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/async.py
  96. 0 125
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/cidict.py
  97. 0 133
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/controls.py
  98. 0 110
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/dn.py
  99. 0 56
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/filter.py
  100. 0 124
      desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/functions.py

+ 0 - 2
README.rst

@@ -61,7 +61,6 @@ Development Prerequisites
 
     Debian:
       * gcc
-      * libldap2-dev
       * libmysqlclient-dev
       * libsqlite3-dev
       * libxml2-dev
@@ -75,7 +74,6 @@ Development Prerequisites
       * libxslt-devel
       * mysql
       * mysql-devel
-      * openldap-devel
       * python-devel
       * python-setuptools
       * python-simplejson (for the crepo tool)

+ 0 - 7
desktop/core/ext-py/python-ldap-2.3.11/.cvsignore

@@ -1,7 +0,0 @@
-build
-dist
-MANIFEST
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 31
desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/Makefile

@@ -1,31 +0,0 @@
-# $Id: Makefile,v 1.3 2000/08/20 15:04:23 leonard Exp $
-
-WRKDIST=		${.CURDIR}/../..
-VERSION!=		sh ${WRKDIST}/Build/version.sh
-
-PKGNAME=		python-ldap-${VERSION}
-RUN_DEPENDS=		python:lang/python
-CATEGORIES=		misc
-MAINATINER=		leonard@users.sourceforge.net
-HOMEPAGE=		http://python-ldap.sourceforge.net/
-
-FAKE=			Yes
-CONFIGURE_STYLE=	gnu
-SEPARATE_BUILD=		Yes
-EXTRACT_ONLY=	
-
-CONFIGURE_ARGS+=	--with-ldap=${LOCALBASE}
-
-do-fetch:;
-
-#-- put package on sourceforge ftp server
-export-ftp: ${PKGFILE}
-	scp ${PKGFILE} python-ldap.sourceforge.net:/home/groups/ftp/pub/python-ldap/${PKGNAME}-${OPSYS}-${ARCH}${PKG_SUFX}
-
-post-build:
-	sed -e 's,^${PREFIX}/,,' <${WRKBUILD}/filelist >${WRKBUILD}/filelist2
-
-SED_PLIST+=	|sed -e '/^%%filelist/r${WRKBUILD}/filelist2' -e '//d'
-ALL_TARGET=	build filelist
-
-.include <bsd.port.mk>

+ 0 - 1
desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/COMMENT

@@ -1 +0,0 @@
-Python interface to LDAP

+ 0 - 2
desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/DESCR

@@ -1,2 +0,0 @@
-This Python library provides access to the LDAP (Lightweight Directory Access 
-Protocol) RFC1823 C interface.

+ 0 - 3
desktop/core/ext-py/python-ldap-2.3.11/Build/build-openbsd/pkg/PLIST

@@ -1,3 +0,0 @@
-@comment $OpenBSD$
-%%filelist
-@dirrm lib/python1.6/site-packages/python-ldap

BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/_ldap.so


+ 0 - 301
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/dsml.py

@@ -1,301 +0,0 @@
-"""
-dsml - generate and parse DSMLv1 data
-(see http://www.oasis-open.org/committees/dsml/)
-
-See http://www.python-ldap.org/ for details.
-
-$Id: dsml.py,v 1.14 2009/12/03 22:11:26 stroeder Exp $
-
-Python compability note:
-Tested with Python 2.0+.
-"""
-
-__version__ = '2.3.11'
-
-import string,base64
-
-def list_dict(l):
-  """
-  return a dictionary with all items of l being the keys of the dictionary
-  """
-  d = {}
-  for i in l:
-    d[i]=None
-  return d
-
-
-special_entities = (
-  ('&','&amp;'),
-  ('<','&lt;'),
-  ('"','&quot;'),
-  ("'",'&apos;'),
-)
-
-def replace_char(s):
-  for char,entity in special_entities:
-    s = string.replace(s,char,entity)
-  return s
-
-class DSMLWriter:
-
-  def __init__(
-    self,f,base64_attrs=[],dsml_comment='',indent='    '
-  ):
-    """
-    Parameters:
-    f
-          File object for output.
-    base64_attrs
-          Attribute types to be base64-encoded.
-    dsml_comment
-          Text placed in comment lines behind <dsml:dsml>.
-    indent
-          String used for indentiation of next nested level.
-    """
-    self._output_file = f
-    self._base64_attrs = list_dict(map(string.lower,base64_attrs))
-    self._dsml_comment = dsml_comment
-    self._indent = indent
-
-  def _needs_base64_encoding(self,attr_type,attr_value):
-    if self._base64_attrs:
-      return self._base64_attrs.has_key(string.lower(attr_type))
-    else:
-      try:
-        unicode(attr_value,'utf-8')
-      except UnicodeError:
-        return 1
-      else:
-        return 0
-
-  def writeHeader(self):
-    """
-    Write the header
-    """
-    self._output_file.write('\n'.join([
-        '<?xml version="1.0" encoding="UTF-8"?>',
-        '<!DOCTYPE root PUBLIC "dsml.dtd" "http://www.dsml.org/1.0/dsml.dtd">',
-        '<dsml:dsml xmlns:dsml="http://www.dsml.org/DSML">',
-        '%s<dsml:directory-entries>\n' % (self._indent),
-      ])
-    )
-    if self._dsml_comment:
-      self._output_file.write('%s<!--\n' % (self._indent))
-      self._output_file.write('%s%s\n' % (self._indent,self._dsml_comment))
-      self._output_file.write('%s-->\n' % (self._indent))
-
-  def writeFooter(self):
-    """
-    Write the footer
-    """
-    self._output_file.write('%s</dsml:directory-entries>\n' % (self._indent))
-    self._output_file.write('</dsml:dsml>\n')
-    
-  def unparse(self,dn,entry):
-    return self.writeRecord(dn,entry)
-
-  def writeRecord(self,dn,entry):
-    """
-    dn
-          string-representation of distinguished name
-    entry
-          dictionary holding the LDAP entry {attr:data}
-    """
-
-    # Write line dn: first
-    self._output_file.write(
-      '%s<dsml:entry dn="%s">\n' % (
-        self._indent*2,replace_char(dn)
-      )
-    )
-
-    objectclasses = entry.get('objectclass',entry.get('objectClass',[]))
-
-    self._output_file.write('%s<dsml:objectclass>\n' % (self._indent*3))
-    for oc in objectclasses:
-      self._output_file.write('%s<dsml:oc-value>%s</dsml:oc-value>\n' % (self._indent*4,oc))
-    self._output_file.write('%s</dsml:objectclass>\n' % (self._indent*3))
-
-    attr_types = entry.keys()[:]
-    try:
-      attr_types.remove('objectclass')
-      attr_types.remove('objectClass')
-    except ValueError:
-      pass
-    attr_types.sort()
-    for attr_type in attr_types:
-      self._output_file.write('%s<dsml:attr name="%s">\n' % (self._indent*3,attr_type))
-      for attr_value_item in entry[attr_type]:
-        needs_base64_encoding = self._needs_base64_encoding(
-          attr_type,attr_value_item
-        )
-        if needs_base64_encoding:
-          attr_value_item = base64.encodestring(attr_value_item)
-        else:
-          attr_value_item = replace_char(attr_value_item)
-  	self._output_file.write('%s<dsml:value%s>\n' % (
-            self._indent*4,
-            ' encoding="base64"'*needs_base64_encoding
-          )
-        )
-  	self._output_file.write('%s%s\n' % (
-            self._indent*5,
-            attr_value_item
-          )
-        )
-  	self._output_file.write('%s</dsml:value>\n' % (
-            self._indent*4,
-          )
-        )
-      self._output_file.write('%s</dsml:attr>\n' % (self._indent*3))
-    self._output_file.write('%s</dsml:entry>\n' % (self._indent*2))
-    return
-
-
-try:
-
-  import xml.sax,xml.sax.handler
-
-except ImportError:
-  pass
-
-else:
-
-  class DSMLv1Handler(xml.sax.handler.ContentHandler):
-    """
-    Content handler class for DSMLv1
-    """
-
-    def __init__(self,parser_instance):
-      self._parser_instance = parser_instance
-      xml.sax.handler.ContentHandler.__init__(self)
-
-    def startDocument(self):
-      pass
-
-    def endDocument(self):
-      pass
-
-    def startElement(self,raw_name,attrs):
-      assert raw_name.startswith(''),'Illegal name'
-      name = raw_name[5:]
-      if name=='dsml':
-        pass
-      elif name=='directory-entries':
-        self._parsing_entries = 1
-      elif name=='entry':
-        self._dn = attrs['dn']
-        self._entry = {}
-      elif name=='attr':
-        self._attr_type = attrs['name'].encode('utf-8')
-        self._attr_values = []
-      elif name=='value':
-        self._attr_value = ''
-        self._base64_encoding = attrs.get('encoding','').lower()=='base64'
-      # Handle object class tags
-      elif name=='objectclass':
-        self._object_classes = []
-      elif name=='oc-value':
-        self._oc_value = ''
-      # Unhandled tags
-      else:
-        raise ValueError,'Unknown tag %s' % (raw_name)
-
-    def endElement(self,raw_name):
-      assert raw_name.startswith('dsml:'),'Illegal name'
-      name = raw_name[5:]
-      if name=='dsml':
-        pass
-      elif name=='directory-entries':
-        self._parsing_entries = 0
-      elif name=='entry':
-        self._parser_instance.handle(self._dn,self._entry)
-        del self._dn
-        del self._entry
-      elif name=='attr':
-        self._entry[self._attr_type] = self._attr_values
-        del self._attr_type
-        del self._attr_values
-      elif name=='value':
-        if self._base64_encoding:
-          attr_value = base64.decodestring(self._attr_value.strip())
-        else:
-          attr_value = self._attr_value.strip().encode('utf-8')
-        self._attr_values.append(attr_value)
-        del attr_value
-        del self._attr_value
-        del self._base64_encoding
-      # Handle object class tags
-      elif name=='objectclass':
-        self._entry['objectClass'] = self._object_classes
-        del self._object_classes
-      elif name=='oc-value':
-        self._object_classes.append(self._oc_value.strip().encode('utf-8'))
-        del self._oc_value
-      # Unhandled tags
-      else:
-        raise ValueError,'Unknown tag %s' % (raw_name)
-
-    def characters(self,ch):
-      if self.__dict__.has_key('_oc_value'):
-        self._oc_value = self._oc_value + ch
-      elif self.__dict__.has_key('_attr_value'):
-        self._attr_value = self._attr_value + ch
-      else:
-        pass
-
-
-  class DSMLParser:
-    """
-    Base class for a DSMLv1 parser. Applications should sub-class this
-    class and override method handle() to implement something meaningful.
-
-    Public class attributes:
-    records_read
-          Counter for records processed so far
-    """
-
-    def __init__(
-      self,
-      input_file,
-      ContentHandlerClass,
-      ignored_attr_types=None,
-      max_entries=0,
-    ):
-      """
-      Parameters:
-      input_file
-          File-object to read the DSMLv1 input from
-      ignored_attr_types
-          Attributes with these attribute type names will be ignored.
-      max_entries
-          If non-zero specifies the maximum number of entries to be
-          read from f.
-      line_sep
-          String used as line separator
-      """
-      self._input_file = input_file
-      self._max_entries = max_entries
-      self._ignored_attr_types = list_dict(map(string.lower,(ignored_attr_types or [])))
-      self._current_record = None,None
-      self.records_read = 0
-      self._parser = xml.sax.make_parser()
-      self._parser.setFeature(xml.sax.handler.feature_namespaces,0)
-      content_handler = ContentHandlerClass(self)
-      self._parser.setContentHandler(content_handler)
-
-    def handle(self,*args,**kwargs):
-      """
-      Process a single content DSMLv1 record. This method should be
-      implemented by applications using DSMLParser.
-      """
-      import pprint
-      pprint.pprint(args)
-      pprint.pprint(kwargs)
-
-    def parse(self):
-      """
-      Continously read and parse DSML records
-      """
-      self._parser.parse(self._input_file)
-

+ 0 - 56
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/__init__.py

@@ -1,56 +0,0 @@
-"""
-ldap - base module
-
-See http://www.python-ldap.org/ for details.
-
-$Id: __init__.py,v 1.67 2009/12/03 22:11:26 stroeder Exp $
-"""
-
-# This is also the overall release version number
-
-__version__ = '2.3.11'
-
-import sys
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-  _trace_level = 0
-  _trace_file = sys.stderr
-  _trace_stack_limit = None
-
-from _ldap import *
-
-class DummyLock:
-  """Define dummy class with methods compatible to threading.Lock"""
-  def __init__(self):
-    pass
-  def acquire(self):
-    pass
-  def release(self):
-    pass
-
-
-try:
-  # Check if Python installation was build with thread support
-  import thread
-except ImportError:
-  LDAPLock = DummyLock
-else:
-  import threading
-  LDAPLock = threading.Lock
-
-# Create module-wide lock for serializing all calls
-# into underlying LDAP lib
-_ldap_module_lock = LDAPLock()
-
-from functions import open,initialize,init,get_option,set_option
-
-from ldap.dn import explode_dn,explode_rdn,str2dn,dn2str
-del str2dn
-del dn2str
-
-# More constants
-
-# For compability of 2.3 and 2.4 OpenLDAP API
-OPT_DIAGNOSTIC_MESSAGE = OPT_ERROR_STRING

+ 0 - 316
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/async.py

@@ -1,316 +0,0 @@
-"""
-ldap.async - handle async LDAP operations
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: async.py,v 1.28 2009/07/26 11:09:57 stroeder Exp $
-
-Python compability note:
-Tested on Python 2.0+ but should run on Python 1.5.x.
-"""
-
-import ldap
-
-from ldap import __version__
-
-
-_searchResultTypes={
-  ldap.RES_SEARCH_ENTRY:None,
-  ldap.RES_SEARCH_RESULT:None,
-  ldap.RES_SEARCH_REFERENCE:None,
-}
-
-_entryResultTypes={
-  ldap.RES_SEARCH_ENTRY:None,
-  ldap.RES_SEARCH_RESULT:None,
-}
-
-
-class WrongResultType(Exception):
-
-  def __init__(self,receivedResultType,expectedResultTypes):
-    self.receivedResultType = receivedResultType
-    self.expectedResultTypes = expectedResultTypes
-    Exception.__init__(self)
-
-  def __str__(self):
-    return 'Received wrong result type %s (expected one of %s).' % (
-      self.receivedResultType,
-      ', '.join(self.expectedResultTypes),
-    )
-      
-
-class AsyncSearchHandler:
-  """
-  Class for stream-processsing LDAP search results
-  """
-
-  def __init__(self,l):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    """
-    self._l = l
-    self._msgId = None
-
-  def startSearch(
-    self,
-    searchRoot,
-    searchScope,
-    filterStr,
-    attrList=None,
-    attrsOnly=0,
-    timeout=-1,
-    sizelimit=0,
-    serverctrls=None,
-    clientctrls=None
-  ):
-    """
-    searchRoot
-        See parameter base of method LDAPObject.search()
-    searchScope
-        See parameter scope of method LDAPObject.search()
-    filterStr
-        See parameter filter of method LDAPObject.search()
-    attrList=None
-        See parameter attrlist of method LDAPObject.search()
-    attrsOnly
-        See parameter attrsonly of method LDAPObject.search()
-    timeout
-        Maximum time the server shall use for search operation
-    sizelimit
-        Maximum number of entries a server should return
-        (request client-side limit)
-    serverctrls
-        list of server-side LDAP controls
-    clientctrls
-        list of client-side LDAP controls
-    """
-    self._msgId = self._l.search_ext(
-      searchRoot,searchScope,filterStr,
-      attrList,attrsOnly,serverctrls,clientctrls,timeout,sizelimit
-    )
-    return # startSearch()
-
-  def preProcessing(self):
-    """
-    Do anything you want after starting search but
-    before receiving and processing results
-    """
-
-  def postProcessing(self):
-    """
-    Do anything you want after receiving and processing results
-    """
-
-  def processResults(self,ignoreResultsNumber=0,processResultsCount=0,timeout=-1):
-    """
-    ignoreResultsNumber
-        Don't process the first ignoreResultsNumber results.
-    processResultsCount
-        If non-zero this parameters indicates the number of results
-        processed is limited to processResultsCount.
-    timeout
-        See parameter timeout of ldap.LDAPObject.result()
-    """
-    self.preProcessing()
-    result_counter = 0
-    end_result_counter = ignoreResultsNumber+processResultsCount
-    go_ahead = 1
-    partial = 0
-    self.beginResultsDropped = 0
-    self.endResultBreak = result_counter
-    try:
-      result_type,result_list = None,None
-      while go_ahead:
-        while result_type is None and not result_list:
-          result_type,result_list,result_msgid,result_serverctrls = self._l.result3(self._msgId,0,timeout)
-        if not result_list:
-          break
-        if not _searchResultTypes.has_key(result_type):
-          raise WrongResultType(result_type,_searchResultTypes.keys())
-        # Loop over list of search results
-        for result_item in result_list:
-          if result_counter<ignoreResultsNumber:
-            self.beginResultsDropped = self.beginResultsDropped+1
-          elif processResultsCount==0 or result_counter<end_result_counter:
-            self._processSingleResult(result_type,result_item)
-          else:
-            go_ahead = 0 # break-out from while go_ahead
-            partial = 1
-            break # break-out from this for-loop
-          result_counter = result_counter+1
-        result_type,result_list = None,None
-        self.endResultBreak = result_counter
-    finally:
-      if partial and self._msgId!=None:
-        self._l.abandon(self._msgId)
-    self.postProcessing()
-    return partial # processResults()
-
-  def _processSingleResult(self,resultType,resultItem):
-    """
-    Process single entry
-
-    resultType
-        result type
-    resultItem
-        Single item of a result list
-    """
-    pass
-
-
-class List(AsyncSearchHandler):
-  """
-  Class for collecting all search results.
-  
-  This does not seem to make sense in the first place but think
-  of retrieving exactly a certain portion of the available search
-  results.
-  """
-
-  def __init__(self,l):
-    AsyncSearchHandler.__init__(self,l)
-    self.allResults = []
-
-  def _processSingleResult(self,resultType,resultItem):
-    self.allResults.append((resultType,resultItem))
-
-
-class Dict(AsyncSearchHandler):
-  """
-  Class for collecting all search results into a dictionary {dn:entry}
-  """
-
-  def __init__(self,l):
-    AsyncSearchHandler.__init__(self,l)
-    self.allEntries = {}
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self.allEntries[dn] = entry
-
-
-class IndexedDict(Dict):
-  """
-  Class for collecting all search results into a dictionary {dn:entry}
-  and maintain case-sensitive equality indexes to entries
-  """
-
-  def __init__(self,l,indexed_attrs=None):
-    Dict.__init__(self,l)
-    self.indexed_attrs = indexed_attrs or tuple()
-    self.index = {}.fromkeys(self.indexed_attrs,{})
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self.allEntries[dn] = entry
-      for a in self.indexed_attrs:
-	if entry.has_key(a):
-	  for v in entry[a]:
-	    try:
-    	      self.index[a][v].append(dn)
-	    except KeyError:
-    	      self.index[a][v] = [ dn ]
-
-
-class FileWriter(AsyncSearchHandler):
-  """
-  Class for writing a stream of LDAP search results to a file object
-  """
-
-  def __init__(self,l,f,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    f
-        File object instance where the LDIF data is written to
-    """
-    AsyncSearchHandler.__init__(self,l)
-    self._f = f
-    self.headerStr = headerStr
-    self.footerStr = footerStr
-
-  def preProcessing(self):
-    """
-    The headerStr is written to output after starting search but
-    before receiving and processing results.
-    """
-    self._f.write(self.headerStr)
-
-  def postProcessing(self):
-    """
-    The footerStr is written to output after receiving and
-    processing results.
-    """
-    self._f.write(self.footerStr)
-
-
-class LDIFWriter(FileWriter):
-  """
-  Class for writing a stream LDAP search results to a LDIF file
-  """
-
-  def __init__(self,l,writer_obj,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    writer_obj
-        Either a file-like object or a ldif.LDIFWriter instance
-        used for output
-    """
-    import ldif
-    if isinstance(writer_obj,ldif.LDIFWriter):
-      self._ldif_writer = writer_obj
-    else:
-      self._ldif_writer = ldif.LDIFWriter(writer_obj)
-    FileWriter.__init__(self,l,self._ldif_writer._output_file,headerStr,footerStr)
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self._ldif_writer.unparse(dn,entry)
-
-class DSMLWriter(FileWriter):
-  """
-  Class for writing a stream LDAP search results to a DSML file
-  """
-
-  def __init__(self,l,writer_obj,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-
-    Parameters:
-    l
-        LDAPObject instance
-    writer_obj
-        Either a file-like object or a ldif.DSMLWriter instance
-        used for output
-    """
-    import dsml
-    if isinstance(writer_obj,dsml.DSMLWriter):
-      self._dsml_writer = writer_obj
-    else:
-      self._dsml_writer = dsml.DSMLWriter(writer_obj)
-    FileWriter.__init__(self,l,self._dsml_writer._output_file,headerStr,footerStr)
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self._dsml_writer.unparse(dn,entry)
-

+ 0 - 125
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/cidict.py

@@ -1,125 +0,0 @@
-"""
-This is a convenience wrapper for dictionaries
-returned from LDAP servers containing attribute
-names of variable case.
-
-See http://www.python-ldap.org/ for details.
-
-$Id: cidict.py,v 1.13 2009/04/17 14:34:34 stroeder Exp $
-"""
-
-__version__ = """$Revision: 1.13 $"""
-
-from UserDict import UserDict
-from string import lower
-
-class cidict(UserDict):
-  """
-  Case-insensitive but case-respecting dictionary.
-  """
-
-  def __init__(self,default=None):
-    self._keys = {}
-    UserDict.__init__(self,{})
-    self.update(default or {})
-
-  def __getitem__(self,key):
-    return self.data[lower(key)]
-
-  def __setitem__(self,key,value):
-    lower_key = lower(key)
-    self._keys[lower_key] = key
-    self.data[lower_key] = value
-
-  def __delitem__(self,key):
-    lower_key = lower(key)
-    del self._keys[lower_key]
-    del self.data[lower_key]
-
-  def update(self,dict):
-    for key in dict.keys():
-      self[key] = dict[key]
-
-  def has_key(self,key):
-    return UserDict.has_key(self,lower(key))
-
-  def __contains__(self,key):
-    return self.has_key(key)
-
-  def get(self,key,failobj=None):
-    try:
-      return self[key]
-    except KeyError:
-      return failobj
-
-  def keys(self):
-    return self._keys.values()
-
-  def items(self):
-    result = []
-    for k in self._keys.values():
-      result.append((k,self[k]))
-    return result
-
-
-def strlist_minus(a,b):
-  """
-  Return list of all items in a which are not in b (a - b).
-  a,b are supposed to be lists of case-insensitive strings.
-  """
-  temp = cidict()
-  for elt in b:
-    temp[elt] = elt
-  result = [
-    elt
-    for elt in a
-    if not temp.has_key(elt)
-  ]
-  return result
-
-
-def strlist_intersection(a,b):
-  """
-  Return intersection of two lists of case-insensitive strings a,b.
-  """
-  temp = cidict()
-  for elt in a:
-    temp[elt] = elt
-  result = [
-    temp[elt]
-    for elt in b
-    if temp.has_key(elt)
-  ]
-  return result
-
-
-def strlist_union(a,b):
-  """
-  Return union of two lists of case-insensitive strings a,b.
-  """
-  temp = cidict()
-  for elt in a:
-    temp[elt] = elt
-  for elt in b:
-    temp[elt] = elt
-  return temp.values()
-
-
-if __debug__ and __name__ == '__main__':
-  x = { 'AbCDeF' : 123 }
-  cix = cidict(x)
-  assert cix["ABCDEF"] == 123
-  assert cix.get("ABCDEF",None) == 123
-  assert cix.get("not existent",None) is None
-  cix["xYZ"] = 987
-  assert cix["XyZ"] == 987
-  assert cix.get("XyZ",None) == 987
-  cix_keys = cix.keys()
-  cix_keys.sort()
-  assert cix_keys==['AbCDeF','xYZ'],ValueError(repr(cix_keys))
-  cix_items = cix.items()
-  cix_items.sort()
-  assert cix_items==[('AbCDeF',123),('xYZ',987)],ValueError(repr(cix_items))
-  del cix["abcdEF"]
-  assert not cix._keys.has_key("abcdef")
-  assert not cix.has_key("AbCDef")

+ 0 - 133
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/controls.py

@@ -1,133 +0,0 @@
-"""
-controls.py - support classes for LDAP controls
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: controls.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
-
-Description:
-The ldap.controls module provides LDAPControl classes.
-Each class provides support for a certain control.
-"""
-
-from ldap import __version__
-
-__all__ = [
-  'LDAPControl',
-]
-
-
-from types import ClassType
-
-import _ldap,ldap
-
-
-class LDAPControl:
-  """
-  Base class for all LDAP controls
-  """
-
-  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
-    self.controlType = controlType
-    self.criticality = criticality
-    self.controlValue = controlValue or self.decodeControlValue(encodedControlValue)
-
-  def __repr__(self):
-    return '%s(%s,%s,%s)' % (self.__class__.__name__,self.controlType,self.criticality,self.controlValue)
-
-  def encodeControlValue(self,value):
-    return value
-
-  def decodeControlValue(self,encodedValue):
-    return encodedValue
-
-  def getEncodedTuple(self):
-    return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue))
-
-
-class BooleanControl(LDAPControl):
-  """
-  Base class for simple controls with booelan control value
-
-  In this base class controlValue has to be passed as
-  boolean type (True/False or 1/0).
-  """
-  boolean2ber = { 1:'\x01\x01\xFF', 0:'\x01\x01\x00' }
-  ber2boolean = { '\x01\x01\xFF':1, '\x01\x01\x00':0 }
-
-  def encodeControlValue(self,value):
-    return self.boolean2ber[int(value)]
-
-  def decodeControlValue(self,encodedValue):
-    return self.ber2boolean[encodedValue]
-
-
-class SimplePagedResultsControl(LDAPControl):
-  """
-  LDAP Control Extension for Simple Paged Results Manipulation
-
-  see RFC 2696
-  """
-  controlType = ldap.LDAP_CONTROL_PAGE_OID
-
-  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
-    LDAPControl.__init__(self,ldap.LDAP_CONTROL_PAGE_OID,criticality,controlValue,encodedControlValue)
-
-  def encodeControlValue(self,value):
-    size,cookie = value
-    return _ldap.encode_page_control(size,cookie)
-
-  def decodeControlValue(self,encodedValue):
-    size,cookie = _ldap.decode_page_control(encodedValue)
-    return size,cookie
-
-
-class MatchedValuesControl(LDAPControl):
-  """
-  LDAP Matched Values control, as defined in RFC 3876
-
-  from ldap.controls import MatchedValuesControl
-  control = MatchedValuesControl(criticality, filter)
-  """
-  
-  controlType = ldap.LDAP_CONTROL_VALUESRETURNFILTER
-  
-  def __init__(self, criticality, controlValue=None):
-    LDAPControl.__init__(self, self.controlType, criticality, controlValue, None) 
-
-  def encodeControlValue(self, value):
-    return _ldap.encode_valuesreturnfilter_control(value)
-
-
-def EncodeControlTuples(ldapControls):
-  """
-  Return list of readily encoded 3-tuples which can be directly
-  passed to C module _ldap
-  """
-  if ldapControls is None:
-    return None
-  else:
-    result = [
-      c.getEncodedTuple()
-      for c in ldapControls
-    ]
-    return result
-
-
-def DecodeControlTuples(ldapControlTuples):
-  """
-  Return list of readily encoded 3-tuples which can be directly
-  passed to C module _ldap
-  """
-  return [
-    knownLDAPControls.get(controlType,LDAPControl)
-      (controlType,criticality,encodedControlValue=encodedControlValue)
-    for controlType,criticality,encodedControlValue in ldapControlTuples or []
-  ]
-
-# Build a dictionary of known LDAPControls
-knownLDAPControls = {}
-for symbol_name in dir():
-  c = eval(symbol_name)
-  if type(c) is ClassType and hasattr(c,'controlType'):
-    knownLDAPControls[c.controlType] = c

+ 0 - 110
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/dn.py

@@ -1,110 +0,0 @@
-"""
-dn.py - misc stuff for handling distinguished names (see RFC 4514)
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: dn.py,v 1.9 2009/07/26 11:09:58 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+
-"""
-
-from ldap import __version__
-
-
-import _ldap
-
-import ldap.functions
-
-
-def escape_dn_chars(s):
-  """
-  Escape all DN special characters found in s
-  with a back-slash (see RFC 4514, section 2.4)
-  """
-  if s:
-    s = s.replace('\\','\\\\')
-    s = s.replace(',' ,'\\,')
-    s = s.replace('+' ,'\\+')
-    s = s.replace('"' ,'\\"')
-    s = s.replace('<' ,'\\<')
-    s = s.replace('>' ,'\\>')
-    s = s.replace(';' ,'\\;')
-    s = s.replace('=' ,'\\=')
-    s = s.replace('\000' ,'\\\000')    
-    if s[0]=='#' or s[0]==' ':
-      s = ''.join(('\\',s))
-    if s[-1]==' ':
-      s = ''.join((s[:-1],'\\ '))
-  return s
-
-
-def str2dn(dn,flags=0):
-  """
-  This function takes a DN as string as parameter and returns
-  a decomposed DN. It's the inverse to dn2str().
-  
-  flags describes the format of the dn
-
-  See also the OpenLDAP man-page ldap_str2dn(3)
-  """
-  if not dn:
-    return []
-  return ldap.functions._ldap_function_call(_ldap.str2dn,dn,flags)
-
-
-def dn2str(dn):
-  """
-  This function takes a decomposed DN as parameter and returns
-  a single string. It's the inverse to str2dn() but will always
-  return a DN in LDAPv3 format compliant to RFC 4514.
-  """
-  return ','.join([
-    '+'.join([
-      '='.join((atype,escape_dn_chars(avalue or '')))
-      for atype,avalue,dummy in rdn])
-    for rdn in dn
-  ])
-
-def explode_dn(dn,notypes=0,flags=0):
-  """
-  explode_dn(dn [, notypes=0]) -> list
-  
-  This function takes a DN and breaks it up into its component parts.
-  The notypes parameter is used to specify that only the component's
-  attribute values be returned and not the attribute types.
-  """
-  if not dn:
-    return []
-  dn_decomp = str2dn(dn,flags)
-  rdn_list = []
-  for rdn in dn_decomp:
-    if notypes:
-      rdn_list.append('+'.join([
-        escape_dn_chars(avalue or '')
-	for atype,avalue,dummy in rdn
-      ]))
-    else:
-      rdn_list.append('+'.join([
-        '='.join((atype,escape_dn_chars(avalue or '')))
-	for atype,avalue,dummy in rdn
-      ]))
-  return rdn_list
-
-
-def explode_rdn(rdn,notypes=0,flags=0):
-  """
-  explode_rdn(rdn [, notypes=0]) -> list
-  
-  This function takes a RDN and breaks it up into its component parts
-  if it is a multi-valued RDN.
-  The notypes parameter is used to specify that only the component's
-  attribute values be returned and not the attribute types.
-  """
-  if not rdn:
-    return []
-  rdn_decomp = str2dn(rdn,flags)[0]
-  if notypes:
-    return [avalue or '' for atype,avalue,dummy in rdn_decomp]
-  else:
-    return ['='.join((atype,escape_dn_chars(avalue or ''))) for atype,avalue,dummy in rdn_decomp]

+ 0 - 56
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/filter.py

@@ -1,56 +0,0 @@
-"""
-filters.py - misc stuff for handling LDAP filter strings (see RFC2254)
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: filter.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+
-"""
-
-from ldap import __version__
-
-
-def escape_filter_chars(assertion_value,escape_mode=0):
-  """
-  Replace all special characters found in assertion_value
-  by quoted notation.
-  
-  escape_mode
-  	If 0 only special chars mentioned in RFC 2254
-	are escaped.
-  	If 1 all NON-ASCII chars are escaped.
-  	If 2 all chars are escaped.
-  """
-  if escape_mode:
-    r = []
-    if escape_mode==1:
-      for c in assertion_value:
-	if c < '0' or c > 'z' or c in "\\*()":
-          c = "\\%02x" % ord(c)
-	r.append(c)
-    elif escape_mode==2:
-      for c in assertion_value:
-	r.append("\\%02x" % ord(c))
-    else:
-      raise ValueError('escape_mode must be 0, 1 or 2.')
-    s = ''.join(r)
-  else:
-    s = assertion_value.replace('\\', r'\5c')
-    s = s.replace(r'*', r'\2a')
-    s = s.replace(r'(', r'\28')
-    s = s.replace(r')', r'\29')
-    s = s.replace('\x00', r'\00')
-  return s 
-
-
-def filter_format(filter_template,assertion_values):
-  """
-  filter_template
-        String containing %s as placeholder for assertion values.
-  assertion_values
-        List or tuple of assertion values. Length must match
-        count of %s in filter_template.
-  """
-  return filter_template % (tuple(map(escape_filter_chars,assertion_values)))

+ 0 - 124
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/functions.py

@@ -1,124 +0,0 @@
-"""
-functions.py - wraps functions of module _ldap
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: functions.py,v 1.24 2009/09/15 13:31:29 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+ but should work with Python 1.5.x
-- functions should behave exactly the same like in _ldap
-
-Usage:
-Directly imported by ldap/__init__.py. The symbols of _ldap are
-overridden.
-
-Thread-lock:
-Basically calls into the LDAP lib are serialized by the module-wide
-lock _ldapmodule_lock.
-"""
-
-from ldap import __version__
-
-__all__ = [
-  'open','initialize','init',
-  'explode_dn','explode_rdn',
-  'get_option','set_option',
-]
-
-import sys,_ldap,ldap
-
-from ldap import LDAPError
-
-from ldap.dn import explode_dn,explode_rdn
-
-from ldap.ldapobject import LDAPObject
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-
-def _ldap_function_call(func,*args,**kwargs):
-  """
-  Wrapper function which locks calls to func with via
-  module-wide ldap_lock
-  """
-  if __debug__:
-    if ldap._trace_level>=1:
-      ldap._trace_file.write('*** %s.%s (%s,%s)\n' % (
-        '_ldap',repr(func),
-        repr(args),repr(kwargs)
-      ))
-      if ldap._trace_level>=3:
-        traceback.print_stack(limit=ldap._trace_stack_limit,file=ldap._trace_file)
-  ldap._ldap_module_lock.acquire()
-  try:
-    try:
-      result = func(*args,**kwargs)
-    finally:
-      ldap._ldap_module_lock.release()
-  except LDAPError,e:
-    if __debug__ and ldap._trace_level>=2:
-      ldap._trace_file.write('=> LDAPError: %s\n' % (str(e)))
-    raise
-  if __debug__ and ldap._trace_level>=2:
-    if result!=None and result!=(None,None):
-      ldap._trace_file.write('=> result: %s\n' % (repr(result)))
-  return result
-
-
-def initialize(uri,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None):
-  """
-  Return LDAPObject instance by opening LDAP connection to
-  LDAP host specified by LDAP URL
-  
-  Parameters:
-  uri
-        LDAP URL containing at least connection scheme and hostport,
-        e.g. ldap://localhost:389
-  trace_level
-        If non-zero a trace output of LDAP calls is generated.
-  trace_file
-        File object where to write the trace output to.
-        Default is to use stdout.
-  """
-  return LDAPObject(uri,trace_level,trace_file,trace_stack_limit)
-
-
-def open(host,port=389,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None):
-  """
-  Return LDAPObject instance by opening LDAP connection to
-  specified LDAP host
-  
-  Parameters:
-  host
-        LDAP host and port, e.g. localhost
-  port
-        integer specifying the port number to use, e.g. 389
-  trace_level
-        If non-zero a trace output of LDAP calls is generated.
-  trace_file
-        File object where to write the trace output to.
-        Default is to use stdout.
-  """
-  return initialize('ldap://%s:%d' % (host,port),trace_level,trace_file,trace_stack_limit)
-
-init = open
-
-
-def get_option(option):
-  """
-  get_option(name) -> value
-
-  Get the value of an LDAP global option.
-  """
-  return _ldap_function_call(_ldap.get_option,option)
-
-
-def set_option(option,invalue):
-  """
-  set_option(name, value)
-  
-  Set the value of an LDAP global option.
-  """
-  _ldap_function_call(_ldap.set_option,option,invalue)

+ 0 - 822
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/ldapobject.py

@@ -1,822 +0,0 @@
-"""
-ldapobject.py - wraps class _ldap.LDAPObject
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: ldapobject.py,v 1.108 2010/02/26 08:57:29 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+ but should work with Python 1.5.x
-- LDAPObject class should be exactly the same like _ldap.LDAPObject
-
-Usage:
-Directly imported by ldap/__init__.py. The symbols of _ldap are
-overridden.
-
-Thread-lock:
-Basically calls into the LDAP lib are serialized by the module-wide
-lock self._ldap_object_lock.
-"""
-
-from ldap import __version__
-
-__all__ = [
-  'LDAPObject',
-  'SimpleLDAPObject',
-  'NonblockingLDAPObject',
-  'ReconnectLDAPObject',
-  'SmartLDAPObject'
-]
-
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-
-import sys,time,_ldap,ldap,ldap.functions
-
-from ldap.schema import SCHEMA_ATTRS
-from ldap.controls import LDAPControl,DecodeControlTuples,EncodeControlTuples
-from ldap import LDAPError
-
-
-class SimpleLDAPObject:
-  """
-  Drop-in wrapper class around _ldap.LDAPObject
-  """
-
-  CLASSATTR_OPTION_MAPPING = {
-    "protocol_version":   ldap.OPT_PROTOCOL_VERSION,
-    "deref":              ldap.OPT_DEREF,
-    "referrals":          ldap.OPT_REFERRALS,
-    "timelimit":          ldap.OPT_TIMELIMIT,
-    "sizelimit":          ldap.OPT_SIZELIMIT,
-    "network_timeout":    ldap.OPT_NETWORK_TIMEOUT,
-    "error_number":ldap.OPT_ERROR_NUMBER,
-    "error_string":ldap.OPT_ERROR_STRING,
-    "matched_dn":ldap.OPT_MATCHED_DN,
-  }
-
-  def __init__(
-    self,uri,
-    trace_level=0,trace_file=None,trace_stack_limit=5
-  ):
-    self._trace_level = trace_level
-    self._trace_file = trace_file or sys.stdout
-    self._trace_stack_limit = trace_stack_limit
-    self._uri = uri
-    self._ldap_object_lock = self._ldap_lock()
-    self._l = ldap.functions._ldap_function_call(_ldap.initialize,uri)
-    self.timeout = -1
-    self.protocol_version = ldap.VERSION3
-
-  def _ldap_lock(self):
-    if ldap.LIBLDAP_R:
-      return ldap.LDAPLock()
-    else:
-      return ldap._ldap_module_lock
-
-  def _ldap_call(self,func,*args,**kwargs):
-    """
-    Wrapper method mainly for serializing calls into OpenLDAP libs
-    and trace logs
-    """
-    if __debug__:
-      if self._trace_level>=1:# and func.__name__!='result':
-        self._trace_file.write('*** %s - %s (%s,%s)\n' % (
-          self._uri,
-          self.__class__.__name__+'.'+func.__name__,
-          repr(args),repr(kwargs)
-        ))
-        if self._trace_level>=3:
-          traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
-    self._ldap_object_lock.acquire()
-    try:
-      try:
-        result = func(*args,**kwargs)
-        if __debug__ and self._trace_level>=2:
-          if func.__name__!="unbind_ext":
-            diagnostic_message_success = self._l.get_option(ldap.OPT_DIAGNOSTIC_MESSAGE)
-          else:
-            diagnostic_message_success = None
-      finally:
-        self._ldap_object_lock.release()
-    except LDAPError,e:
-      if __debug__ and self._trace_level>=2:
-        self._trace_file.write('=> LDAPError - %s: %s\n' % (e.__class__.__name__,str(e)))
-      raise
-    else:
-      if __debug__ and self._trace_level>=2:
-        if not diagnostic_message_success is None:
-          self._trace_file.write('=> diagnosticMessage: %s\n' % (repr(diagnostic_message_success)))
-        if result!=None and result!=(None,None):
-          self._trace_file.write('=> result: %s\n' % (repr(result)))
-    return result
-
-  def __setattr__(self,name,value):
-    if self.CLASSATTR_OPTION_MAPPING.has_key(name):
-      self.set_option(self.CLASSATTR_OPTION_MAPPING[name],value)
-    else:
-      self.__dict__[name] = value
-
-  def __getattr__(self,name):
-    if self.CLASSATTR_OPTION_MAPPING.has_key(name):
-      return self.get_option(self.CLASSATTR_OPTION_MAPPING[name])
-    elif self.__dict__.has_key(name):
-      return self.__dict__[name]
-    else:
-      raise AttributeError,'%s has no attribute %s' % (
-        self.__class__.__name__,repr(name)
-      )
-
-  def abandon_ext(self,msgid,serverctrls=None,clientctrls=None):
-    """
-    abandon_ext(msgid[,serverctrls=None[,clientctrls=None]]) -> None    
-    abandon(msgid) -> None    
-        Abandons or cancels an LDAP operation in progress. The msgid should
-        be the message id of an outstanding LDAP operation as returned
-        by the asynchronous methods search(), modify() etc.  The caller
-        can expect that the result of an abandoned operation will not be
-        returned from a future call to result().
-    """
-    return self._ldap_call(self._l.abandon_ext,msgid,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def abandon(self,msgid):
-    return self.abandon_ext(msgid,None,None)
-
-  def cancel(self,cancelid,serverctrls=None,clientctrls=None):
-    """
-    cancel(cancelid[,serverctrls=None[,clientctrls=None]]) -> int
-        Send cancels extended operation for an LDAP operation specified by cancelid.
-	The cancelid should be the message id of an outstanding LDAP operation as returned
-        by the asynchronous methods search(), modify() etc.  The caller
-        can expect that the result of an abandoned operation will not be
-        returned from a future call to result().
-	In opposite to abandon() this extended operation gets an result from
-	the server and thus should be preferred if the server supports it.
-    """
-    return self._ldap_call(self._l.cancel,cancelid,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def cancel_s(self,cancelid,serverctrls=None,clientctrls=None):
-    msgid = self.cancel(cancelid,serverctrls,clientctrls)
-    try:
-      res = self.result(msgid,all=1,timeout=self.timeout)
-    except (ldap.CANCELLED,ldap.SUCCESS):
-      res = None
-    return res
-
-  def add_ext(self,dn,modlist,serverctrls=None,clientctrls=None):
-    """
-    add_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
-        This function adds a new entry with a distinguished name
-        specified by dn which means it must not already exist.
-        The parameter modlist is similar to the one passed to modify(),
-        except that no operation integer need be included in the tuples.
-    """
-    return self._ldap_call(self._l.add_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def add_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
-    msgid = self.add_ext(dn,modlist,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def add(self,dn,modlist):
-    """
-    add(dn, modlist) -> int
-        This function adds a new entry with a distinguished name
-        specified by dn which means it must not already exist.
-        The parameter modlist is similar to the one passed to modify(),
-        except that no operation integer need be included in the tuples.
-    """
-    return self.add_ext(dn,modlist,None,None)
-
-  def add_s(self,dn,modlist):
-    msgid = self.add(dn,modlist)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def simple_bind(self,who='',cred='',serverctrls=None,clientctrls=None):
-    """
-    simple_bind([who='' [,cred='']]) -> int
-    """
-    return self._ldap_call(self._l.simple_bind,who,cred,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def simple_bind_s(self,who='',cred='',serverctrls=None,clientctrls=None):
-    """
-    simple_bind_s([who='' [,cred='']]) -> None
-    """
-    msgid = self.simple_bind(who,cred,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def bind(self,who,cred,method=ldap.AUTH_SIMPLE):
-    """
-    bind(who, cred, method) -> int
-    """
-    assert method==ldap.AUTH_SIMPLE,'Only simple bind supported in LDAPObject.bind()'
-    return self.simple_bind(who,cred)
-
-  def bind_s(self,who,cred,method=ldap.AUTH_SIMPLE):
-    """
-    bind_s(who, cred, method) -> None
-    """
-    msgid = self.bind(who,cred,method)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def sasl_interactive_bind_s(self,who,auth,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET):
-    """
-    sasl_interactive_bind_s(who, auth) -> None
-    """
-    return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls),sasl_flags)
-
-  def compare_ext(self,dn,attr,value,serverctrls=None,clientctrls=None):
-    """
-    compare_ext(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int
-    compare_ext_s(dn, attr, value [,serverctrls=None[,clientctrls=None]]) -> int    
-    compare(dn, attr, value) -> int
-    compare_s(dn, attr, value) -> int    
-        Perform an LDAP comparison between the attribute named attr of
-        entry dn, and the value value. The synchronous form returns 0
-        for false, or 1 for true.  The asynchronous form returns the
-        message id of the initiates request, and the result of the
-        asynchronous compare can be obtained using result().
-
-        Note that this latter technique yields the answer by raising
-        the exception objects COMPARE_TRUE or COMPARE_FALSE.
-
-        A design bug in the library prevents value from containing
-        nul characters.
-    """
-    return self._ldap_call(self._l.compare_ext,dn,attr,value,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def compare_ext_s(self,dn,attr,value,serverctrls=None,clientctrls=None):
-    msgid = self.compare_ext(dn,attr,value,serverctrls,clientctrls)
-    try:
-      self.result(msgid,all=1,timeout=self.timeout)
-    except ldap.COMPARE_TRUE:
-      return 1
-    except ldap.COMPARE_FALSE:
-      return 0
-    return None
-
-  def compare(self,dn,attr,value):
-    return self.compare_ext(dn,attr,value,None,None)
-
-  def compare_s(self,dn,attr,value):
-    return self.compare_ext_s(dn,attr,value,None,None)
-
-  def delete_ext(self,dn,serverctrls=None,clientctrls=None):
-    """
-    delete(dn) -> int
-    delete_s(dn) -> None
-    delete_ext(dn[,serverctrls=None[,clientctrls=None]]) -> int
-    delete_ext_s(dn[,serverctrls=None[,clientctrls=None]]) -> None
-        Performs an LDAP delete operation on dn. The asynchronous
-        form returns the message id of the initiated request, and the
-        result can be obtained from a subsequent call to result().
-    """
-    return self._ldap_call(self._l.delete_ext,dn,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def delete_ext_s(self,dn,serverctrls=None,clientctrls=None):
-    msgid = self.delete_ext(dn,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def delete(self,dn):
-    return self.delete_ext(dn,None,None)
-
-  def delete_s(self,dn):
-    return self.delete_ext_s(dn,None,None)
-
-  def modify_ext(self,dn,modlist,serverctrls=None,clientctrls=None):
-    """
-    modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
-    """
-    return self._ldap_call(self._l.modify_ext,dn,modlist,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def modify_ext_s(self,dn,modlist,serverctrls=None,clientctrls=None):
-    msgid = self.modify_ext(dn,modlist,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def modify(self,dn,modlist):
-    """
-    modify(dn, modlist) -> int
-    modify_s(dn, modlist) -> None    
-    modify_ext(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> int
-    modify_ext_s(dn, modlist[,serverctrls=None[,clientctrls=None]]) -> None
-        Performs an LDAP modify operation on an entry's attributes.
-        dn is the DN of the entry to modify, and modlist is the list
-        of modifications to make to the entry.
-
-	Each element of the list modlist should be a tuple of the form
-	(mod_op,mod_type,mod_vals), where mod_op is the operation (one of
-	MOD_ADD, MOD_DELETE, MOD_INCREMENT or MOD_REPLACE), mod_type is a
-	string indicating the attribute type name, and mod_vals is either a
-	string value or a list of string values to add, delete, increment by or
-	replace respectively.  For the delete operation, mod_vals may be None
-	indicating that all attributes are to be deleted.
-
-        The asynchronous modify() returns the message id of the
-        initiated request.
-    """
-    return self.modify_ext(dn,modlist,None,None)
-
-  def modify_s(self,dn,modlist):
-    msgid = self.modify(dn,modlist)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def modrdn(self,dn,newrdn,delold=1):
-    """
-    modrdn(dn, newrdn [,delold=1]) -> int
-    modrdn_s(dn, newrdn [,delold=1]) -> None    
-        Perform a modify RDN operation. These routines take dn, the
-        DN of the entry whose RDN is to be changed, and newrdn, the
-        new RDN to give to the entry. The optional parameter delold
-        is used to specify whether the old RDN should be kept as
-        an attribute of the entry or not.  The asynchronous version
-        returns the initiated message id.
-
-        This operation is emulated by rename() and rename_s() methods
-        since the modrdn2* routines in the C library are deprecated.
-    """
-    return self.rename(dn,newrdn,None,delold)
-
-  def modrdn_s(self,dn,newrdn,delold=1):
-    return self.rename_s(dn,newrdn,None,delold)
-
-  def passwd(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
-    return self._ldap_call(self._l.passwd,user,oldpw,newpw,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def passwd_s(self,user,oldpw,newpw,serverctrls=None,clientctrls=None):
-    msgid = self.passwd(user,oldpw,newpw,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def rename(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
-    """
-    rename(dn, newrdn [, newsuperior=None [,delold=1][,serverctrls=None[,clientctrls=None]]]) -> int
-    rename_s(dn, newrdn [, newsuperior=None] [,delold=1][,serverctrls=None[,clientctrls=None]]) -> None
-        Perform a rename entry operation. These routines take dn, the
-        DN of the entry whose RDN is to be changed, newrdn, the
-        new RDN, and newsuperior, the new parent DN, to give to the entry.
-        If newsuperior is None then only the RDN is modified.
-        The optional parameter delold is used to specify whether the
-        old RDN should be kept as an attribute of the entry or not.
-        The asynchronous version returns the initiated message id.
-
-        This actually corresponds to the rename* routines in the
-        LDAP-EXT C API library.
-    """
-    return self._ldap_call(self._l.rename,dn,newrdn,newsuperior,delold,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def rename_s(self,dn,newrdn,newsuperior=None,delold=1,serverctrls=None,clientctrls=None):
-    msgid = self.rename(dn,newrdn,newsuperior,delold,serverctrls,clientctrls)
-    return self.result(msgid,all=1,timeout=self.timeout)
-
-  def result(self,msgid=ldap.RES_ANY,all=1,timeout=None):
-    """
-    result([msgid=RES_ANY [,all=1 [,timeout=None]]]) -> (result_type, result_data)
-
-        This method is used to wait for and return the result of an
-        operation previously initiated by one of the LDAP asynchronous
-        operation routines (eg search(), modify(), etc.) They all
-        returned an invocation identifier (a message id) upon successful
-        initiation of their operation. This id is guaranteed to be
-        unique across an LDAP session, and can be used to request the
-        result of a specific operation via the msgid parameter of the
-        result() method.
-
-        If the result of a specific operation is required, msgid should
-        be set to the invocation message id returned when the operation
-        was initiated; otherwise RES_ANY should be supplied.
-
-        The all parameter only has meaning for search() responses
-        and is used to select whether a single entry of the search
-        response should be returned, or to wait for all the results
-        of the search before returning.
-
-        A search response is made up of zero or more search entries
-        followed by a search result. If all is 0, search entries will
-        be returned one at a time as they come in, via separate calls
-        to result(). If all is 1, the search response will be returned
-        in its entirety, i.e. after all entries and the final search
-        result have been received.
-
-        For all set to 0, result tuples
-        trickle in (with the same message id), and with the result type
-        RES_SEARCH_ENTRY, until the final result which has a result
-        type of RES_SEARCH_RESULT and a (usually) empty data field.
-        When all is set to 1, only one result is returned, with a
-        result type of RES_SEARCH_RESULT, and all the result tuples
-        listed in the data field.
-
-        The method returns a tuple of the form (result_type,
-        result_data).  The result_type is one of the constants RES_*.
-
-        See search() for a description of the search result's
-        result_data, otherwise the result_data is normally meaningless.
-
-        The result() method will block for timeout seconds, or
-        indefinitely if timeout is negative.  A timeout of 0 will effect
-        a poll. The timeout can be expressed as a floating-point value.
-        If timeout is None the default in self.timeout is used.
-
-        If a timeout occurs, a TIMEOUT exception is raised, unless
-        polling (timeout = 0), in which case (None, None) is returned.
-    """
-    res_type,res_data,res_msgid = self.result2(msgid,all,timeout)
-    return res_type,res_data
-
-  def result2(self,msgid=ldap.RES_ANY,all=1,timeout=None):
-    res_type, res_data, res_msgid, srv_ctrls = self.result3(msgid,all,timeout)
-    return res_type, res_data, res_msgid
- 
-  def result3(self,msgid=ldap.RES_ANY,all=1,timeout=None):
-    if timeout is None:
-      timeout = self.timeout
-    ldap_result = self._ldap_call(self._l.result3,msgid,all,timeout)
-    if ldap_result is None:
-      rtype, rdata, rmsgid, decoded_serverctrls = (None,None,None,None)
-    else:
-      rtype, rdata, rmsgid, serverctrls = ldap_result
-      decoded_serverctrls = DecodeControlTuples(serverctrls)
-    return rtype, rdata, rmsgid, decoded_serverctrls
- 
-  def search_ext(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,serverctrls=None,clientctrls=None,timeout=-1,sizelimit=0):
-    """
-    search(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]]) -> int
-    search_s(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0]]])
-    search_st(base, scope [,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,timeout=-1]]]])
-    search_ext(base,scope,[,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]]]]]]])
-    search_ext_s(base,scope,[,filterstr='(objectClass=*)' [,attrlist=None [,attrsonly=0 [,serverctrls=None [,clientctrls=None [,timeout=-1 [,sizelimit=0]]]]]]])
-
-        Perform an LDAP search operation, with base as the DN of
-        the entry at which to start the search, scope being one of
-        SCOPE_BASE (to search the object itself), SCOPE_ONELEVEL
-        (to search the object's immediate children), or SCOPE_SUBTREE
-        (to search the object and all its descendants).
-
-        filter is a string representation of the filter to
-        apply in the search (see RFC 2254).
-
-        Each result tuple is of the form (dn,entry), where dn is a
-        string containing the DN (distinguished name) of the entry, and
-        entry is a dictionary containing the attributes.
-        Attributes types are used as string dictionary keys and attribute
-        values are stored in a list as dictionary value.
-
-        The DN in dn is extracted using the underlying ldap_get_dn(),
-        which may raise an exception of the DN is malformed.
-
-        If attrsonly is non-zero, the values of attrs will be
-        meaningless (they are not transmitted in the result).
-
-        The retrieved attributes can be limited with the attrlist
-        parameter.  If attrlist is None, all the attributes of each
-        entry are returned.
-
-        serverctrls=None
-
-        clientctrls=None
-
-        The synchronous form with timeout, search_st() or search_ext_s(),
-        will block for at most timeout seconds (or indefinitely if
-        timeout is negative). A TIMEOUT exception is raised if no result is
-        received within the time.
-
-        The amount of search results retrieved can be limited with the
-        sizelimit parameter if non-zero.
-    """
-    return self._ldap_call(
-      self._l.search_ext,
-      base,scope,filterstr,
-      attrlist,attrsonly,
-      EncodeControlTuples(serverctrls),
-      EncodeControlTuples(clientctrls),
-      timeout,sizelimit,
-    )
-
-  def search_ext_s(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,serverctrls=None,clientctrls=None,timeout=-1,sizelimit=0):
-    msgid = self.search_ext(base,scope,filterstr,attrlist,attrsonly,serverctrls,clientctrls,timeout,sizelimit)
-    return self.result(msgid,all=1,timeout=timeout)[1]
-
-  def search(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0):
-    return self.search_ext(base,scope,filterstr,attrlist,attrsonly,None,None)
-
-  def search_s(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0):
-    return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)
-
-  def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1):
-    return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout)
-
-  def set_cache_options(self,*args,**kwargs):
-    """
-    set_cache_options(option) -> None    
-        Changes the caching behaviour. Currently supported options are
-            CACHE_OPT_CACHENOERRS, which suppresses caching of requests
-                that resulted in an error, and
-            CACHE_OPT_CACHEALLERRS, which enables caching of all requests.
-        The default behaviour is not to cache requests that result in
-        errors, except those that result in a SIZELIMIT_EXCEEDED exception.
-    """
-    return self._ldap_call(self._l.set_cache_options,*args,**kwargs)
-
-  def start_tls_s(self):
-    """
-    start_tls_s() -> None    
-    Negotiate TLS with server. The `version' attribute must have been
-    set to VERSION3 before calling start_tls_s.
-    If TLS could not be started an exception will be raised.
-    """
-    return self._ldap_call(self._l.start_tls_s)
-  
-  def unbind_ext(self,serverctrls=None,clientctrls=None):
-    """
-    unbind() -> int    
-    unbind_s() -> None
-    unbind_ext() -> int    
-    unbind_ext_s() -> None
-        This call is used to unbind from the directory, terminate
-        the current association, and free resources. Once called, the
-        connection to the LDAP server is closed and the LDAP object
-        is invalid. Further invocation of methods on the object will
-        yield an exception.
-    
-        The unbind and unbind_s methods are identical, and are
-        synchronous in nature
-    """
-    return self._ldap_call(self._l.unbind_ext,EncodeControlTuples(serverctrls),EncodeControlTuples(clientctrls))
-
-  def unbind_ext_s(self,serverctrls=None,clientctrls=None):
-    msgid = self.unbind_ext(serverctrls,clientctrls)
-    if msgid!=None:
-      return self.result(msgid,all=1,timeout=self.timeout)
-
-  def unbind(self):
-    return self.unbind_ext(None,None)
-
-  def unbind_s(self):
-    return self.unbind_ext_s(None,None)
-
-  def whoami_s(self,serverctrls=None,clientctrls=None):
-    return self._ldap_call(self._l.whoami_s,serverctrls,clientctrls)
-
-  def get_option(self,option):
-    result = self._ldap_call(self._l.get_option,option)
-    if option==ldap.OPT_SERVER_CONTROLS or option==ldap.OPT_CLIENT_CONTROLS:
-      result = DecodeControlTuples(result)
-    return result
-
-  def set_option(self,option,invalue):
-    if option==ldap.OPT_SERVER_CONTROLS or option==ldap.OPT_CLIENT_CONTROLS:
-      invalue = EncodeControlTuples(invalue)
-    return self._ldap_call(self._l.set_option,option,invalue)
-
-  def search_subschemasubentry_s(self,dn=''):
-    """
-    Returns the distinguished name of the sub schema sub entry
-    for a part of a DIT specified by dn.
-
-    None as result indicates that the DN of the sub schema sub entry could
-    not be determined.
-    """
-    try:
-      r = self.search_s(
-        dn,ldap.SCOPE_BASE,'(objectClass=*)',['subschemaSubentry']
-      )
-    except (ldap.NO_SUCH_OBJECT,ldap.NO_SUCH_ATTRIBUTE,ldap.INSUFFICIENT_ACCESS):
-      r = []
-    except ldap.UNDEFINED_TYPE:
-      return None
-    try:
-      if r:
-        e = ldap.cidict.cidict(r[0][1])
-        search_subschemasubentry_dn = e.get('subschemaSubentry',[None])[0]
-        if search_subschemasubentry_dn is None:
-          if dn:
-            # Try to find sub schema sub entry in root DSE
-            return self.search_subschemasubentry_s(dn='')
-          else:
-            # If dn was already root DSE we can return here
-            return None
-        else:
-          return search_subschemasubentry_dn
-    except IndexError:
-      return None
-
-  def read_subschemasubentry_s(self,subschemasubentry_dn,attrs=None):
-    """
-    Returns the sub schema sub entry's data
-    """
-    attrs = attrs or SCHEMA_ATTRS
-    try:
-      r = self.search_s(
-        subschemasubentry_dn,ldap.SCOPE_BASE,
-        '(objectClass=subschema)',
-        attrs
-      )
-    except ldap.NO_SUCH_OBJECT:
-      return None
-    else:
-      if r:
-        return r[0][1]
-      else:
-        return None
-
-
-class NonblockingLDAPObject(SimpleLDAPObject):
-
-  def __init__(self,uri,trace_level=0,trace_file=None,result_timeout=-1):
-    self._result_timeout = result_timeout
-    SimpleLDAPObject.__init__(self,uri,trace_level,trace_file)
-
-  def result(self,msgid=ldap.RES_ANY,all=1,timeout=-1):
-    """
-    """
-    ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout)
-    if not all:
-      return ldap_result
-    start_time = time.time()
-    all_results = []
-    while all:
-      while ldap_result[0] is None:
-        if (timeout>=0) and (time.time()-start_time>timeout):
-          self._ldap_call(self._l.abandon,msgid)
-          raise ldap.TIMEOUT(
-            "LDAP time limit (%d secs) exceeded." % (timeout)
-          )
-        time.sleep(0.00001)
-        ldap_result = self._ldap_call(self._l.result,msgid,0,self._result_timeout)
-      if ldap_result[1] is None:
-        break
-      all_results.extend(ldap_result[1])
-      ldap_result = None,None
-    return all_results
-
-  def search_st(self,base,scope,filterstr='(objectClass=*)',attrlist=None,attrsonly=0,timeout=-1):
-    msgid = self.search(base,scope,filterstr,attrlist,attrsonly)
-    return self.result(msgid,all=1,timeout=timeout)
-
-
-class ReconnectLDAPObject(SimpleLDAPObject):
-  """
-  In case of server failure (ldap.SERVER_DOWN) the implementations
-  of all synchronous operation methods (search_s() etc.) are doing
-  an automatic reconnect and rebind and will retry the very same
-  operation.
-  
-  This is very handy for broken LDAP server implementations
-  (e.g. in Lotus Domino) which drop connections very often making
-  it impossible to have a long-lasting control flow in the
-  application.
-  """
-
-  __transient_attrs__ = {
-    '_l':None,
-    '_ldap_object_lock':None,
-    '_trace_file':None,
-  }
-
-  def __init__(
-    self,uri,
-    trace_level=0,trace_file=None,trace_stack_limit=5,
-    retry_max=1,retry_delay=60.0
-  ):
-    """
-    Parameters like SimpleLDAPObject.__init__() with these
-    additional arguments:
-
-    retry_max
-        Maximum count of reconnect trials
-    retry_delay
-        Time span to wait between two reconnect trials
-    """
-    self._uri = uri
-    self._options = {}
-    self._last_bind = None
-    SimpleLDAPObject.__init__(self,uri,trace_level,trace_file,trace_stack_limit)
-    self._retry_max = retry_max
-    self._retry_delay = retry_delay
-    self._start_tls = 0
-    self._reconnects_done = 0L
-
-  def __getstate__(self):
-    """return data representation for pickled object"""
-    d = {}
-    for k,v in self.__dict__.items():
-      if not self.__transient_attrs__.has_key(k):
-        d[k] = v
-    return d
-
-  def __setstate__(self,d):
-    """set up the object from pickled data"""
-    self.__dict__.update(d)
-    self._ldap_object_lock = self._ldap_lock()
-    self._trace_file = sys.stdout
-    self.reconnect(self._uri)
-
-  def _apply_last_bind(self):
-    if self._last_bind!=None:
-      func,args,kwargs = self._last_bind
-      func(*args,**kwargs)
-
-  def _restore_options(self):
-    """Restore all recorded options"""
-    for k,v in self._options.items():
-      SimpleLDAPObject.set_option(self,k,v)
-
-  def reconnect(self,uri):
-    # Drop and clean up old connection completely
-    # Reconnect
-    reconnect_counter = self._retry_max
-    while reconnect_counter:
-      if __debug__ and self._trace_level>=1:
-        self._trace_file.write('*** Try %d. reconnect to %s...\n' % (
-          self._retry_max-reconnect_counter+1,uri
-        ))
-      try:
-        # Do the connect
-        self._l = ldap.functions._ldap_function_call(_ldap.initialize,uri)
-        self._restore_options()
-        # StartTLS extended operation in case this was called before
-        if self._start_tls:
-          self.start_tls_s()
-        # Repeat last simple or SASL bind
-        self._apply_last_bind()
-      except ldap.SERVER_DOWN,e:
-        SimpleLDAPObject.unbind_s(self)
-        del self._l
-        if __debug__ and self._trace_level>=1:
-          self._trace_file.write('*** %d. reconnect to %s failed\n' % (
-            self._retry_max-reconnect_counter+1,uri
-          ))
-        reconnect_counter = reconnect_counter-1
-        if not reconnect_counter:
-          raise
-        if __debug__ and self._trace_level>=1:
-          self._trace_file.write('=> delay %s...\n' % (self._retry_delay))
-        time.sleep(self._retry_delay)
-      else:
-        if __debug__ and self._trace_level>=1:
-          self._trace_file.write('*** %d. reconnect to %s successful, last operation will be repeated\n' % (
-            self._retry_max-reconnect_counter+1,uri
-          ))
-        self._reconnects_done = self._reconnects_done + 1L
-        break
-
-  def _apply_method_s(self,func,*args,**kwargs):
-    if not self.__dict__.has_key('_l'):
-       self.reconnect(self._uri)
-    try:
-      return func(self,*args,**kwargs)
-    except ldap.SERVER_DOWN:
-      SimpleLDAPObject.unbind_s(self)
-      del self._l
-      # Try to reconnect
-      self.reconnect(self._uri)
-      # Re-try last operation
-      return func(self,*args,**kwargs)
-
-  def set_option(self,option,invalue):
-    self._options[option] = invalue
-    SimpleLDAPObject.set_option(self,option,invalue)
-
-  def simple_bind_s(self,*args,**kwargs):
-    self._last_bind = (self.simple_bind_s,args,kwargs)
-    return SimpleLDAPObject.simple_bind_s(self,*args,**kwargs)
-
-  def start_tls_s(self):
-    res = SimpleLDAPObject.start_tls_s(self)
-    self._start_tls = 1
-    return res
-
-  def sasl_interactive_bind_s(self,*args,**kwargs):
-    """
-    sasl_interactive_bind_s(who, auth) -> None
-    """
-    self._last_bind = (self.sasl_interactive_bind_s,args,kwargs)
-    return SimpleLDAPObject.sasl_interactive_bind_s(self,*args,**kwargs)
-
-  def add_ext_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.add_ext_s,*args,**kwargs)
-
-  def cancel_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.cancel_s,*args,**kwargs)
-
-  def compare_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.compare_s,*args,**kwargs)
-
-  def delete_ext_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.delete_ext_s,*args,**kwargs)
-
-  def modify_ext_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.modify_ext_s,*args,**kwargs)
-
-  def rename_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.rename_s,*args,**kwargs)
-
-  def search_ext_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.search_ext_s,*args,**kwargs)
-
-  def whoami_s(self,*args,**kwargs):
-    return self._apply_method_s(SimpleLDAPObject.whoami_s,*args,**kwargs)
-
-
-# The class called LDAPObject will be used as default for
-# ldap.open() and ldap.initialize()
-LDAPObject = SimpleLDAPObject

+ 0 - 115
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/modlist.py

@@ -1,115 +0,0 @@
-"""
-ldap.modlist - create add/modify modlist's
-
-See http://www.python-ldap.org/ for details.
-
-$Id: modlist.py,v 1.17 2009/07/26 11:09:58 stroeder Exp $
-
-Python compability note:
-This module is known to work with Python 2.0+ but should work
-with Python 1.5.2 as well.
-"""
-
-from ldap import __version__
-
-import string,ldap
-
-
-def list_dict(l):
-  """
-  return a dictionary with all items of l being the keys of the dictionary
-  """
-  d = {}
-  for i in l:
-    d[i]=None
-  return d
-
-
-def addModlist(entry,ignore_attr_types=None):
-  """Build modify list for call of method LDAPObject.add()"""
-  ignore_attr_types = list_dict(map(string.lower,(ignore_attr_types or [])))
-  modlist = []
-  for attrtype in entry.keys():
-    if ignore_attr_types.has_key(string.lower(attrtype)):
-      # This attribute type is ignored
-      continue
-    # Eliminate empty attr value strings in list
-    attrvaluelist = filter(lambda x:x!=None,entry[attrtype])
-    if attrvaluelist:
-      modlist.append((attrtype,entry[attrtype]))
-  return modlist # addModlist()
-
-
-def modifyModlist(
-  old_entry,new_entry,ignore_attr_types=None,ignore_oldexistent=0
-):
-  """
-  Build differential modify list for calling LDAPObject.modify()/modify_s()
-
-  old_entry
-      Dictionary holding the old entry
-  new_entry
-      Dictionary holding what the new entry should be
-  ignore_attr_types
-      List of attribute type names to be ignored completely
-  ignore_oldexistent
-      If non-zero attribute type names which are in old_entry
-      but are not found in new_entry at all are not deleted.
-      This is handy for situations where your application
-      sets attribute value to '' for deleting an attribute.
-      In most cases leave zero.
-  """
-  ignore_attr_types = list_dict(map(string.lower,(ignore_attr_types or [])))
-  modlist = []
-  attrtype_lower_map = {}
-  for a in old_entry.keys():
-    attrtype_lower_map[string.lower(a)]=a
-  for attrtype in new_entry.keys():
-    attrtype_lower = string.lower(attrtype)
-    if ignore_attr_types.has_key(attrtype_lower):
-      # This attribute type is ignored
-      continue
-    # Filter away null-strings
-    new_value = filter(lambda x:x!=None,new_entry[attrtype])
-    if attrtype_lower_map.has_key(attrtype_lower):
-      old_value = old_entry.get(attrtype_lower_map[attrtype_lower],[])
-      old_value = filter(lambda x:x!=None,old_value)
-      del attrtype_lower_map[attrtype_lower]
-    else:
-      old_value = []
-    if not old_value and new_value:
-      # Add a new attribute to entry
-      modlist.append((ldap.MOD_ADD,attrtype,new_value))
-    elif old_value and new_value:
-      # Replace existing attribute
-      replace_attr_value = len(old_value)!=len(new_value)
-      if not replace_attr_value:
-        old_value_dict=list_dict(old_value)
-        new_value_dict=list_dict(new_value)
-        delete_values = []
-        for v in old_value:
-          if not new_value_dict.has_key(v):
-            replace_attr_value = 1
-            break
-        add_values = []
-        if not replace_attr_value:
-          for v in new_value:
-            if not old_value_dict.has_key(v):
-              replace_attr_value = 1
-              break
-      if replace_attr_value:
-        modlist.append((ldap.MOD_DELETE,attrtype,None))
-        modlist.append((ldap.MOD_ADD,attrtype,new_value))
-    elif old_value and not new_value:
-      # Completely delete an existing attribute
-      modlist.append((ldap.MOD_DELETE,attrtype,None))
-  if not ignore_oldexistent:
-    # Remove all attributes of old_entry which are not present
-    # in new_entry at all
-    for a in attrtype_lower_map.keys():
-      if ignore_attr_types.has_key(a):
-        # This attribute type is ignored
-        continue
-      attrtype = attrtype_lower_map[a]
-      modlist.append((ldap.MOD_DELETE,attrtype,None))
-  return modlist # modifyModlist()

+ 0 - 33
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/resiter.py

@@ -1,33 +0,0 @@
-"""
-ldap.resiter - processing LDAP results with iterators
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: resiter.py,v 1.4 2009/07/26 11:09:58 stroeder Exp $
-
-Python compability note:
-Requires Python 2.3+
-"""
-
-import ldap
-
-from ldap import __version__
-
-
-class ResultProcessor:
-  """
-  Mix-in class for ldap.ldapopbject.LDAPObject which adds method allresults().
-  """
-
-  def allresults(self,msgid,timeout=-1):
-    """
-    Generator function which returns an iterator for processing all LDAP operation
-    results of the given msgid.
-    """
-    result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
-    while result_type and result_list:
-      # Loop over list of search results
-      for result_item in result_list:
-        yield (result_type,result_list,result_msgid,result_serverctrls)
-      result_type,result_list,result_msgid,result_serverctrls = self.result3(msgid,0,timeout)
-    return # allresults()

+ 0 - 111
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/sasl.py

@@ -1,111 +0,0 @@
-"""
-sasl.py - support for SASL mechanism
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: sasl.py,v 1.15 2009/07/26 11:09:58 stroeder Exp $
-
-Description:
-The ldap.sasl module provides SASL authentication classes.
-Each class provides support for one SASL mechanism. This is done by
-implementing a callback() - method, which will be called by the
-LDAPObject's sasl_bind_s() method
-Implementing support for new sasl mechanism is very easy --- see
-the examples of digest_md5 and gssapi.
-
-Compability:
-- Tested with Python 2.0+ but should work with Python 1.5.x
-"""
-
-from ldap import __version__
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-  from ldap import _trace_level,_trace_file,_trace_stack_limit
-
-# These are the SASL callback id's , as defined in sasl.h
-CB_USER        = 0x4001
-CB_AUTHNAME    = 0x4002
-CB_LANGUAGE    = 0x4003
-CB_PASS        = 0x4004
-CB_ECHOPROMPT  = 0x4005
-CB_NOECHOPROMPT= 0x4006
-CB_GETREALM    = 0x4007
-
-class sasl:
-    """This class handles SASL interactions for authentication.
-    If an instance of this class is passed to ldap's sasl_bind_s()
-    method, the library will call its callback() method. For
-    specific SASL authentication mechanisms, this method can be
-    overridden"""
-
-    def __init__(self,cb_value_dict,mech):
-        """ The (generic) base class takes a cb_value_dictionary of
-        question-answer pairs. Questions are specified by the respective
-        SASL callback id's. The mech argument is a string that specifies
-        the SASL mechaninsm to be uesd."""
-        self.cb_value_dict = cb_value_dict or {}
-        self.mech = mech
-
-    def callback(self,cb_id,challenge,prompt,defresult):
-        """ The callback method will be called by the sasl_bind_s()
-        method several times. Each time it will provide the id, which
-        tells us what kind of information is requested (the CB_ ...
-        constants above). The challenge might be a short (english) text
-        or some binary string, from which the return value is calculated.
-        The prompt argument is always a human-readable description string;
-        The defresult is a default value provided by the sasl library
-
-        Currently, we do not use the challenge and prompt information, and
-        return only information which is stored in the self.cb_value_dict
-        cb_value_dictionary. Note that the current callback interface is not very
-        useful for writing generic sasl GUIs, which would need to know all
-        the questions to ask, before the answers are returned to the sasl
-        lib (in contrast to one question at a time)."""
-        
-        # The following print command might be useful for debugging
-        # new sasl mechanisms. So it is left here
-        cb_result = self.cb_value_dict.get(cb_id,defresult) or ''
-        if __debug__:
-          if _trace_level>=1:
-            _trace_file.write("*** id=%d, challenge=%s, prompt=%s, defresult=%s\n-> %s\n" % (
-                cb_id, challenge, prompt, repr(defresult), repr(self.cb_value_dict.get(cb_result))
-              ))
-        return cb_result
-    
-
-class cram_md5(sasl):
-    """This class handles SASL CRAM-MD5 authentication."""
-
-    def __init__(self,authc_id, password, authz_id=""):
-        auth_dict = {CB_AUTHNAME:authc_id, CB_PASS:password,
-                     CB_USER:authz_id}
-        sasl.__init__(self,auth_dict,"CRAM-MD5")
-
-
-class digest_md5(sasl):
-    """This class handles SASL DIGEST-MD5 authentication."""
-
-    def __init__(self,authc_id, password, authz_id=""):
-        auth_dict = {CB_AUTHNAME:authc_id, CB_PASS:password,
-                     CB_USER:authz_id}
-        sasl.__init__(self,auth_dict,"DIGEST-MD5")
-
-
-class gssapi(sasl):
-    """This class handles SASL GSSAPI (i.e. Kerberos V)
-    authentication."""
-
-    def __init__(self,authz_id=""):
-        sasl.__init__(self, {CB_USER:authz_id},"GSSAPI")
-
-
-class external(sasl):
-    """This class handles SASL EXTERNAL authentication
-    (i.e. X.509 client certificate)"""
-
-    def __init__(self,authz_id=""):
-        sasl.__init__(self, {CB_USER:authz_id},"EXTERNAL")
-
-

+ 0 - 12
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/__init__.py

@@ -1,12 +0,0 @@
-"""
-ldap.schema -  LDAPv3 schema handling
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: __init__.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
-"""
-
-from ldap import __version__
-
-from ldap.schema.subentry import SubSchema,SCHEMA_ATTRS,SCHEMA_CLASS_MAPPING,SCHEMA_ATTR_MAPPING,urlfetch
-from ldap.schema.models import *

+ 0 - 617
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/models.py

@@ -1,617 +0,0 @@
-"""
-schema.py - support for subSchemaSubEntry information
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: models.py,v 1.38 2009/10/31 19:52:45 stroeder Exp $
-"""
-
-import UserDict,ldap.cidict
-
-from ldap.schema.tokenizer import split_tokens,extract_tokens
-
-if __debug__:
-  from types import TupleType,StringType,IntType
-  try:
-    from types import BooleanType
-  except ImportError:
-    BooleanType = IntType
-
-
-NOT_HUMAN_READABLE_LDAP_SYNTAXES = {
-  '1.3.6.1.4.1.1466.115.121.1.4':None,  # Audio
-  '1.3.6.1.4.1.1466.115.121.1.5':None,  # Binary
-  '1.3.6.1.4.1.1466.115.121.1.8':None,  # Certificate
-  '1.3.6.1.4.1.1466.115.121.1.9':None,  # Certificate List
-  '1.3.6.1.4.1.1466.115.121.1.10':None, # Certificate Pair
-  '1.3.6.1.4.1.1466.115.121.1.23':None, # G3 FAX
-  '1.3.6.1.4.1.1466.115.121.1.28':None, # JPEG
-  '1.3.6.1.4.1.1466.115.121.1.40':None, # Octet String
-  '1.3.6.1.4.1.1466.115.121.1.49':None, # Supported Algorithm
-}
-
-
-class SchemaElement:
-  """
-  Base class for all schema element classes. Not used directly!
-  """
-  token_defaults = {
-    'DESC':(None,),
-  }
-  
-  def __init__(self,schema_element_str=None):
-    if schema_element_str:
-      l = split_tokens(schema_element_str,self.token_defaults)
-      self.set_id(l[1])
-      assert type(self.get_id())==StringType
-      d = extract_tokens(l,self.token_defaults)
-      self._set_attrs(l,d)
-
-  def _set_attrs(self,l,d):
-    self.desc = d['DESC'][0]
-    return
-
-  def set_id(self,element_id):
-    self.oid = element_id
-
-  def get_id(self):
-    return self.oid
-
-  def key_attr(self,key,value,quoted=0):
-    assert value is None or type(value)==StringType,TypeError("value has to be of StringType, was %s" % repr(value))
-    if value:
-      if quoted:        
-        return " %s '%s'" % (key,value.replace("'","\\'"))
-      else:
-        return " %s %s" % (key,value)
-    else:
-      return ""
-
-  def key_list(self,key,values,sep=' ',quoted=0):
-    assert type(values)==TupleType,TypeError("values has to be of ListType")
-    if not values:
-      return ''
-    if quoted:
-      quoted_values = [ "'%s'" % value.replace("'","\\'") for value in values ]
-    else:
-      quoted_values = values
-    if len(values)==1:
-      return ' %s %s' % (key,quoted_values[0])
-    else:
-      return ' %s ( %s )' % (key,sep.join(quoted_values))
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    return '( %s )' % ''.join(result)
-
-
-class ObjectClass(SchemaElement):
-  """
-  ObjectClassDescription = "(" whsp
-      numericoid whsp      ; ObjectClass identifier
-      [ "NAME" qdescrs ]
-      [ "DESC" qdstring ]
-      [ "OBSOLETE" whsp ]
-      [ "SUP" oids ]       ; Superior ObjectClasses
-      [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
-                           ; default structural
-      [ "MUST" oids ]      ; AttributeTypes
-      [ "MAY" oids ]       ; AttributeTypes
-  whsp ")"
-  """
-  schema_attribute = 'objectClasses'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'SUP':(()),
-    'STRUCTURAL':None,
-    'AUXILIARY':None,
-    'ABSTRACT':None,
-    'MUST':(()),
-    'MAY':()
-  }
-
-  def _set_attrs(self,l,d):
-    self.obsolete = d['OBSOLETE']!=None
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.must = d['MUST']
-    self.may = d['MAY']
-    # Default is STRUCTURAL, see RFC2552 or draft-ietf-ldapbis-syntaxes
-    self.kind = 0
-    if d['ABSTRACT']!=None:
-      self.kind = 1
-    elif d['AUXILIARY']!=None:
-      self.kind = 2
-    if self.kind==0 and not d['SUP'] and self.oid!='2.5.6.0':
-      # STRUCTURAL object classes are sub-classes of 'top' by default
-      self.sup = ('top',)
-    else:
-      self.sup = d['SUP']
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.sup)==TupleType
-    assert type(self.kind)==IntType
-    assert type(self.must)==TupleType
-    assert type(self.may)==TupleType
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append(self.key_list('SUP',self.sup,sep=' $ '))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append({0:' STRUCTURAL',1:' ABSTRACT',2:' AUXILIARY'}[self.kind])
-    result.append(self.key_list('MUST',self.must,sep=' $ '))
-    result.append(self.key_list('MAY',self.may,sep=' $ '))
-    return '( %s )' % ''.join(result)
-
-
-AttributeUsage = ldap.cidict.cidict({
-  'userApplication':0,
-  'userApplications':0,
-  'directoryOperation':1,
-  'distributedOperation':2,
-  'dSAOperation':3,
-})
-
-
-class AttributeType(SchemaElement):
-  """
-      AttributeTypeDescription = "(" whsp
-            numericoid whsp              ; AttributeType identifier
-          [ "NAME" qdescrs ]             ; name used in AttributeType
-          [ "DESC" qdstring ]            ; description
-          [ "OBSOLETE" whsp ]
-          [ "SUP" woid ]                 ; derived from this other
-                                         ; AttributeType
-          [ "EQUALITY" woid              ; Matching Rule name
-          [ "ORDERING" woid              ; Matching Rule name
-          [ "SUBSTR" woid ]              ; Matching Rule name
-          [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3
-          [ "SINGLE-VALUE" whsp ]        ; default multi-valued
-          [ "COLLECTIVE" whsp ]          ; default not collective
-          [ "NO-USER-MODIFICATION" whsp ]; default user modifiable
-          [ "USAGE" whsp AttributeUsage ]; default userApplications
-          whsp ")"
-
-      AttributeUsage =
-          "userApplications"     /
-          "directoryOperation"   /
-          "distributedOperation" / ; DSA-shared
-          "dSAOperation"          ; DSA-specific, value depends on server
-  """
-  schema_attribute = 'attributeTypes'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'SUP':(()),
-    'EQUALITY':(None,),
-    'ORDERING':(None,),
-    'SUBSTR':(None,),
-    'SYNTAX':(None,),
-    'SINGLE-VALUE':None,
-    'COLLECTIVE':None,
-    'NO-USER-MODIFICATION':None,
-    'USAGE':('userApplications',)
-  }
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.sup = d['SUP']
-    self.equality = d['EQUALITY'][0]
-    self.ordering = d['ORDERING'][0]
-    self.substr = d['SUBSTR'][0]
-    try:
-      syntax = d['SYNTAX'][0]
-    except IndexError:
-      self.syntax = None
-      self.syntax_len = None
-    else:
-      if syntax is None:
-	self.syntax = None
-	self.syntax_len = None
-      else:
-	try:
-          self.syntax,syntax_len = d['SYNTAX'][0].split("{")
-	except ValueError:
-          self.syntax = d['SYNTAX'][0]
-          self.syntax_len = None
-          for i in l:
-            if i.startswith("{") and i.endswith("}"):
-              self.syntax_len=long(i[1:-1])
-	else:
-          self.syntax_len = long(syntax_len[:-1])
-    self.single_value = d['SINGLE-VALUE']!=None
-    self.collective = d['COLLECTIVE']!=None
-    self.no_user_mod = d['NO-USER-MODIFICATION']!=None
-    try:
-      self.usage = AttributeUsage[d['USAGE'][0]]
-    except KeyError:
-      raise
-    self.usage = AttributeUsage.get(d['USAGE'][0],0)
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.sup)==TupleType,'attribute sup has type %s' % (type(self.sup))
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.single_value)==BooleanType and (self.single_value==0 or self.single_value==1)
-    assert type(self.no_user_mod)==BooleanType and (self.no_user_mod==0 or self.no_user_mod==1)
-    assert self.syntax is None or type(self.syntax)==StringType
-    assert self.syntax_len is None or type(self.syntax_len)==type(0L)
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append(self.key_list('SUP',self.sup,sep=' $ '))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_attr('EQUALITY',self.equality))
-    result.append(self.key_attr('ORDERING',self.ordering))
-    result.append(self.key_attr('SUBSTR',self.substr))
-    result.append(self.key_attr('SYNTAX',self.syntax))
-    if self.syntax_len!=None:
-      result.append(('{%d}' % (self.syntax_len))*(self.syntax_len>0))
-    result.append({0:'',1:' SINGLE-VALUE'}[self.single_value])
-    result.append({0:'',1:' COLLECTIVE'}[self.collective])
-    result.append({0:'',1:' NO-USER-MODIFICATION'}[self.no_user_mod])
-    result.append(
-      {
-        0:"",
-        1:" USAGE directoryOperation",
-        2:" USAGE distributedOperation",
-        3:" USAGE dSAOperation",
-      }[self.usage]
-    )
-    return '( %s )' % ''.join(result)
-
-
-class LDAPSyntax(SchemaElement):
-  """
-  SyntaxDescription = "(" whsp
-      numericoid whsp
-      [ "DESC" qdstring ]
-      whsp ")"
-  """
-  schema_attribute = 'ldapSyntaxes'
-  token_defaults = {
-    'DESC':(None,),
-    'X-NOT-HUMAN-READABLE':(None,),
-  }
-
-  def _set_attrs(self,l,d):
-    self.desc = d['DESC'][0]
-    self.not_human_readable = \
-      NOT_HUMAN_READABLE_LDAP_SYNTAXES.has_key(self.oid) or \
-      d['X-NOT-HUMAN-READABLE'][0]=='TRUE'
-    assert self.desc is None or type(self.desc)==StringType
-    return
-                                  
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append(
-      {0:'',1:" X-NOT-HUMAN-READABLE 'TRUE'"}[self.not_human_readable]
-    )
-    return '( %s )' % ''.join(result)
-
-
-class MatchingRule(SchemaElement):
-  """
-  MatchingRuleDescription = "(" whsp
-      numericoid whsp  ; MatchingRule identifier
-      [ "NAME" qdescrs ]
-      [ "DESC" qdstring ]
-      [ "OBSOLETE" whsp ]
-      "SYNTAX" numericoid
-  whsp ")"
-  """
-  schema_attribute = 'matchingRules'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'SYNTAX':(None,),
-  }
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.syntax = d['SYNTAX'][0]
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert self.syntax is None or type(self.syntax)==StringType
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_attr('SYNTAX',self.syntax))
-    return '( %s )' % ''.join(result)
-
-
-class MatchingRuleUse(SchemaElement):
-  """
-  MatchingRuleUseDescription = "(" whsp
-     numericoid 
-     [ space "NAME" space qdescrs ]
-     [ space "DESC" space qdstring ]
-     [ space "OBSOLETE" ]
-     space "APPLIES" space oids    ;  AttributeType identifiers
-     extensions
-     whsp ")" 
-  """
-  schema_attribute = 'matchingRuleUse'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'APPLIES':(()),
-  }
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.applies = d['APPLIES']
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.applies)==TupleType
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_list('APPLIES',self.applies,sep=' $ '))
-    return '( %s )' % ''.join(result)
-
-
-class DITContentRule(SchemaElement):
-  """
-  DITContentRuleDescription = LPAREN WSP
-      numericoid                 ; object identifer
-      [ SP "NAME" SP qdescrs ]   ; short names
-      [ SP "DESC" SP qdstring ]  ; description
-      [ SP "OBSOLETE" ]          ; not active
-      [ SP "AUX" SP oids ]       ; auxiliary object classes
-      [ SP "MUST" SP oids ]      ; attribute types
-      [ SP "MAY" SP oids ]       ; attribute types
-      [ SP "NOT" SP oids ]       ; attribute types
-      extensions WSP RPAREN      ; extensions
-  """
-  schema_attribute = 'dITContentRules'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'AUX':(()),
-    'MUST':(()),
-    'MAY':(()),
-    'NOT':(()),
-  }
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.aux = d['AUX']
-    self.must = d['MUST']
-    self.may = d['MAY']
-    self.nots = d['NOT']
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.aux)==TupleType
-    assert type(self.must)==TupleType
-    assert type(self.may)==TupleType
-    assert type(self.nots)==TupleType
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_list('AUX',self.aux,sep=' $ '))
-    result.append(self.key_list('MUST',self.must,sep=' $ '))
-    result.append(self.key_list('MAY',self.may,sep=' $ '))
-    result.append(self.key_list('NOT',self.nots,sep=' $ '))
-    return '( %s )' % ''.join(result)
-
-
-class DITStructureRule(SchemaElement):
-  """
-  DITStructureRuleDescription = LPAREN WSP
-      ruleid                     ; rule identifier
-      [ SP "NAME" SP qdescrs ]   ; short names
-      [ SP "DESC" SP qdstring ]  ; description
-      [ SP "OBSOLETE" ]          ; not active
-      SP "FORM" SP oid           ; NameForm
-      [ SP "SUP" ruleids ]       ; superior rules
-      extensions WSP RPAREN      ; extensions
-  """
-  schema_attribute = 'dITStructureRules'
-
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'FORM':(None,),
-    'SUP':(()),
-  }
-
-  def set_id(self,element_id):
-    self.ruleid = element_id
-
-  def get_id(self):
-    return self.ruleid
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.form = d['FORM'][0]
-    self.sup = d['SUP']
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.form)==StringType
-    assert type(self.sup)==TupleType
-    return
-
-  def __str__(self):
-    result = [str(self.ruleid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_attr('FORM',self.form,quoted=0))
-    result.append(self.key_list('SUP',self.sup,sep=' $ '))
-    return '( %s )' % ''.join(result)
-
-
-class NameForm(SchemaElement):
-  """
-  NameFormDescription = LPAREN WSP
-      numericoid                 ; object identifer
-      [ SP "NAME" SP qdescrs ]   ; short names
-      [ SP "DESC" SP qdstring ]  ; description
-      [ SP "OBSOLETE" ]          ; not active
-      SP "OC" SP oid             ; structural object class
-      SP "MUST" SP oids          ; attribute types
-      [ SP "MAY" SP oids ]       ; attribute types
-      extensions WSP RPAREN      ; extensions
-  """
-  schema_attribute = 'nameForms'
-  token_defaults = {
-    'NAME':(()),
-    'DESC':(None,),
-    'OBSOLETE':None,
-    'OC':(None,),
-    'MUST':(()),
-    'MAY':(()),
-  }
-
-  def _set_attrs(self,l,d):
-    self.names = d['NAME']
-    self.desc = d['DESC'][0]
-    self.obsolete = d['OBSOLETE']!=None
-    self.oc = d['OC'][0]
-    self.must = d['MUST']
-    self.may = d['MAY']
-    assert type(self.names)==TupleType
-    assert self.desc is None or type(self.desc)==StringType
-    assert type(self.obsolete)==BooleanType and (self.obsolete==0 or self.obsolete==1)
-    assert type(self.oc)==StringType
-    assert type(self.must)==TupleType
-    assert type(self.may)==TupleType
-    return
-
-  def __str__(self):
-    result = [str(self.oid)]
-    result.append(self.key_list('NAME',self.names,quoted=1))
-    result.append(self.key_attr('DESC',self.desc,quoted=1))
-    result.append({0:'',1:' OBSOLETE'}[self.obsolete])
-    result.append(self.key_attr('OC',self.oc))
-    result.append(self.key_list('MUST',self.must,sep=' $ '))
-    result.append(self.key_list('MAY',self.may,sep=' $ '))
-    return '( %s )' % ''.join(result)
-
-
-class Entry(UserDict.UserDict):
-  """
-  Schema-aware implementation of an LDAP entry class.
-  
-  Mainly it holds the attributes in a string-keyed dictionary with
-  the OID as key.
-  """
-
-  def __init__(self,schema,dn,entry):
-    self._keytuple2attrtype = {}
-    self._attrtype2keytuple = {}
-    self._s = schema
-    self.dn = dn
-    UserDict.UserDict.__init__(self,{})
-    self.update(entry)
-
-  def _at2key(self,nameoroid):
-    """
-    Return tuple of OID and all sub-types of attribute type specified
-    in nameoroid.
-    """
-    try:
-      # Mapping already in cache
-      return self._attrtype2keytuple[nameoroid]
-    except KeyError:
-      # Mapping has to be constructed
-      oid = self._s.getoid(ldap.schema.AttributeType,nameoroid)
-      l = nameoroid.lower().split(';')
-      l[0] = oid
-      t = tuple(l)
-      self._attrtype2keytuple[nameoroid] = t
-      return t
-
-  def update(self,dict):
-    for key in dict.keys():
-      self[key] = dict[key]
-
-  def __contains__(self,key):
-    return self.has_key(key)
-
-  def __getitem__(self,nameoroid):
-    return self.data[self._at2key(nameoroid)]
-
-  def __setitem__(self,nameoroid,attr_values):
-    k = self._at2key(nameoroid)
-    self._keytuple2attrtype[k] = nameoroid
-    self.data[k] = attr_values
-
-  def __delitem__(self,nameoroid):
-    k = self._at2key(nameoroid)
-    del self.data[k]
-    del self._attrtype2keytuple[nameoroid]
-    del self._keytuple2attrtype[k]
-
-  def has_key(self,nameoroid):
-    k = self._at2key(nameoroid)
-    return self.data.has_key(k)
-
-  def get(self,nameoroid,failobj):
-    try:
-      return self[nameoroid]
-    except KeyError:
-      return failobj
-
-  def keys(self):
-    return self._keytuple2attrtype.values()
-
-  def items(self):
-    return [
-      (k,self[k])
-      for k in self.keys()
-    ]
-
-  def attribute_types(
-    self,attr_type_filter=None,raise_keyerror=1
-  ):
-    """
-    Convenience wrapper around SubSchema.attribute_types() which
-    passes object classes of this particular entry as argument to
-    SubSchema.attribute_types()
-    """
-    return self._s.attribute_types(
-      self.get('objectClass',[]),attr_type_filter,raise_keyerror
-    )

+ 0 - 423
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/subentry.py

@@ -1,423 +0,0 @@
-"""
-ldap.schema.subentry -  subschema subentry handling
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: subentry.py,v 1.24 2009/04/17 14:36:16 stroeder Exp $
-"""
-
-import ldap.cidict,ldap.schema
-
-from ldap.schema.models import *
-
-from UserDict import UserDict
-
-SCHEMA_CLASS_MAPPING = ldap.cidict.cidict()
-SCHEMA_ATTR_MAPPING = {}
-
-for _name in dir():
-  o = eval(_name)
-  if hasattr(o,'schema_attribute'):
-    SCHEMA_CLASS_MAPPING[o.schema_attribute] = o
-    SCHEMA_ATTR_MAPPING[o] = o.schema_attribute
-
-SCHEMA_ATTRS = SCHEMA_CLASS_MAPPING.keys()
-
-
-class SubSchema:
-    
-  def __init__(self,sub_schema_sub_entry):
-      """
-      sub_schema_sub_entry
-          Dictionary containing the sub schema sub entry
-      """
-      # Initialize all dictionaries
-      self.name2oid = {}
-      self.sed = {}
-      for c in SCHEMA_CLASS_MAPPING.values():
-        self.name2oid[c] = ldap.cidict.cidict()
-        self.sed[c] = {}
-
-      e = ldap.cidict.cidict(sub_schema_sub_entry)
-
-      # Build the schema registry
-      for attr_type in SCHEMA_ATTRS:
-        if not e.has_key(attr_type) or \
-           not e[attr_type]:
-          continue
-        for attr_value in filter(None,e[attr_type]):
-          se_class = SCHEMA_CLASS_MAPPING[attr_type]
-          se_instance = se_class(attr_value)
-          self.sed[se_class][se_instance.get_id()] = se_instance
-          if hasattr(se_instance,'names'):
-            for name in se_instance.names:
-              self.name2oid[se_class][name] = se_instance.get_id()
-      return # subSchema.__init__()
-
-  def ldap_entry(self):
-    """
-    Returns a dictionary containing the sub schema sub entry
-    """
-    # Initialize the dictionary with empty lists
-    entry = {}
-    # Collect the schema elements and store them in
-    # entry's attributes
-    for se_class in self.sed.keys():
-      for se in self.sed[se_class].values():
-        se_str = str(se)
-        try:
-          entry[SCHEMA_ATTR_MAPPING[se_class]].append(se_str)
-        except KeyError:
-          entry[SCHEMA_ATTR_MAPPING[se_class]] = [ se_str ]
-    return entry
-
-  def listall(self,schema_element_class,schema_element_filters=None):
-    """
-    Returns a list of OIDs of all available schema
-    elements of a given schema element class.
-    """
-    avail_se = self.sed[schema_element_class]
-    if schema_element_filters:
-      result = []
-      for se_key in avail_se.keys():
-        se = avail_se[se_key]
-        for fk,fv in schema_element_filters:
-          try:
-            if getattr(se,fk) in fv:
-              result.append(se_key)
-          except AttributeError:
-            pass
-    else:
-      result = avail_se.keys()
-    return result
-    
-
-  def tree(self,schema_element_class,schema_element_filters=None):
-    """
-    Returns a ldap.cidict.cidict dictionary representing the
-    tree structure of the schema elements.
-    """
-    assert schema_element_class in [ObjectClass,AttributeType]
-    avail_se = self.listall(schema_element_class,schema_element_filters)
-    top_node = '_'
-    tree = ldap.cidict.cidict({top_node:[]})
-    # 1. Pass: Register all nodes
-    for se in avail_se:
-      tree[se] = []
-    # 2. Pass: Register all sup references
-    for se_oid in avail_se:
-      se_obj = self.get_obj(schema_element_class,se_oid,None)
-      if se_obj.__class__!=schema_element_class:
-        # Ignore schema elements not matching schema_element_class.
-        # This helps with falsely assigned OIDs.
-        continue
-      assert se_obj.__class__==schema_element_class, \
-        "Schema element referenced by %s must be of class %s but was %s" % (
-          se_oid,schema_element_class.__name__,se_obj.__class__
-        )
-      for s in se_obj.sup or ('_',):
-        sup_oid = self.name2oid[schema_element_class].get(s,s)
-        try:
-          tree[sup_oid].append(se_oid)
-        except:
-          pass
-    return tree
-
-
-  def getoid(self,se_class,nameoroid):
-    """
-    Get an OID by name or OID
-    """
-    se_oid = nameoroid.split(';')[0].strip()
-    return self.name2oid[se_class].get(se_oid,se_oid)
-
-
-  def get_inheritedattr(self,se_class,nameoroid,name):
-    """
-    Get a possibly inherited attribute specified by name
-    of a schema element specified by nameoroid.
-    Returns None if class attribute is not set at all.
-    
-    Raises KeyError if no schema element is found by nameoroid.
-    """
-    se = self.sed[se_class][self.getoid(se_class,nameoroid)]
-    try:
-      result = getattr(se,name)
-    except AttributeError:
-      result = None
-    if result is None and se.sup:
-      result = self.get_inheritedattr(se_class,se.sup[0],name)
-    return result
-
-
-  def get_obj(self,se_class,nameoroid,default=None):
-    """
-    Get a schema element by name or OID
-    """
-    return self.sed[se_class].get(self.getoid(se_class,nameoroid),default)
-
-
-  def get_inheritedobj(self,se_class,nameoroid,inherited=None):
-    """
-    Get a schema element by name or OID with all class attributes
-    set including inherited class attributes
-    """
-    import copy
-    inherited = inherited or []
-    se = copy.copy(self.sed[se_class].get(self.getoid(se_class,nameoroid)))
-    if se and hasattr(se,'sup'):
-      for class_attr_name in inherited:
-        setattr(se,class_attr_name,self.get_inheritedattr(se_class,nameoroid,class_attr_name))
-    return se
-
-
-  def get_syntax(self,nameoroid):
-    """
-    Get the syntax of an attribute type specified by name or OID
-    """
-    at_oid = self.getoid(AttributeType,nameoroid)
-    try:
-      at_obj = self.get_inheritedobj(AttributeType,at_oid)
-    except KeyError:
-      return None
-    else:
-      return at_obj.syntax
-
-
-  def get_structural_oc(self,oc_list):
-    """
-    Returns OID of structural object class in object_class_list
-    if any is present. Returns None else.
-    """
-    # Get tree of all STRUCTURAL object classes
-    oc_tree = self.tree(ObjectClass,[('kind',[0])])
-    # Filter all STRUCTURAL object classes
-    struct_ocs = {}
-    for oc_nameoroid in oc_list:
-      oc_se = self.get_obj(ObjectClass,oc_nameoroid,None)
-      if oc_se and oc_se.kind==0:
-        struct_ocs[oc_se.oid] = None
-    result = None
-    struct_oc_list = struct_ocs.keys()
-    while struct_oc_list:
-      oid = struct_oc_list.pop()
-      for child_oid in oc_tree[oid]:
-        if struct_ocs.has_key(self.getoid(ObjectClass,child_oid)):
-          break
-      else:
-        result = oid
-    return result
-
-
-  def get_applicable_aux_classes(self,nameoroid):
-    """
-    Return a list of the applicable AUXILIARY object classes
-    for a STRUCTURAL object class specified by 'nameoroid'
-    if the object class is governed by a DIT content rule.
-    If there's no DIT content rule all available AUXILIARY
-    object classes are returned.
-    """
-    content_rule = self.get_obj(DITContentRule,nameoroid)
-    if content_rule:
-      # Return AUXILIARY object classes from DITContentRule instance
-      return content_rule.aux
-    else:
-      # list all AUXILIARY object classes
-      return self.listall(ObjectClass,[('kind',[2])])
-
-  def attribute_types(
-    self,object_class_list,attr_type_filter=None,raise_keyerror=1,ignore_dit_content_rule=0
-  ):
-    """
-    Returns a 2-tuple of all must and may attributes including
-    all inherited attributes of superior object classes
-    by walking up classes along the SUP attribute.
-
-    The attributes are stored in a ldap.cidict.cidict dictionary.
-
-    object_class_list
-        list of strings specifying object class names or OIDs
-    attr_type_filter
-        list of 2-tuples containing lists of class attributes
-        which has to be matched
-    raise_keyerror
-        All KeyError exceptions for non-existent schema elements
-	are ignored
-    ignore_dit_content_rule
-	A DIT content rule governing the structural object class
-	is ignored
-    """
-    AttributeType = ldap.schema.AttributeType
-    ObjectClass = ldap.schema.ObjectClass
-
-    # Map object_class_list to object_class_oids (list of OIDs)
-    object_class_oids = [
-      self.name2oid[ObjectClass].get(o,o)
-      for o in object_class_list
-    ]
-    # Initialize
-    oid_cache = {}
-
-    r_must,r_may = ldap.cidict.cidict(),ldap.cidict.cidict()
-    if '1.3.6.1.4.1.1466.101.120.111' in object_class_oids:
-      # Object class 'extensibleObject' MAY carry every attribute type
-      for at_obj in self.sed[AttributeType].values():
-        r_may[at_obj.oid] = at_obj
-
-    # Loop over OIDs of all given object classes
-    while object_class_oids:
-      object_class_oid = object_class_oids.pop(0)
-      # Check whether the objectClass with this OID
-      # has already been processed
-      if oid_cache.has_key(object_class_oid):
-        continue
-      # Cache this OID as already being processed
-      oid_cache[object_class_oid] = None
-      try:
-        object_class = self.sed[ObjectClass][object_class_oid]
-      except KeyError:
-        if raise_keyerror:
-          raise
-        # Ignore this object class
-        continue
-      assert isinstance(object_class,ObjectClass)
-      assert hasattr(object_class,'must'),ValueError(object_class_oid)
-      assert hasattr(object_class,'may'),ValueError(object_class_oid)
-      for a in object_class.must:
-        try:
-          at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
-        except KeyError:
-          if raise_keyerror:
-            raise
-          else:
-            r_must[a] = None
-        else:
-          r_must[at_obj.oid] = at_obj
-      for a in object_class.may:
-        try:
-          at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
-        except KeyError:
-          if raise_keyerror:
-            raise
-          else:
-            r_may[a] = None
-        else:
-          r_may[at_obj.oid] = at_obj
-
-      object_class_oids.extend([
-        self.name2oid[ObjectClass].get(o,o)
-        for o in object_class.sup
-      ])
-
-    # Removed all mandantory attribute types from
-    # optional attribute type list
-    for a in r_may.keys():
-      if r_must.has_key(a):
-        del r_may[a]
-
-    # Process DIT content rules
-    if not ignore_dit_content_rule:
-      structural_oc = self.get_structural_oc(object_class_list)
-      if structural_oc:
-	# Process applicable DIT content rule
-	dit_content_rule = self.get_obj(DITContentRule,structural_oc)
-	if dit_content_rule:
-          for a in dit_content_rule.must:
-            try:
-              at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
-            except KeyError:
-              if raise_keyerror:
-        	raise
-              else:
-        	r_must[a] = None
-            else:
-              r_must[at_obj.oid] = at_obj
-          for a in dit_content_rule.may:
-            try:
-              at_obj = self.sed[AttributeType][self.name2oid[AttributeType].get(a,a)]
-            except KeyError:
-              if raise_keyerror:
-        	raise
-              else:
-        	r_may[a] = None
-            else:
-              r_may[at_obj.oid] = at_obj
-          for a in dit_content_rule.nots:
-            a_oid = self.name2oid[AttributeType].get(a,a)
-            if not r_must.has_key(a_oid):
-              try:
-        	at_obj = self.sed[AttributeType][a_oid]
-              except KeyError:
-        	if raise_keyerror:
-                  raise
-              else:
-        	try:
-                  del r_must[at_obj.oid]
-        	except KeyError:
-                  pass
-        	try:
-                  del r_may[at_obj.oid]
-        	except KeyError:
-                  pass
-
-    # Apply attr_type_filter to results
-    if attr_type_filter:
-      for l in [r_must,r_may]:
-        for a in l.keys():
-          for afk,afv in attr_type_filter:
-            try:
-              schema_attr_type = self.sed[AttributeType][a]
-            except KeyError:
-              if raise_keyerror:
-                raise KeyError,'No attribute type found in sub schema by name %s' % (a)
-              # If there's no schema element for this attribute type
-              # but still KeyError is to be ignored we filter it away
-              del l[a]
-              break
-            else:
-              if not getattr(schema_attr_type,afk) in afv:
-                del l[a]
-                break
-
-    return r_must,r_may # attribute_types()
-
-
-def urlfetch(uri,trace_level=0):
-  """
-  Fetches a parsed schema entry by uri.
-  
-  If uri is a LDAP URL the LDAP server is queried directly.
-  Otherwise uri is assumed to point to a LDIF file which
-  is loaded with urllib.
-  """
-  uri = uri.strip()
-  if uri.startswith('ldap:') or uri.startswith('ldaps:') or uri.startswith('ldapi:'):
-    import ldapurl
-    ldap_url = ldapurl.LDAPUrl(uri)
-    l=ldap.initialize(ldap_url.initializeUrl(),trace_level)
-    l.protocol_version = ldap.VERSION3
-    l.simple_bind_s(ldap_url.who or '', ldap_url.cred or '')
-    subschemasubentry_dn = l.search_subschemasubentry_s(ldap_url.dn)
-    if subschemasubentry_dn is None:
-      subschemasubentry_entry = None
-    else:
-      if ldap_url.attrs is None:
-        schema_attrs = SCHEMA_ATTRS
-      else:
-        schema_attrs = ldap_url.attrs
-      subschemasubentry_entry = l.read_subschemasubentry_s(
-        subschemasubentry_dn,attrs=schema_attrs
-      )
-    l.unbind_s()
-    del l
-  else:
-    import urllib,ldif
-    ldif_file = urllib.urlopen(uri)
-    ldif_parser = ldif.LDIFRecordList(ldif_file,max_entries=1)
-    ldif_parser.parse()
-    subschemasubentry_dn,subschemasubentry_entry = ldif_parser.all_records[0]
-  if subschemasubentry_dn!=None:
-    parsed_sub_schema = ldap.schema.SubSchema(subschemasubentry_entry)
-  else:
-    parsed_sub_schema = None
-  return subschemasubentry_dn, parsed_sub_schema

+ 0 - 85
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldap/schema/tokenizer.py

@@ -1,85 +0,0 @@
-"""
-ldap.schema.tokenizer - Low-level parsing functions for schema element strings
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: tokenizer.py,v 1.13 2009/04/29 18:13:55 stroeder Exp $
-"""
-
-
-def split_tokens(s,keywordDict):
-  """
-  Returns list of syntax elements with quotes and spaces
-  stripped.
-  """
-  result = []
-  result_append = result.append
-  s_len = len(s)
-  i = 0
-  while i<s_len:
-    start = i
-    while i<s_len and s[i]!="'":
-      if s[i]=="(" or s[i]==")":
-        if i>start:
-          result_append(s[start:i])
-        result_append(s[i])
-        i +=1 # Consume parentheses
-        start = i
-      elif s[i]==" " or s[i]=="$":
-        if i>start:
-          result_append(s[start:i])
-        i +=1
-        # Consume more space chars
-        while i<s_len and s[i]==" ":
-          i +=1
-        start = i
-      else:
-        i +=1
-    if i>start:
-      result_append(s[start:i])
-    i +=1
-    if i>=s_len:
-      break
-    start = i
-    while i<s_len and s[i]!="'":
-      i +=1
-    if i>=start:
-      result_append(s[start:i])
-    i +=1
-  return result # split_tokens()
-
-
-def extract_tokens(l,known_tokens):
-  """
-  Returns dictionary of known tokens with all values
-  """
-  assert l[0].strip()=="(" and l[-1].strip()==")",ValueError(l)
-  result = {}
-  result_has_key = result.has_key
-  result.update(known_tokens)
-  i = 0
-  l_len = len(l)
-  while i<l_len:
-    if result_has_key(l[i]):
-      token = l[i]
-      i += 1 # Consume token
-      if i<l_len:
-        if result_has_key(l[i]):
-          # non-valued
-          result[token] = (())
-        elif l[i]=="(":
-          # multi-valued
-          i += 1 # Consume left parentheses
-          start = i
-          while i<l_len and l[i]!=")":
-            i += 1
-          result[token] = tuple(filter(lambda v:v!='$',l[start:i]))
-          i += 1 # Consume right parentheses
-        else:
-          # single-valued
-          result[token] = l[i],
-          i += 1 # Consume single value
-    else:
-      i += 1 # Consume unrecognized item
-  return result
-

+ 0 - 424
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldapurl.py

@@ -1,424 +0,0 @@
-"""
-ldapurl - handling of LDAP URLs as described in RFC 4516
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: ldapurl.py,v 1.44 2009/12/03 22:08:58 stroeder Exp $
-
-Python compability note:
-This module only works with Python 2.0+ since
-1. string methods are used instead of module string and
-2. list comprehensions are used.
-"""
-
-__version__ = '2.3.11'
-
-__all__ = [
-  # constants
-  'SEARCH_SCOPE','SEARCH_SCOPE_STR',
-  'LDAP_SCOPE_BASE','LDAP_SCOPE_ONELEVEL','LDAP_SCOPE_SUBTREE',
-  # functions
-  'isLDAPUrl',
-  # classes
-  'LDAPUrlExtension','LDAPUrlExtensions','LDAPUrl'
-]
-
-import UserDict
-
-from urllib import quote,unquote
-
-LDAP_SCOPE_BASE = 0
-LDAP_SCOPE_ONELEVEL = 1
-LDAP_SCOPE_SUBTREE = 2
-
-SEARCH_SCOPE_STR = {None:'',0:'base',1:'one',2:'sub'}
-
-SEARCH_SCOPE = {
-  '':None,
-  # the search scope strings defined in RFC2255
-  'base':LDAP_SCOPE_BASE,
-  'one':LDAP_SCOPE_ONELEVEL,
-  'sub':LDAP_SCOPE_SUBTREE,
-}
-
-# Some widely used types
-StringType = type('')
-TupleType=type(())
-
-
-def isLDAPUrl(s):
-  """
-  Returns 1 if s is a LDAP URL, 0 else
-  """
-  s_lower = s.lower()
-  return \
-    s_lower.startswith('ldap://') or \
-    s_lower.startswith('ldaps://') or \
-    s_lower.startswith('ldapi://')
-
-
-def ldapUrlEscape(s):
-  """Returns URL encoding of string s"""
-  return quote(s).replace(',','%2C').replace('/','%2F')
-
-
-class LDAPUrlExtension:
-  """
-  Class for parsing and unparsing LDAP URL extensions
-  as described in RFC 4516.
-
-  Usable class attributes:
-    critical
-          Boolean integer marking the extension as critical
-    extype    
-          Type of extension
-    exvalue
-          Value of extension
-  """
-
-  def __init__(self,extensionStr=None,critical=0,extype=None,exvalue=None):
-    self.critical = critical
-    self.extype = extype
-    self.exvalue = exvalue
-    if extensionStr:
-      self._parse(extensionStr)
-
-  def _parse(self,extension):
-    extension = extension.strip()
-    if not extension:
-      # Don't parse empty strings
-      self.extype,self.exvalue = None,None
-      return
-    self.critical = extension[0]=='!'
-    if extension[0]=='!':
-      extension = extension[1:].strip()
-    try:
-      self.extype,self.exvalue = extension.split('=',1)
-    except ValueError:
-      # No value, just the extype
-      self.extype,self.exvalue = extension,None
-    else:
-      self.exvalue = unquote(self.exvalue.strip())
-    self.extype = self.extype.strip()
-
-  def unparse(self):
-    if self.exvalue is None:
-      return '%s%s' % ('!'*(self.critical>0),self.extype)
-    else:
-      return '%s%s=%s' % (
-        '!'*(self.critical>0),
-        self.extype,quote(self.exvalue or '')
-      )
-    
-  def __str__(self):
-    return self.unparse()
-
-  def __repr__(self):
-    return '<%s.%s instance at %s: %s>' % (
-      self.__class__.__module__,
-      self.__class__.__name__,
-      hex(id(self)),
-      self.__dict__
-    )
-
-  def __eq__(self,other):
-    return \
-      (self.critical==other.critical) and \
-      (self.extype==other.extype) and \
-      (self.exvalue==other.exvalue)
-
-  def __ne__(self,other):
-    return not self.__eq__(other)
-
-
-class LDAPUrlExtensions(UserDict.UserDict):
-  """
-  Models a collection of LDAP URL extensions as
-  dictionary type
-  """
-
-  def __init__(self,default=None):
-    UserDict.UserDict.__init__(self)
-    for k,v in (default or {}).items():
-      self[k]=v
-
-  def __setitem__(self,name,value):
-    """
-    value
-        Either LDAPUrlExtension instance, (critical,exvalue)
-        or string'ed exvalue
-    """
-    assert isinstance(value,LDAPUrlExtension)
-    assert name==value.extype
-    self.data[name] = value
-
-  def values(self):
-    return [
-      self[k]
-      for k in self.keys()
-    ]
-
-  def __str__(self):
-    return ','.join(map(str,self.values()))
-
-  def __repr__(self):
-    return '<%s.%s instance at %s: %s>' % (
-      self.__class__.__module__,
-      self.__class__.__name__,
-      hex(id(self)),
-      self.data
-    )
-
-  def __eq__(self,other):
-    assert isinstance(other,self.__class__),TypeError(
-      "other has to be instance of %s" % (self.__class__)
-    )
-    return self.data==other.data
-    
-  def parse(self,extListStr):
-    for extension_str in extListStr.strip().split(','):
-      if extension_str:
-        e = LDAPUrlExtension(extension_str)
-        self[e.extype] = e
-
-  def unparse(self):
-    return ','.join([ v.unparse() for v in self.values() ])
-
-
-class LDAPUrl:
-  """
-  Class for parsing and unparsing LDAP URLs
-  as described in RFC 4516.
-
-  Usable class attributes:
-    urlscheme
-        URL scheme (either ldap, ldaps or ldapi)
-    hostport
-        LDAP host (default '')
-    dn
-        String holding distinguished name (default '')
-    attrs
-        list of attribute types (default None)
-    scope
-        integer search scope for ldap-module
-    filterstr
-        String representation of LDAP Search Filters
-        (see RFC 2254)
-    extensions
-        Dictionary used as extensions store
-    who
-        Maps automagically to bindname LDAP URL extension
-    cred
-        Maps automagically to X-BINDPW LDAP URL extension
-  """
-
-  attr2extype = {'who':'bindname','cred':'X-BINDPW'}
-
-  def __init__(
-    self,
-    ldapUrl=None,
-    urlscheme='ldap',
-    hostport='',dn='',attrs=None,scope=None,filterstr=None,
-    extensions=None,
-    who=None,cred=None
-  ):
-    self.urlscheme=urlscheme
-    self.hostport=hostport
-    self.dn=dn
-    self.attrs=attrs
-    self.scope=scope
-    self.filterstr=filterstr
-    self.extensions=(extensions or LDAPUrlExtensions({}))
-    if ldapUrl!=None:
-      self._parse(ldapUrl)
-    if who!=None:
-      self.who = who
-    if cred!=None:
-      self.cred = cred
-
-  def __eq__(self,other):
-    return \
-      self.urlscheme==other.urlscheme and \
-      self.hostport==other.hostport and \
-      self.dn==other.dn and \
-      self.attrs==other.attrs and \
-      self.scope==other.scope and \
-      self.filterstr==other.filterstr and \
-      self.extensions==other.extensions
-
-  def __ne__(self,other):
-    return not self.__eq__(other)
-
-  def _parse(self,ldap_url):
-    """
-    parse a LDAP URL and set the class attributes
-    urlscheme,host,dn,attrs,scope,filterstr,extensions
-    """
-    if not isLDAPUrl(ldap_url):
-      raise ValueError,'Parameter ldap_url does not seem to be a LDAP URL.'
-    scheme,rest = ldap_url.split('://',1)
-    self.urlscheme = scheme.strip()
-    if not self.urlscheme in ['ldap','ldaps','ldapi']:
-      raise ValueError,'LDAP URL contains unsupported URL scheme %s.' % (self.urlscheme)
-    slash_pos = rest.find('/')
-    qemark_pos = rest.find('?')
-    if (slash_pos==-1) and (qemark_pos==-1):
-      # No / and ? found at all
-      self.hostport = unquote(rest)
-      self.dn = ''
-      return
-    else:
-      if slash_pos!=-1 and (qemark_pos==-1 or (slash_pos<qemark_pos)):
-        # Slash separates DN from hostport
-        self.hostport = unquote(rest[:slash_pos])
-        # Eat the slash from rest
-        rest = rest[slash_pos+1:]
-      elif qemark_pos!=1 and (slash_pos==-1 or (slash_pos>qemark_pos)):
-        # Question mark separates hostport from rest, DN is assumed to be empty
-        self.hostport = unquote(rest[:qemark_pos])
-        # Do not eat question mark
-        rest = rest[qemark_pos:]
-      else:
-        raise ValueError,'Something completely weird happened!'
-    paramlist=rest.split('?',4)
-    paramlist_len = len(paramlist)
-    if paramlist_len>=1:
-      self.dn = unquote(paramlist[0]).strip()
-    if (paramlist_len>=2) and (paramlist[1]):
-      self.attrs = unquote(paramlist[1].strip()).split(',')
-    if paramlist_len>=3:
-      scope = paramlist[2].strip()
-      try:
-        self.scope = SEARCH_SCOPE[scope]
-      except KeyError:
-        raise ValueError,"Search scope must be either one of base, one or sub. LDAP URL contained %s" % (repr(scope))
-    if paramlist_len>=4:
-      filterstr = paramlist[3].strip()
-      if not filterstr:
-        self.filterstr = None
-      else:
-        self.filterstr = unquote(filterstr)
-    if paramlist_len>=5:
-      if paramlist[4]:
-        self.extensions = LDAPUrlExtensions()
-        self.extensions.parse(paramlist[4])
-      else:
-        self.extensions = None
-    return
-
-  def applyDefaults(self,defaults):
-    """
-    Apply defaults to all class attributes which are None.
-
-    defaults
-        Dictionary containing a mapping from class attributes
-        to default values
-    """
-    for k in defaults.keys():
-      if getattr(self,k) is None:
-        setattr(self,k,defaults[k])
-
-  def initializeUrl(self):
-    """
-    Returns LDAP URL suitable to be passed to ldap.initialize()
-    """
-    if self.urlscheme=='ldapi':
-      # hostport part might contain slashes when ldapi:// is used
-      hostport = ldapUrlEscape(self.hostport)
-    else:
-      hostport = self.hostport
-    return '%s://%s' % (self.urlscheme,hostport)
-
-  def unparse(self):
-    """
-    Returns LDAP URL depending on class attributes set.
-    """
-    if self.attrs is None:
-      attrs_str = ''
-    else:
-      attrs_str = ','.join(self.attrs)
-    scope_str = SEARCH_SCOPE_STR[self.scope]
-    if self.filterstr is None:
-      filterstr = ''
-    else:
-      filterstr = ldapUrlEscape(self.filterstr)
-    dn = ldapUrlEscape(self.dn)
-    if self.urlscheme=='ldapi':
-      # hostport part might contain slashes when ldapi:// is used
-      hostport = ldapUrlEscape(self.hostport)
-    else:
-      hostport = self.hostport
-    ldap_url = '%s://%s/%s?%s?%s?%s' % (
-      self.urlscheme,
-      hostport,dn,attrs_str,scope_str,filterstr
-    )
-    if self.extensions:
-      ldap_url = ldap_url+'?'+self.extensions.unparse()
-    return ldap_url
-  
-  def htmlHREF(self,urlPrefix='',hrefText=None,hrefTarget=None):
-    """Complete """
-    assert type(urlPrefix)==StringType, "urlPrefix must be StringType"
-    if hrefText is None:
-      hrefText = self.unparse()
-    assert type(hrefText)==StringType, "hrefText must be StringType"
-    if hrefTarget is None:
-      target = ''
-    else:
-      assert type(hrefTarget)==StringType, "hrefTarget must be StringType"
-      target = ' target="%s"' % hrefTarget
-    return '<a%s href="%s%s">%s</a>' % (
-      target,urlPrefix,self.unparse(),hrefText
-    )
-
-  def __str__(self):
-    return self.unparse()
-
-  def __repr__(self):
-    return '<%s.%s instance at %s: %s>' % (
-      self.__class__.__module__,
-      self.__class__.__name__,
-      hex(id(self)),
-      self.__dict__
-    )
-
-  def __getattr__(self,name):
-    if self.attr2extype.has_key(name):
-      extype = self.attr2extype[name]
-      if self.extensions and \
-         self.extensions.has_key(extype) and \
-         not self.extensions[extype].exvalue is None:
-        result = unquote(self.extensions[extype].exvalue)
-      else:
-        return None
-    else:
-      raise AttributeError,"%s has no attribute %s" % (
-        self.__class__.__name__,name
-      )
-    return result # __getattr__()
-
-  def __setattr__(self,name,value):
-    if self.attr2extype.has_key(name):
-      extype = self.attr2extype[name]
-      if value is None:
-        # A value of None means that extension is deleted
-        delattr(self,name)
-      elif value!=None:
-        # Add appropriate extension
-        self.extensions[extype] = LDAPUrlExtension(
-          extype=extype,exvalue=unquote(value)
-        )
-    else:
-      self.__dict__[name] = value
-
-  def __delattr__(self,name):
-    if self.attr2extype.has_key(name):
-      extype = self.attr2extype[name]
-      if self.extensions:
-        try:
-          del self.extensions[extype]
-        except KeyError:
-          pass
-    else:
-      del self.__dict__[name]
-

+ 0 - 454
desktop/core/ext-py/python-ldap-2.3.11/Build/lib.macosx-10.6-i386-2.5/ldif.py

@@ -1,454 +0,0 @@
-"""
-ldif - generate and parse LDIF data (see RFC 2849)
-
-See http://www.python-ldap.org/ for details.
-
-$Id: ldif.py,v 1.52 2009/12/03 22:11:26 stroeder Exp $
-
-Python compability note:
-Tested with Python 2.0+, but should work with Python 1.5.2+.
-"""
-
-__version__ = '2.3.11'
-
-__all__ = [
-  # constants
-  'ldif_pattern',
-  # functions
-  'AttrTypeandValueLDIF','CreateLDIF','ParseLDIF',
-  # classes
-  'LDIFWriter',
-  'LDIFParser',
-  'LDIFRecordList',
-  'LDIFCopy',
-]
-
-import urlparse,urllib,base64,re,types
-
-try:
-  from cStringIO import StringIO
-except ImportError:
-  from StringIO import StringIO
-
-attrtype_pattern = r'[\w;.]+(;[\w_-]+)*'
-attrvalue_pattern = r'(([^,]|\\,)+|".*?")'
-rdn_pattern = attrtype_pattern + r'[ ]*=[ ]*' + attrvalue_pattern
-dn_pattern   = rdn_pattern + r'([ ]*,[ ]*' + rdn_pattern + r')*[ ]*'
-dn_regex   = re.compile('^%s$' % dn_pattern)
-
-ldif_pattern = '^((dn(:|::) %(dn_pattern)s)|(%(attrtype_pattern)s(:|::) .*)$)+' % vars()
-
-MOD_OP_INTEGER = {
-  'add':0,'delete':1,'replace':2
-}
-
-MOD_OP_STR = {
-  0:'add',1:'delete',2:'replace'
-}
-
-CHANGE_TYPES = ['add','delete','modify','modrdn']
-valid_changetype_dict = {}
-for c in CHANGE_TYPES:
-  valid_changetype_dict[c]=None
-
-
-def is_dn(s):
-  """
-  returns 1 if s is a LDAP DN
-  """
-  if s=='':
-    return 1
-  rm = dn_regex.match(s)
-  return rm!=None and rm.group(0)==s
-
-
-SAFE_STRING_PATTERN = '(^(\000|\n|\r| |:|<)|[\000\n\r\200-\377]+|[ ]+$)'
-safe_string_re = re.compile(SAFE_STRING_PATTERN)
-
-def list_dict(l):
-  """
-  return a dictionary with all items of l being the keys of the dictionary
-  """
-  return dict([(i,None) for i in l])
-
-
-class LDIFWriter:
-  """
-  Write LDIF entry or change records to file object
-  Copy LDIF input to a file output object containing all data retrieved
-  via URLs
-  """
-
-  def __init__(self,output_file,base64_attrs=None,cols=76,line_sep='\n'):
-    """
-    output_file
-        file object for output
-    base64_attrs
-        list of attribute types to be base64-encoded in any case
-    cols
-        Specifies how many columns a line may have before it's
-        folded into many lines.
-    line_sep
-        String used as line separator
-    """
-    self._output_file = output_file
-    self._base64_attrs = list_dict([a.lower() for a in (base64_attrs or [])])
-    self._cols = cols
-    self._line_sep = line_sep
-    self.records_written = 0
-
-  def _unfoldLDIFLine(self,line):
-    """
-    Write string line as one or more folded lines
-    """
-    # Check maximum line length
-    line_len = len(line)
-    if line_len<=self._cols:
-      self._output_file.write(line)
-      self._output_file.write(self._line_sep)
-    else:
-      # Fold line
-      pos = self._cols
-      self._output_file.write(line[0:min(line_len,self._cols)])
-      self._output_file.write(self._line_sep)
-      while pos<line_len:
-        self._output_file.write(' ')
-        self._output_file.write(line[pos:min(line_len,pos+self._cols-1)])
-        self._output_file.write(self._line_sep)
-        pos = pos+self._cols-1
-    return # _unfoldLDIFLine()
-
-  def _needs_base64_encoding(self,attr_type,attr_value):
-    """
-    returns 1 if attr_value has to be base-64 encoded because
-    of special chars or because attr_type is in self._base64_attrs
-    """
-    return self._base64_attrs.has_key(attr_type.lower()) or \
-           not safe_string_re.search(attr_value) is None
-
-  def _unparseAttrTypeandValue(self,attr_type,attr_value):
-    """
-    Write a single attribute type/value pair
-
-    attr_type
-          attribute type
-    attr_value
-          attribute value
-    """
-    if self._needs_base64_encoding(attr_type,attr_value):
-      # Encode with base64
-      self._unfoldLDIFLine(':: '.join([attr_type,base64.encodestring(attr_value).replace('\n','')]))
-    else:
-      self._unfoldLDIFLine(': '.join([attr_type,attr_value]))
-    return # _unparseAttrTypeandValue()
-
-  def _unparseEntryRecord(self,entry):
-    """
-    entry
-        dictionary holding an entry
-    """
-    attr_types = entry.keys()[:]
-    attr_types.sort()
-    for attr_type in attr_types:
-      for attr_value in entry[attr_type]:
-        self._unparseAttrTypeandValue(attr_type,attr_value)
-
-  def _unparseChangeRecord(self,modlist):
-    """
-    modlist
-        list of additions (2-tuple) or modifications (3-tuple)
-    """
-    mod_len = len(modlist[0])
-    if mod_len==2:
-      changetype = 'add'
-    elif mod_len==3:
-      changetype = 'modify'
-    else:
-      raise ValueError,"modlist item of wrong length"
-    self._unparseAttrTypeandValue('changetype',changetype)
-    for mod in modlist:
-      if mod_len==2:
-        mod_type,mod_vals = mod
-      elif mod_len==3:
-        mod_op,mod_type,mod_vals = mod
-        self._unparseAttrTypeandValue(MOD_OP_STR[mod_op],mod_type)
-      else:
-        raise ValueError,"Subsequent modlist item of wrong length"
-      if mod_vals:
-        for mod_val in mod_vals:
-          self._unparseAttrTypeandValue(mod_type,mod_val)
-      if mod_len==3:
-        self._output_file.write('-'+self._line_sep)
-
-  def unparse(self,dn,record):
-    """
-    dn
-          string-representation of distinguished name
-    record
-          Either a dictionary holding the LDAP entry {attrtype:record}
-          or a list with a modify list like for LDAPObject.modify().
-    """
-    if not record:
-      # Simply ignore empty records
-      return
-    # Start with line containing the distinguished name
-    self._unparseAttrTypeandValue('dn',dn)
-    # Dispatch to record type specific writers
-    if isinstance(record,types.DictType):
-      self._unparseEntryRecord(record)
-    elif isinstance(record,types.ListType):
-      self._unparseChangeRecord(record)
-    else:
-      raise ValueError, "Argument record must be dictionary or list"
-    # Write empty line separating the records
-    self._output_file.write(self._line_sep)
-    # Count records written
-    self.records_written = self.records_written+1
-    return # unparse()
-
-
-def CreateLDIF(dn,record,base64_attrs=None,cols=76):
-  """
-  Create LDIF single formatted record including trailing empty line.
-  This is a compability function. Use is deprecated!
-
-  dn
-        string-representation of distinguished name
-  record
-        Either a dictionary holding the LDAP entry {attrtype:record}
-        or a list with a modify list like for LDAPObject.modify().
-  base64_attrs
-        list of attribute types to be base64-encoded in any case
-  cols
-        Specifies how many columns a line may have before it's
-        folded into many lines.
-  """
-  f = StringIO()
-  ldif_writer = LDIFWriter(f,base64_attrs,cols,'\n')
-  ldif_writer.unparse(dn,record)
-  s = f.getvalue()
-  f.close()
-  return s
-
-
-class LDIFParser:
-  """
-  Base class for a LDIF parser. Applications should sub-class this
-  class and override method handle() to implement something meaningful.
-
-  Public class attributes:
-  records_read
-        Counter for records processed so far
-  """
-
-  def _stripLineSep(self,s):
-    """
-    Strip trailing line separators from s, but no other whitespaces
-    """
-    if s[-2:]=='\r\n':
-      return s[:-2]
-    elif s[-1:]=='\n':
-      return s[:-1]
-    else:
-      return s
-
-  def __init__(
-    self,
-    input_file,
-    ignored_attr_types=None,
-    max_entries=0,
-    process_url_schemes=None,
-    line_sep='\n'
-  ):
-    """
-    Parameters:
-    input_file
-        File-object to read the LDIF input from
-    ignored_attr_types
-        Attributes with these attribute type names will be ignored.
-    max_entries
-        If non-zero specifies the maximum number of entries to be
-        read from f.
-    process_url_schemes
-        List containing strings with URLs schemes to process with urllib.
-        An empty list turns off all URL processing and the attribute
-        is ignored completely.
-    line_sep
-        String used as line separator
-    """
-    self._input_file = input_file
-    self._max_entries = max_entries
-    self._process_url_schemes = list_dict([s.lower() for s in (process_url_schemes or [])])
-    self._ignored_attr_types = list_dict([a.lower() for a in (ignored_attr_types or [])])
-    self._line_sep = line_sep
-    self.records_read = 0
-
-  def handle(self,dn,entry):
-    """
-    Process a single content LDIF record. This method should be
-    implemented by applications using LDIFParser.
-    """
-
-  def _unfoldLDIFLine(self):
-    """
-    Unfold several folded lines with trailing space into one line
-    """
-    unfolded_lines = [ self._stripLineSep(self._line) ]
-    self._line = self._input_file.readline()
-    while self._line and self._line[0]==' ':
-      unfolded_lines.append(self._stripLineSep(self._line[1:]))
-      self._line = self._input_file.readline()
-    return ''.join(unfolded_lines)
-
-  def _parseAttrTypeandValue(self):
-    """
-    Parse a single attribute type and value pair from one or
-    more lines of LDIF data
-    """
-    # Reading new attribute line
-    unfolded_line = self._unfoldLDIFLine()
-    # Ignore comments which can also be folded
-    while unfolded_line and unfolded_line[0]=='#':
-      unfolded_line = self._unfoldLDIFLine()
-    if not unfolded_line or unfolded_line=='\n' or unfolded_line=='\r\n':
-      return None,None
-    try:
-      colon_pos = unfolded_line.index(':')
-    except ValueError:
-      # Treat malformed lines without colon as non-existent
-      return None,None
-    attr_type = unfolded_line[0:colon_pos]
-    # if needed attribute value is BASE64 decoded
-    value_spec = unfolded_line[colon_pos:colon_pos+2]
-    if value_spec=='::':
-      # attribute value needs base64-decoding
-      attr_value = base64.decodestring(unfolded_line[colon_pos+2:])
-    elif value_spec==':<':
-      # fetch attribute value from URL
-      url = unfolded_line[colon_pos+2:].strip()
-      attr_value = None
-      if self._process_url_schemes:
-        u = urlparse.urlparse(url)
-        if self._process_url_schemes.has_key(u[0]):
-          attr_value = urllib.urlopen(url).read()
-    elif value_spec==':\r\n' or value_spec=='\n':
-      attr_value = ''
-    else:
-      attr_value = unfolded_line[colon_pos+2:].lstrip()
-    return attr_type,attr_value
-
-  def parse(self):
-    """
-    Continously read and parse LDIF records
-    """
-    self._line = self._input_file.readline()
-
-    while self._line and \
-          (not self._max_entries or self.records_read<self._max_entries):
-
-      # Reset record
-      version = None; dn = None; changetype = None; modop = None; entry = {}
-
-      attr_type,attr_value = self._parseAttrTypeandValue()
-
-      while attr_type!=None and attr_value!=None:
-        if attr_type=='dn':
-          # attr type and value pair was DN of LDIF record
-          if dn!=None:
-	    raise ValueError, 'Two lines starting with dn: in one record.'
-          if not is_dn(attr_value):
-	    raise ValueError, 'No valid string-representation of distinguished name %s.' % (repr(attr_value))
-          dn = attr_value
-        elif attr_type=='version' and dn is None:
-          version = 1
-        elif attr_type=='changetype':
-          # attr type and value pair was DN of LDIF record
-          if dn is None:
-	    raise ValueError, 'Read changetype: before getting valid dn: line.'
-          if changetype!=None:
-	    raise ValueError, 'Two lines starting with changetype: in one record.'
-          if not valid_changetype_dict.has_key(attr_value):
-	    raise ValueError, 'changetype value %s is invalid.' % (repr(attr_value))
-          changetype = attr_value
-        elif attr_value!=None and \
-             not self._ignored_attr_types.has_key(attr_type.lower()):
-          # Add the attribute to the entry if not ignored attribute
-          if entry.has_key(attr_type):
-            entry[attr_type].append(attr_value)
-          else:
-            entry[attr_type]=[attr_value]
-
-        # Read the next line within an entry
-        attr_type,attr_value = self._parseAttrTypeandValue()
-
-      if entry:
-        # append entry to result list
-        self.handle(dn,entry)
-        self.records_read = self.records_read+1
-
-    return # parse()
-
-
-class LDIFRecordList(LDIFParser):
-  """
-  Collect all records of LDIF input into a single list.
-  of 2-tuples (dn,entry). It can be a memory hog!
-  """
-
-  def __init__(
-    self,
-    input_file,
-    ignored_attr_types=None,max_entries=0,process_url_schemes=None
-  ):
-    """
-    See LDIFParser.__init__()
-
-    Additional Parameters:
-    all_records
-        List instance for storing parsed records
-    """
-    LDIFParser.__init__(self,input_file,ignored_attr_types,max_entries,process_url_schemes)
-    self.all_records = []
-
-  def handle(self,dn,entry):
-    """
-    Append single record to dictionary of all records.
-    """
-    self.all_records.append((dn,entry))
-
-
-class LDIFCopy(LDIFParser):
-  """
-  Copy LDIF input to LDIF output containing all data retrieved
-  via URLs
-  """
-
-  def __init__(
-    self,
-    input_file,output_file,
-    ignored_attr_types=None,max_entries=0,process_url_schemes=None,
-    base64_attrs=None,cols=76,line_sep='\n'
-  ):
-    """
-    See LDIFParser.__init__() and LDIFWriter.__init__()
-    """
-    LDIFParser.__init__(self,input_file,ignored_attr_types,max_entries,process_url_schemes)
-    self._output_ldif = LDIFWriter(output_file,base64_attrs,cols,line_sep)
-
-  def handle(self,dn,entry):
-    """
-    Write single LDIF record to output file.
-    """
-    self._output_ldif.unparse(dn,entry)
-
-
-def ParseLDIF(f,ignore_attrs=None,maxentries=0):
-  """
-  Parse LDIF records read from file.
-  This is a compability function. Use is deprecated!
-  """
-  ldif_parser = LDIFRecordList(
-    f,ignored_attr_types=ignore_attrs,max_entries=maxentries,process_url_schemes=0
-  )
-  ldif_parser.parse()
-  return ldif_parser.all_records

+ 0 - 35
desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.mingw

@@ -1,35 +0,0 @@
-# Win32 setup.cfg
-# You have to edit this file to reflect your system configuration
-#
-# $Id: setup.cfg.mingw,v 1.1 2005/01/25 18:54:46 stroeder Exp $
-
-# Section for compiling the C extension module
-# for wrapping OpenLDAP 2 libs
-
-# Platform: Win32
-# Compile environment: MinGW
-[_ldap]
-class = OpenLDAP2
-maintainer = Mauro Cicognini
-defines = WIN32
-
-# modify these to fit your local configuration
-library_dirs = C:/msys/1.0/home/mcicogni/openldap-mingw-build-4/openldap-2.2.18/libraries/libldap_r/.libs C:/msys/1.0/home/mcicogni/openldap-mingw-build-4/openldap-2.2.18/libraries/liblber/.libs C:\msys\1.0\home\mcicogni\openldap-mingw-build-4\openssl-0.9.7e
-include_dirs = C:/msys/1.0/home/mcicogni/openldap-mingw-build-4/openldap-2.2.18/include
-
-extra_compile_args = 
-extra_objects = 
-
-libs = ldap_r lber ssl crypto ws2_32 gdi32
-
-[build]
-compiler = mingw32
-
-# Installation options
-[install]
-compile = 1
-optimize = 1
-record = python-ldap_install.log
-
-[bdist_wininst]
-target_version = 2.4

+ 0 - 33
desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.suse-linux

@@ -1,33 +0,0 @@
-# Example for setup.cfg
-# You have to edit this file to reflect your system configuation
-# $Id: setup.cfg.suse-linux,v 1.1 2003/08/20 10:04:34 stroeder Exp $
-
-[_ldap]
-# Section for compiling the C extension module
-# for wrapping OpenLDAP 2 libs
-
-library_dirs = /usr/lib/sasl2
-include_dirs = /usr/include/sasl
-
-extra_compile_args = 
-extra_objects =
-
-# Example for full-featured SuSE build:
-# Support for StartTLS/LDAPS, SASL bind and reentrant libldap_r.
-# This needs recent OpenLDAP 2.0.26+ or 2.1.3+ built with
-# ./configure --with-cyrus-sasl --with-tls
-libs = ldap_r lber sasl2 ssl crypto
-
-[install]
-# Installation options
-compile = 1
-optimize = 1
-
-# For SuSE Linux 8.2
-[bdist_rpm]
-provides = python-ldap
-requires = python openldap2-client openssl cyrus-sasl2
-distribution_name = SuSE Linux 8.2
-release = 1
-packager = Michael Stroeder <michael@stroeder.com>
-doc_files = CHANGES README INSTALL TODO Demo/

+ 0 - 33
desktop/core/ext-py/python-ldap-2.3.11/Build/setup.cfg.win32

@@ -1,33 +0,0 @@
-# Section for compiling the C extension module
-# for wrapping OpenLDAP 2 libs
-
-# Platform: Win32
-# Compile environment: Microsoft Visual Studio .NET 2003
-[_ldap]
-class = OpenLDAP2
-defines = WIN32
-
-# Cannot have SSL/TLS support under Win32 for the moment
-# (OpenLDAP 2.x port is incomplete)
-libs = olber32 oldap_r ws2_32 libsasl
-
-# Set these to your correct Openldap and Cyrus-sasl paths
-library_dirs = ../openldap/openldap-2.1.22/Release ../openldap/cyrus-sasl/lib
-include_dirs = ../openldap/openldap-2.1.22/include ../openldap/cyrus-sasl/include
-
-# Needs to compile as /MT ("MS libs to use: multithreaded statically-linked")
-# instead of /MD ("MS libs to use: multithreaded DLL") which is distutils' default
-# because OpenLDAP libs compile that way, too
-# This may change, however
-extra_compile_args = /MT
-extra_link_args = /NODEFAULTLIB:msvcrt.lib
-
-# Pull in SASL DLL as a convenience to end-user (which almost never will have it)
-# Destination path is a rather crude hack, but site-packages would be created anyway
-# Set source path to your Cyrus-sasl lib path
-extra_files = Lib/site-packages:../openldap/cyrus-sasl/lib/libsasl.dll
-
-# Installation options
-[install]
-compile = 1
-record = python-ldap_install.log

BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/LDAPObject.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/berval.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/common.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/constants.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/errors.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/functions.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/ldapcontrol.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/ldapmodule.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/message.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/options.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/schema.o


BIN
desktop/core/ext-py/python-ldap-2.3.11/Build/temp.macosx-10.6-i386-2.5/Modules/version.o


+ 0 - 808
desktop/core/ext-py/python-ldap-2.3.11/CHANGES

@@ -1,808 +0,0 @@
-----------------------------------------------------------------
-Released 2.3.11 2010-02-26
-
-Changes since 2.3.10:
-
-Lib/
-* Fixed LDAP URL parsing with four ? but no real extensions
-* ldap.ldapobject.LDAPObject.rename_s() now also accepts arguments
-  serverctrls and clientctrls
-* Removed untested and undocumented class ldap.ldapobject.SmartLDAPObject
-* Removed broken method ldap.ldapobject.LDAPObject.manage_dsa_it()
-
-Modules/
-* Make use of LDAP_OPT_X_TLS_NEWCTX only if available in
-  OpenLDAP libs used for the build
-* Fixed #ifdef-statements for OPT_X_TLS_PROTOCOL_MIN
-
-Doc/
-* Some updates and corrections regarding description of use of
-  LDAPv3 controls
-* Some more descriptions for constants
-* Removed comments related to old LaTeX-based documentation system
-
-----------------------------------------------------------------
-Released 2.3.10 2009-10-30
-
-Changes since 2.3.9:
-
-Lib/
-* The diagnosticMessage returned by a server is written to the trace
-  output also for successful operations.
-* Fixed handling of LDAP URL extensions with implicit value None which are
-  mapped to class attributes of LDAPUrl.
-* Fixed handling of LDAP URLs with ? being part of extensions.
-* Fixed exceptions raised by get_option/set_option (SF#1964993)
-* ldap.functions: Fixed import trace-related variables from base-module ldap
-* Fixed ldap.resiter missing in RPMs built with python setup.py bdist_rpm
-* Fix in class ldap.schema.models.SchemaElement:
-  repr() was liberally used in methods key_attr() and key_list() to enclose
-  values in quotes.
-
-Modules/
-* Changed internal API List_to_LDAPControls() to LDAPControls_from_object()
-* Supported was added for retrieving the SASL username during SASL bind with
-  ldap_get_option(LDAP_OPT_X_SASL_USERNAME) if available in libldap.
-* New LDAP option constant ldap.OPT_X_TLS_NEWCTX supported
-  in LDAPObject.set_option()
-* New LDAP option constants supported in LDAPObject.get/set_option():
-  ldap.OPT_X_TLS_PROTOCOL_MIN, ldap.OPT_CONNECT_ASYNC, ldap.OPT_X_TLS_DHFILE
-* Fixed setting _ldap.OPT_ON and _ldap.OPT_OFF
-* l_ldap_result3(): controls are now parsed for all response types (SF#2829057)
-
-Doc/
-* Added example for ldap.resiter
-
-----------------------------------------------------------------
-Released 2.3.9 2009-07-26
-
-Changes since 2.3.8:
-
-Lib/
-* All modules (ldap, ldif, dsml and ldapurl) have common version number now
-* Non-exported function ldif.needs_base64() was abandoned and is now
-  implemented as method LDIFWriter._needs_base64_encoding().
-  This allows sub-classes of LDIFWriter to implement determining whether
-  attribute values have to be base64-encoded in a different manner and is
-  the same approach like in class dsml.DSMLWriter.
-* LDAPUrlExtension._parse() now gracefully handles LDAP URL extensions
-  without explicit exvalue as being set with implicit value None.
-
-Modules/
-* New LDAP option constant ldap.OPT_X_SASL_NOCANON supported
-  in LDAPObject.get/set_option()
-
-----------------------------------------------------------------
-Released 2.3.8 2009-04-30
-
-Changes since 2.3.7:
-
-Lib/
-* ldap.schema.models: More fault-tolerant parsing of SYNTAX in
-  AttributeTypeDescription
-* ldap.schema.tokenizer.split_tokens():
-  More tolerant parsing of items separated only with a DOLLAR without
-  surrounding white-spaces (because WSP is declared as zero or more spaces
-  in RFC 4512)
-
-----------------------------------------------------------------
-Released 2.3.7 2009-04-09
-
-Changes since 2.3.6:
-
-Lib/
-* urllib.quote() is now used in LDAPUrlExtension.unparse() to quote
-  all special URL characters in extension values
-
-Modules/
-* Fixed ldapcontrol.c not to raise ldap.ENCODING_ERROR in
-  function encode_rfc2696() on 64-bit systems
-* Fixed seg fault if error code in a LDAP response was outside
-  the known error codes and could not be mapped to a specific
-  exception class (thanks to Sean)
-* errors.c: LDAP_ERROR_MAX set to LDAP_PROXIED_AUTHORIZATION_DENIED
-  if available in OpenLDAP header
-* new exception class ldap.PROXIED_AUTHORIZATION_DENIED
-  if available in OpenLDAP header
-* Fixed functions.c not to raise ldap.ENCODING_ERROR in
-  function l_ldap_str2dn() on 64-bit systems (see SF#2725356)
-
-----------------------------------------------------------------
-Released 2.3.6 2009-02-22
-
-Changes since 2.3.5:
-
-Lib/
-* Importing ldap.str2dn() which directly imported _ldap.str2dn()
-  is prohibited now (see SF#2181141)
-
-Modules/
-* get_option(): Added support for reading more SASL options.
-  (OPT_X_SASL_MECH, OPT_X_SASL_REALM, OPT_X_SASL_AUTHCID and
-  OPT_X_SASL_AUTHZID)
-* Added some explicit type casts to fix issues while building
-  with SunStudio
-* Fixed compiling issue with GCC 4.4
-  (see SF#2555793, thanks to Matej and Martin)
-
-Doc/
-* Clarified not to use ldap_get_dn() directly
-* Fixed description of ldap.SASL_AVAIL and ldap.TLS_AVAIL
-  (see SF#2555804, thanks to Matej and Martin)
-
-----------------------------------------------------------------
-Released 2.3.5 2008-07-06
-
-Changes since 2.3.4:
-
-Lib/
-* Fixed methods ldap.cidict.__contains__() and
-  ldap.schema.models.Entry.__contains__()
-* FWIW method LDAPObject.cancel_s() returns a result now
-* Fixed ldap.schema.models.NameForm: Class attribute oc is now
-  of type string, not tuple to be compliant with RFC 4512
-----------------------------------------------------------------
-Released 2.3.4 2008-03-29
-
-Changes since 2.3.3:
-
-Modules/
-* Fixed seg fault when calling LDAPObject.get_option()
-  (see SF#1926507, thanks to Matej)
-
-----------------------------------------------------------------
-Released 2.3.3 2008-03-26
-
-Changes since 2.3.2:
-
-Fixed backward-compability when building with OpenLDAP 2.3.x libs.
-
-----------------------------------------------------------------
-Released 2.3.2 2008-03-26
-
-Changes since 2.3.1:
-
-Lib/
-* ldap.dn.escape_dn_chars() now really adheres to
-  RFC 4514 section 2.4 by escaping null characters and a
-  space occurring at the beginning of the string
-* New method ldap.cidict.cidict.__contains__()
-* ldap.dn.explode_dn() and ldap.dn.explode_rdn()
-  have a new optional key-word argument flags which is
-  passed to ldap.dn.str2dn().
-
-Modules/
-* Removed unused OPT_PRIVATE_EXTENSION_BASE from constants.c
-
-Doc/
-* Various additions, updates, polishing (thanks to James).
-
-----------------------------------------------------------------
-Released 2.3.1 2007-07-25
-
-Changes since 2.3.0:
-
-* Support for setuptools (building .egg, thanks to Torsten)
-* Support for matched values control (RFC 3876, thanks to Andreas)
-
-Lib/
-* Fixed ldif (see SF#1709111, thanks to Dmitry)
-* ldap.schema.models:
-  SUP now separated by $ (method __str__() of classes
-  AttributeType, ObjectClass and DITStructureRule, thanks to Stefan)
-
-Modules/
-* Added constant MOD_INCREMENT to support
-  modify+increment extension (see RFC 4525, thanks to Andreas)
-----------------------------------------------------------------
-Released 2.3.0 2007-03-27
-
-Changes since 2.2.1:
-
-* OpenLDAP 2.3+ required now to build.
-* Added support for Cancel operation ext. op. if supported
-in OpenLDAP API of the libs used for the build.
-
-Modules/
-* Removed deprecated code for setting options by name
-* Added l_ldap_cancel()
-* Some modifications related to PEP 353 for
-  Python 2.5 on 64-bit platforms (see SF#1467529, thanks to Matej)
-* Added new function l_ldap_str2dn(), removed functions
-  l_ldap_explode_dn() and l_ldap_explode_rdn()
-  (see SF#1657848, thanks to David)
-
-Lib/
-* Added method ldapobject.LDAPObject.cancel()
-* ldap.schema.subentry.urlfetch() now can do non-anonymous
-  simple bind if the LDAP URL provided contains extensions
-  'bindname' and 'X-BINDPW'. (see SF#1589206)
-* ldap.filter.escape_filter_chars() has new a key-word argument
-  escape_mode now which defines which chars to be escaped
-  (see SF#1193271).
-* Various important fixes to ldapobject.ReconnectLDAPObject
-* Moved all DN-related functions to sub-module ldap.dn,
-  import them in ldap.functions for backward compability
-* ldap.dn.explode_dn() and ldap.dn.explode_rdn() use the new
-  wrapper function ldap.dn.str2dn() (related to SF#1657848)
-* changetype issue partially fixed (see SF#1683746)
-
-----------------------------------------------------------------
-Released 2.2.1 2006-11-15
-
-Changes since 2.2.0:
-
-Modules/
-* Fix for Python 2.5 free(): invalid pointer (see SF#1575329)
-* passwd() accepts None for arguments user, oldpw, newpw
-  (see SF#1440151)
-
-Lib/
-* ldif.LDIFWriter.unparse() now accepts instances of
-  derived dict and list classes (see SF#1489898)
-
-----------------------------------------------------------------
-Released 2.2.0 2006-04-10
-
-Changes since 2.0.11:
-
-* OpenLDAP 2.2+ required now to build.
-
-Modules/
-* Dropped all occurences of '#ifdef #LDAP_VENDOR_VERSION'.
-* Fixed wrong tuple size in l_ldap_result3() (see SF#1368108)
-* Fixed get_option(ldap.OPT_API_INFO) (see SF#1440165)
-* Fixed memory leak in l_ldap_result3() when all=0
-  (see SF#1457325)
-* Fixed memory leak in l_ldap_result3() in error cases
-  (see SF#1464085)
-
-Lib/
-* Fixed ldap.schema.models.DITStructureRule.__str__() to
-  separate SUP rule-ids with a single space instead of ' $ '
-* Fixed ldap.async.Dict
-* Added ldap.async.IndexedDict
-* ldap.schema.subentry.SubSchema.attribute_types() has new
-  key-word argument ignore_dit_content_rule
-----------------------------------------------------------------
-Released 2.0.11 2005-11-07
-
-Changes since 2.0.10:
-
-Lib/
-* Class ldap.ldapobject.LDAPObject:
-  Each method returns a result now
-* Class ldap.ldapobject.ReconnectLDAPObject:
-  Some methods called the wrong methods of LDAPObject. Fixed.
-* Added new class ldap.async.Dict
-* Slightly cleaned up ldap.schema.subentry.attribute_types()
-* New sub-module ldap.resiter which simply provides a mix-in
-  class for ldap.ldapobject.LDAPObject with a generator method
-  allresults().
-  Obviously this only works with Python 2.3+. And
-  it's still experimental.
-
-----------------------------------------------------------------
-Released 2.0.10 2005-09-23
-
-Changes since 2.0.9:
-
-Lib/
-* Switched back to old implementation of
-  ldap.schema.tokenizer.split_tokens() since the new one
-  had a bug which deletes the spaces from DESC
-* ldap.INSUFFICIENT_ACCESS is now ignored in 
-  ldap.ldapobject.LDAPObject.search_subschemasubentry_s()
-
-----------------------------------------------------------------
-Released 2.0.9 2005-07-28
-
-Changes since 2.0.8:
-
-Modules/
-* Removed __doc__ strings from ldapcontrol.c to "fix"
-  build problems with Python versions 2.2 and earlier.
-
-----------------------------------------------------------------
-Released 2.0.8 2005-06-22 at Linuxtag 2005, Karlsruhe, Germany
-
-Changes since 2.0.7:
-
-* Preliminary support for receiving LDAP controls added.
-  Contributor:
-  - Andreas Ames
-
-Lib/
-- Added classes in module ldif to ldif.__all__ to fix
-  from ldif import *
-- Removed BitString syntax from
-  ldap.schema.models.NOT_HUMAN_READABLE_LDAP_SYNTAXES
-  since the LDAP encoding is in fact human-readable
-- ldapurl.LDAPUrlExtension.unparse() outputs empty string
-  if LDAPUrlExtension.exvalue is None
-- Added ldap.controls.SimplePagedResultsControl
-
-----------------------------------------------------------------
-Released 2.0.7 2005-04-29
-
-Changes since 2.0.6:
-
-* Added preliminary support for sending LDAP controls
-  with a request.
-  Contributors:
-  - Deepak Giridharagopal
-  - Ingo Steuwer
-  (Receiving controls in LDAP results still not supported.)
-
-Modules:
-* LDAPObject.c: removed l_ldap_manage_dsa_it()
-* LDAPObject.c: Added missing #ifdef around l_ldap_passwd()
-  for compability with older OpenLDAP libs.
-
-Lib/
-* New algorithm in ldap.schema.tokenizer.split_tokens()
-  contributed by Wido Depping which is more robust
-  when parsing very broken schema elements
-  (e.g. Oracle's OID).
-* Fixed argument list (position of timeout) when calling
-  LDAPObject.search_ext_s() from search_st() and search_s().
-* LDAPObject.search_ext_s() correctly calls search_ext_s() now.
-* Re-implemented LDAPObject.manage_dsa_it() without calling _ldap.
-
-----------------------------------------------------------------
-Released 2.0.6 2004-12-03
-
-Changes since 2.0.5:
-
-Lib/
-* Added sub-module ldap.dn
-* Added function ldap.dn.escape_dn_chars()
-* Special check when implicitly setting SUP 'top' to
-  structural object classes without SUP defined to avoid
-  a loop in the super class chain.
-
-----------------------------------------------------------------
-Released 2.0.5 2004-11-11
-
-Changes since 2.0.4:
-
-Some small improvements for SASL:
-The noisy output during SASL bind is avoided now. Interaction
-with output on stderr can be enabled by the calling application
-by explicitly defining SASL flags.
-
-Removed obsolete directory Win32/.
-
-Lib/
-* Make sure that ldap.sasl.sasl.cb_value_dict is a dictionary
-  even when the caller passes in None to argument cb_value_dict
-* Added new key-word arg sasl_flags to method
-  LDAPObject.sasl_interactive_bind_s()
-
-Modules/
-* l_ldap_sasl_interactive_bind_s():
-  New key-word arg sasl_flags passed to
-  ldap_sasl_interactive_bind_s()
-
-----------------------------------------------------------------
-Released 2.0.4 2004-10-27
-
-Changes since 2.0.3:
-
-Modules/
-* Applied some fixes for 64-bit platforms to LDAPObject.c
-* Constants ldap.TLS_AVAIL and ldap.SASL_AVAIL will indicate
-  whether python-ldap was built with support for SSL/TLS
-  and/or SASL
-
-setup.py and Modules/
-* Applied some fixes for building under Win32
-
-----------------------------------------------------------------
-Released 2.0.3 2004-10-06
-
-Changes since 2.0.2:
-
-* Added support for LDAP Password Modify Extended Operation
-  (see RFC 3062)
-
-Demo/:
-* Added passwd_ext_op.py
-
-Modules/
-* Added l_ldap_passwd() in LDAPObject.c
-
-Lib/
-* Added methods passwd() and passwd_s() to
-  ldap.ldapobject.LDAPObject
-
-----------------------------------------------------------------
-Released 2.0.2 2004-07-29
-
-Changes since 2.0.1:
-
-Modules/
-* Fixed detecting appropriate OpenLDAP libs version for
-  determining whether ldap_whoami_s() is available or not.
-  This fixes build problems with OpenLDAP libs 2.1.0 up
-  to 2.1.12.
-
-----------------------------------------------------------------
-Released 2.0.1 2004-06-29
-
-Changes since 2.0.0:
-
-dsml:
-* Fixed wrong exception message format string
-
-ldap.schema.models:
-* Fixed Entry.__delitem__() to delete really everything
-  when deleting an attribute dictionary item.
-
-----------------------------------------------------------------
-Released 2.0.0 2004-05-18
-
-Changes since 2.0.0pre21:
-
-ldif:
-* Empty records are simply ignored in ldif.LDIFWriter.unparse()
-
-Modules/
-* New method result2() returns 3-tuple containing the msgid
-  of the outstanding operation.
-
-ldap.ldapobject:
-* New _ldap wrapper method LDAPObject.result2() (see above)
-  which is now used by LDAPObject.result().
-
-----------------------------------------------------------------
-Released 2.0.0pre21 2004-03-29
-
-Changes since 2.0.0pre20:
-
-setup.py:
-* runtime_library_dirs is set
-
-Modules/
-* (Hopefully) fixed building with OpenLDAP 2.2 libs in errors.c
-* Removed meaningless repr() function from LDAPObject.c
-* Removed setting LDAP_OPT_PROTOCOL_VERSION in l_ldap_sasl_bind_s()
-* Modified string handling via berval instead of *char
-  in l_ldap_compare_ext() makes it possible to compare attribute
-  values with null chars.
-* Wrapped ldap_sasl_bind() for simple binds instead of ldap_bind()
-  since 1. the latter is marked deprecated and 2. ldap_sasl_bind()
-  allows password credentials with null chars.
-* Removed unused sources linkedlist.c and linkedlist.h
-* Function l_ldap_whoami_s() only added if built against
-  OpenLDAP 2.1.x+ libs (should preserve compability with 2.0 libs)
-
-ldap.ldapobject:
-* LDAPObject.bind() only allows simple binds since Kerberos V4
-  binds of LDAPv2 are not supported anymore. An assert statement
-  was added to make the coder aware of that.
-* Renamed former LDAPObject.sasl_bind_s() to
-  LDAPObject.sasl_interactive_bind_s() since it wraps OpenLDAP's
-  ldap_sasl_interactive_bind_s()
-
-----------------------------------------------------------------
-Released 2.0.0pre20 2004-03-19
-
-Changes since 2.0.0pre19:
-
-Modules/
-* Removed doc strings from functions.c
-* Removed probably unused wrapper function l_ldap_dn2ufn() since
-  ldap_dn2ufn() is deprecated in OpenLDAP 2.1+
-* Removed wrapper function l_ldap_is_ldap_url().
-* Removed macro add_int_r() from constants.c since it caused
-  incompability issues with OpenLDAP 2.2 libs
-  (Warning: all result types are Integers now! Use the constants!)
-* New wrapper function l_ldap_whoami_s()
-
-ldap.ldapobject:
-* New wrapper method LDAPObject.whoami_s()
-
-ldap.functions:
-* Removed is_ldap_url(). The more general function
-  ldapurl.isLDAPUrl() should be used instead.
-
-ldap.sasl:
-* Added class cram_md5 (for SASL mech CRAM-MD5)
-
-ldap.async:
-* Use constants for search result types (see note about
-  add_int_r() above).
-
-----------------------------------------------------------------
-Released 2.0.0pre19 2004-01-22
-
-Changes since 2.0.0pre18:
-
-Modules/
-* LDAPObject.c:
-  Most deprecated functions of OpenLDAP C API are not used anymore.
-* functions.c:
-  Removed unused default_ldap_port().
-* constants.c:
-  Removed unused or silly constants
-  AUTH_KRBV4, AUTH_KRBV41, AUTH_KRBV42, URL_ERR_BADSCOPE, URL_ERR_MEM
-* errors.c:
-  Fixed building with OpenLDAP 2.2.x
-  (errors caused by negative error constants in ldap.h)
-
-ldap.ldapobject.LDAPObject:
-* Removed unused wrapper methods uncache_entry(), uncache_request(),
-  url_search(), url_search_st() and url_search_s()
-* New wrapper methods for all the _ext() methods in _ldap.LDAPObject.
-
-ldap.modlist:
-* Some performance optimizations and simplifications
-  in function modifyModlist()
-
-----------------------------------------------------------------
-Released 2.0.0pre18 2003-12-09
-
-Changes since 2.0.0pre17:
-
-ldap.ldapobject:
-* Fixed missing ldap._ldap_function_call() in
-  ReconnectLDAPObject.reconnect()
-
-----------------------------------------------------------------
-Released 2.0.0pre17 2003-12-03
-
-Changes since 2.0.0pre16:
-
-ldap.functions:
-* Fixed ImportError when running python -O
-
-----------------------------------------------------------------
-Released 2.0.0pre16 2003-12-02
-
-Changes since 2.0.0pre15:
-
-Modules/
-* Removed definition of unused constant RES_EXTENDED_PARTIAL since
-  the corresponding symbol LDAP_RES_EXTENDED_PARTIAL seems to not
-  be available in OpenLDAP-HEAD (pre 2.2) anymore.
-
-All in Lib/
-* Fixed some subtle bugs/oddities mentioned by pychecker.
-
-dsml:
-* Renamed DSMLWriter._f to DSMLWriter._output_file
-* Added wrapper method DSMLWriter.unparse() which simply
-  calls DSMLWriter.writeRecord()
-
-ldap.ldapobject:
-* Simplified LDAPObject.search_subschemasubentry_s()
-
-ldap.functions:
-* Moved ldap._ldap_function_call() into ldap.functions.
-* apply() is not used anymore since it seems deprecated
-
-ldap.async:
-* Added class DSMLWriter
-
-ldap.schema:
-* Removed unused key-word argument strict from
-  ldap.schema.subentry.SubSchema.attribute_types()
-* Fixed backward compability issue (for Python prior to 2.2) in
-  ldap.schema.subentry.SubSchema.listall()
-----------------------------------------------------------------
-Released 2.0.0pre15 2003-11-11
-
-Changes since 2.0.0pre14:
-
-Modules/
-Follow rule "Always include Python.h first"
-
-ldap.schema.subentry:
-* Added new method SubSchema.get_structural_oc()
-* Added new method SubSchema.get_applicable_aux_classes()
-* Methods SubSchema.listall() and SubSchema.tree() have
-  new key-word argument schema_element_filters
-* Support for DIT content rules in SubSchema.attribute_types()
-
-----------------------------------------------------------------
-Released 2.0.0pre14 2003-10-03
-
-Changes since 2.0.0pre13:
-
-setup.py:
-* Some modifications to ease building for Win32
-* Added directory Build/ mainly intended for platform-specific
-  examples of setup.cfg
-* Fixed installing ldap.filter
-
-ldap.ldapobject:
-* Added class attribute LDAPObject.network_timeout mapped to
-  set_option(ldap.OPT_NETWORK_TIMEOUT,..)
-* LDAPObject.search_ext(): Pass arguments serverctrls,clientctrls
-  to _ldap.search_ext()
-
-ldap.sasl:
-* Added class ldap.sasl.external for handling
-  the SASL mechanism EXTERNAL
-* Dictionary ldap.sasl.saslmech_handler_class built during import
-  for all the known SASL mechanisms derived from class definitions
-
-ldap.schema:
-* More graceful handling of KeyError in SubSchema.attribute_types()
-* New method SubSchema.get_inheritedattr() for retrieving inherited
-  class attributes
-* New method SubSchema.get_inheritedobj() for retrieving a
-  schema element instance including all inherited class attributes
-
-----------------------------------------------------------------
-Released 2.0.0pre13 2003-06-02
-
-Changes since 2.0.0pre12:
-
-ldap.async:
-* Checking type of argument writer_obj relaxed in
-  LDIFWriter.__init__() since file-like objects are
-  not necessarily an instance of file.
-
-ldap.schema:
-* ldap.schema.subentry.SubSchema.attribute_types() now correctly
-  handles attribute types without NAME set
-* If SUP is not defined for a structural object class 'top' is
-  assumed to be the only super-class by default
-* '_' is now the abstract top node in SubSchema.tree() for all
-  schema element classes since ABSTRACT and AUXILIARY object
-  classes are not derived from 'top' by default
-
-----------------------------------------------------------------
-Released 2.0.0pre12 2003-05-27
-
-Changes since 2.0.0pre11:
-
-New sub-module ldap.filter:
-* Added functions escape_filter_chars() and filter_format()
-
-ldap.ldapobject:
-* Trace log writes LDAP URI of connection instead of module name
-* search_s() passes self.timeout as argument timeout when
-  calling search_ext_s()
-* Key-word arguments for simple_bind() and simple_bind_s()
-  with defaults for anonymous bind.
-* LDAPObject.protocol_version is set to LDAPv3 as default
-  (this might make code changes necessary in a real LDAPv2
-   environment)
-* Default for key-word argument trace_stack_limit passed to
-  __init__() is 5
-* Updated __doc__ strings
-* Aligned and tested ReconnectLDAPObject and SmartLDAPObject
-
-ldap.async:
-* LDIFWriter uses ldif.LDIFWriter instead of calling
-  function ldif.CreateLDIF
-* LDIFWriter accepts either file-like object or ldif.LDIFWriter
-  instance as argument for specifying the output
-
-ldif:
-* Abandoned argument all_records of LDIFRecordList.__init__()
-
-ldapurl:
-* urllib.unquote() used instead of urllib.unquote_plus()
-
-----------------------------------------------------------------
-Released 2.0.0pre11 2003-05-02
-
-Changes since 2.0.0pre10:
-
-ldap.ldapobject:
-* Cosmetic change: Named argument list for LDAPObject.compare()
-  instead of *args,**kwargs.
-* Fixed bug in ReconnectLDAPObject._apply_method_s() affecting
-  compability with Python 2.0. The bug was introduced with
-  2.0.0pre09 by dropping use of apply().
-
-ldap.modlist:
-* modifyModlist(): Only None is filtered from attribute value lists,
-  '' is preserved as valid attribute value. But filtering applies
-  to old_value and new_value now.
-
-ldap.schema:
-* Zero-length attribute values for schema elements are ignored
-  (needed on e.g. Active Directory)
-
-dsml:
-Added support for parsing and generating DSMLv1.
-Still experimental though.
-
-
-----------------------------------------------------------------
-Released 2.0.0pre10 2003-04-19
-
-Changes since 2.0.0pre09:
-
-ldap.schema:
-* Emulate BooleanType for compability with Python2.3 in assert
-  statements
-
-----------------------------------------------------------------
-Released 2.0.0pre09 2003-04-19
-
-Changes since 2.0.0pre08:
-
-Modified setup.py to support Cyrus-SASL 2.x.
-
-ldap.ldapobject:
-* apply() is not used anymore since it seems deprecated
-* Fixed __setstate__() and __getstate__() of ReconnectLDAPObject
-
-ldap.schema:
-* Completed classes for nameForms, dITStructureRules and
-  dITContentRules
-
-----------------------------------------------------------------
-Released 2.0.0pre08 2003-04-11
-
-Changes since 2.0.0pre07:
-
-ldap.schema:
-* For backward compability with Python versions prior to 2.2
-  Lib/ldap/schema/tokenizer.py and Lib/ldap/schema/models.py use
-  (()) instead of tuple() for creating empty tuples.
-
-----------------------------------------------------------------
-Released 2.0.0pre07 2003-04-03
-
-Changes since 2.0.0pre06:
-
-LDAPObject.c:
-  * Wrapped OpenLDAP's ldap_search_ext()
-  * Removed empty __doc__ strings
-  * Removed fileno
-  * Removed all stuff related to caching in OpenLDAP libs
-
-ldap.ldapobject:
-  * Fixed SASL rebind in ldap.ldapobject.ReconnectLDAPObject
-  * use search_ext() instead ldap_search()
-  * new class attribute timeout for setting a global time-out
-    value for all synchronous operations
-
-ldap.schema:
-* Fixed two typos in ldap.schema.models
-* Some attempts to improve performance of parser/tokenizer
-* Completely reworked to have separate OID dictionaries for
-  the different schema element classes
-* Fixed the Demo/schema*.py to reflect changes to ldap.schema
-
-Documentation updates and various __doc__ string modifications.
-
-ldapurl:
-  * Removed all Unicode stuff from module ldapurl
-  * Consistent URL encoding in module ldapurl
-
-ldif:
-  * Removed ldif.FileWriter
-  * Proper handling of FILL (see RFC 2849)
-
-----------------------------------------------------------------
-Released 2.0.0pre06 2002-09-23
-
-Changes since 2.0.0pre05:
-- Fine-grained locking when linking against libldap_r
-- New wrapper class ldap.ReconnectLDAPObject
-- Security fix to module ldapurl
-- Other fixes and improvements to whole package
-- LDAPv3 schema support
-  (still somewhat premature and undocumented)
-
-----------------------------------------------------------------
-Released 2.0.0pre05 2002-07-20
-
-----------------------------------------------------------------
-Released 2.0.0pre04 2002-02-09
-
-----------------------------------------------------------------
-Released 2.0.0pre02 2002-02-01
-
-----------------------------------------------------------------
-Released 1.10alpha3 2000-09-19
-
-$Id: CHANGES,v 1.225 2010/02/26 09:30:52 stroeder Exp $

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 80
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/deltree.py

@@ -1,80 +0,0 @@
-import ldap,ldap.async
-
-class DeleteLeafs(ldap.async.AsyncSearchHandler):
-  """
-  Class for deleting entries which are results of a search.
-  
-  DNs of Non-leaf entries are collected in DeleteLeafs.nonLeafEntries.
-  """
-  _entryResultTypes = ldap.async._entryResultTypes
-
-  def __init__(self,l):
-    ldap.async.AsyncSearchHandler.__init__(self,l)
-    self.nonLeafEntries = []
-    self.deletedEntries = 0
-
-  def startSearch(self,searchRoot,searchScope):
-    if not searchScope in [ldap.SCOPE_ONELEVEL,ldap.SCOPE_SUBTREE]:
-      raise ValueError, "Parameter searchScope must be either ldap.SCOPE_ONELEVEL or ldap.SCOPE_SUBTREE."
-    self.nonLeafEntries = []
-    self.deletedEntries = 0
-    ldap.async.AsyncSearchHandler.startSearch(
-      self,
-      searchRoot,
-      searchScope,
-      filterStr='(objectClass=*)',
-      attrList=['hasSubordinates','numSubordinates'],
-      attrsOnly=0,
-    )
-
-  def _processSingleResult(self,resultType,resultItem):
-    if self._entryResultTypes.has_key(resultType):
-      # Don't process search references
-      dn,entry = resultItem
-      hasSubordinates = entry.get(
-        'hasSubordinates',
-        entry.get('hassubordinates',['FALSE']
-        )
-      )[0]
-      numSubordinates = entry.get(
-        'numSubordinates',
-        entry.get('numsubordinates',['0'])
-      )[0]
-      if hasSubordinates=='TRUE' or int(numSubordinates):
-        self.nonLeafEntries.append(dn)
-      else:
-        try:
-          self._l.delete_s(dn)
-        except ldap.NOT_ALLOWED_ON_NONLEAF,e:
-          self.nonLeafEntries.append(dn)
-        else:
-          self.deletedEntries = self.deletedEntries+1
-
-
-def DelTree(l,dn,scope=ldap.SCOPE_ONELEVEL):
-  """
-  Recursively delete entries below or including entry with name dn.
-  """
-  leafs_deleter = DeleteLeafs(l)
-  leafs_deleter.startSearch(dn,scope)
-  leafs_deleter.processResults()
-  deleted_entries = leafs_deleter.deletedEntries
-  non_leaf_entries = leafs_deleter.nonLeafEntries[:]
-  while non_leaf_entries:
-    dn = non_leaf_entries.pop()
-    print deleted_entries,len(non_leaf_entries),dn
-    leafs_deleter.startSearch(dn,ldap.SCOPE_SUBTREE)
-    leafs_deleter.processResults()
-    deleted_entries = deleted_entries+leafs_deleter.deletedEntries
-    non_leaf_entries.extend(leafs_deleter.nonLeafEntries)
-  return # DelTree()
-
-
-# Create LDAPObject instance
-l = ldap.initialize('ldap://localhost:1390')
-
-# Try a bind to provoke failure if protocol version is not supported
-l.simple_bind_s('cn=Directory Manager,dc=IMC,dc=org','controller')
-
-# Delete all entries *below* the entry dc=Delete,dc=IMC,dc=org
-DelTree(l,'dc=Delete,dc=IMC,dc=org',ldap.SCOPE_ONELEVEL)

+ 0 - 42
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/ldifwriter.py

@@ -1,42 +0,0 @@
-"""
-ldifwriter - using ldap.async module for output of LDIF stream
-             of LDAP search results
-
-Written by Michael Stroeder <michael@stroeder.com>
-
-$Id: ldifwriter.py,v 1.4 2006/03/26 12:23:07 stroeder Exp $
-
-This example translates the naming context of data read from
-input, sanitizes some attributes, maps/removes object classes,
-maps/removes attributes., etc. It's far from being complete though.
-
-Python compability note:
-Tested on Python 2.0+, should run on Python 1.5.x.
-"""
-
-import sys,ldap,ldap.async
-
-s = ldap.async.LDIFWriter(
-  ldap.initialize('ldap://localhost:1390'),
-  sys.stdout
-)
-
-s.startSearch(
-  'dc=stroeder,dc=de',
-  ldap.SCOPE_SUBTREE,
-  '(objectClass=*)',
-)
-
-try:
-  partial = s.processResults()
-except ldap.SIZELIMIT_EXCEEDED:
-  sys.stderr.write('Warning: Server-side size limit exceeded.\n')
-else:
-  if partial:
-    sys.stderr.write('Warning: Only partial results received.\n')
-
-sys.stderr.write(
-  '%d results received.\n' % (
-    s.endResultBreak-s.beginResultsDropped
-  )
-)

+ 0 - 42
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldap/async/sizelimit.py

@@ -1,42 +0,0 @@
-"""
-ldifwriter - using ldap.async module for retrieving partial results
-             in a list even though the exception ldap.SIZELIMIT_EXCEEDED
-             was raised.output of LDIF stream
-
-Written by Michael Stroeder <michael@stroeder.com>
-
-$Id: sizelimit.py,v 1.4 2006/03/26 12:23:07 stroeder Exp $
-
-This example translates the naming context of data read from
-input, sanitizes some attributes, maps/removes object classes,
-maps/removes attributes., etc. It's far from being complete though.
-
-Python compability note:
-Tested on Python 2.0+, should run on Python 1.5.x.
-"""
-
-import sys,ldap,ldap.async
-
-s = ldap.async.List(
-  ldap.initialize('ldap://localhost:1390'),
-)
-
-s.startSearch(
-  'dc=stroeder,dc=de',
-  ldap.SCOPE_SUBTREE,
-  '(objectClass=*)',
-)
-
-try:
-  partial = s.processResults()
-except ldap.SIZELIMIT_EXCEEDED:
-  sys.stderr.write('Warning: Server-side size limit exceeded.\n')
-else:
-  if partial:
-    sys.stderr.write('Warning: Only partial results received.\n')
-
-sys.stderr.write(
-  '%d results received.\n' % (
-    len(s.allResults)
-  )
-)

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldapurl/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 32
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldapurl/urlsearch.py

@@ -1,32 +0,0 @@
-"""
-Do a search with the LDAP URL specified at command-line.
-
-No output of LDAP data is produced except trace output.
-"""
-
-import sys,getpass,ldap,ldapurl
-
-try:
-  ldapUrl = ldapurl.LDAPUrl(ldapUrl=sys.argv[1])
-except IndexError:
-  print 'Usage: %s [LDAP URL]' % (sys.argv[0])
-  sys.exit(1)
-
-for a in [
-  'urlscheme','hostport','dn','attrs','scope',
-  'filterstr','extensions','who','cred'
-]:
-  print a,repr(getattr(ldapUrl,a))
-
-l = ldap.initialize(ldapUrl.initializeUrl(),trace_level=1)
-if ldapUrl.who!=None:
-  if ldapUrl.cred!=None:
-    cred=ldapUrl.cred
-  else:
-    print 'Enter password for simple bind with',repr(ldapUrl.who)
-    cred=getpass.getpass()
-  l.simple_bind_s(ldapUrl.who,cred)
-
-res = l.search_s(ldapUrl.dn,ldapUrl.scope,ldapUrl.filterstr,ldapUrl.attrs)
-
-print len(res),'search results'

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 226
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/filterldif.py

@@ -1,226 +0,0 @@
-"""
-filterldif - example for implementing a LDIF filter class
-
-Written by Michael Stroeder <michael@stroeder.com>
-
-$Id: $
-
-This example translates the naming context of data read from
-input, sanitizes some attributes, maps/removes object classes,
-maps/removes attributes., etc. It's far from being complete though.
-
-Python compability note:
-Runs on Python 2.0+
-"""
-
-##################################################################
-# Configuration
-##################################################################
-
-import sys
-
-source_namingcontext = 'O=MICHAELS'
-
-target_namingcontext = 'dc=stroeder,dc=de'
-
-infile = sys.stdin
-
-outfile = sys.stdout
-
-infile_charset = 'utf-8'
-outfile_charset = 'utf-8'
-
-##################################################################
-# Nothing to configure below this line
-##################################################################
-
-import re,ldap,ldif
-
-from ldap.cidict import cidict
-
-german_syntax_re = re.compile(r'^0[1-9]+[0-9]+[\s]*/[0-9 -]+$')
-german_syntax2_re = re.compile(r'^0[1-9]+[0-9]+[\s]*-[0-9 -]+$')
-german_countrycode_re = re.compile(r'^[+]+[\s-]*49[\s-]*\(0\)[\w]+[0-9/-]+$')
-us_syntax_re = re.compile(
-  r'^([1-9]+|\([1-9]+\))+[\s-]*[0-9]+[\s]*-[\s]*[0-9x -]+$'
-)
-
-german_mobile_dict = {
-  '0160':'D1','0161':'D1','0170':'D1','0171':'D1','0175':'D1',
-  '0162':'D2','0172':'D2','0173':'D2','0174':'D2',
-  '0177':'E-Plus','0178':'E-Plus',
-  '0176':'E2','0179':'E2',
-}
-
-def sanitize_phonenumber(s):
-  if not s: return ''
-  old = s
-  s = s.strip()
-  if german_countrycode_re.match(s):
-    s = s.replace('(0)','')
-  elif us_syntax_re.match(s):
-    s = '+1 '+ s
-  else:
-    if german_syntax_re.match(s):
-      sep = '/'
-    elif german_syntax2_re.match(s):
-      sep = '-'
-    else:
-      sep = None
-    if sep:
-      area_code,rest = s.split(sep)
-      if german_mobile_dict.has_key(area_code):
-        # German mobile are not structured => remove spaces
-        rest = rest.replace(' ','').replace('-','')
-      s = ' '.join(['+49',area_code.strip()[1:],rest])
-  for i,j in [
-    (' - ',' '),('-',' '),('++','+'),('(',''),(')',''),('  ',' ')
-  ]:
-    s = s.replace(i,j)
-  s = s.strip()
-  return s
-
-def normalize_dn(dn):
-  result = ldap.explode_dn(dn)
-  return ','.join(result)
-
-def list_dict(l):
-  d={}
-  for i in l:
-    d[i.lower()] = None
-  return d
-
-class LDIFFilter(ldif.LDIFCopy):
-
-  def __init__(
-    self,
-    input_file,
-    output_file,
-    source_namingcontext,
-    target_namingcontext,
-    source_charset = 'utf-8',
-    target_charset = 'utf-8',
-    dn_attr_types=[],
-    delete_object_classes=[],
-    object_class_map={},
-    delete_attr_types=[],
-    attr_type_map={}
-  ):
-    ldif.LDIFCopy.__init__(self,input_file,output_file)
-    self.source_charset = source_charset
-    self.target_charset = target_charset
-    self.source_namingcontext = unicode(
-      normalize_dn(source_namingcontext),
-      source_charset
-    ).lower()
-    self.source_namingcontext_len = len(self.source_namingcontext)
-    self.target_namingcontext = unicode(
-      normalize_dn(target_namingcontext),
-      target_charset
-    )
-    self._dn_attr_types=cidict(list_dict(dn_attr_types))
-    self._delete_object_classes=cidict(list_dict(delete_object_classes))
-    self._object_class_map = cidict(object_class_map)
-    self._delete_attr_types=cidict(list_dict(delete_attr_types))
-    self._attr_type_map = cidict(attr_type_map)
-    self._phonenumber_syntax=list_dict([
-      'telephoneNumber','facsimileTelephoneNumber','fax',
-      'homePhone','homeTelephoneNumber','mobile','mobileTelephoneNumber',
-      'pager','pagerTelephoneNumber',
-    ])
-
-  def _transform_dn(self,dn):
-    dn = unicode(normalize_dn(dn),self.source_charset)
-    dn_len = len(dn)
-    if dn_len<self.source_namingcontext_len:
-      return dn.encode(self.target_charset)
-    elif dn[-self.source_namingcontext_len:].lower()==self.source_namingcontext:
-      dn = dn[:dn_len-self.source_namingcontext_len]+self.target_namingcontext
-      return dn.encode(self.target_charset)
-    else:
-      return dn.encode(self.target_charset)
-    
-  def handle(self,dn,entry):
-
-    new_entry = cidict(entry)
-
-    objectClass_attrvalue = cidict()
-    for oc in new_entry['objectClass']:
-      if self._delete_object_classes.has_key(oc.lower()):
-        continue
-      if self._object_class_map.has_key(oc):
-        for oc_new in self._object_class_map[oc]:
-          objectClass_attrvalue[oc_new] = None
-      else:
-        objectClass_attrvalue[oc] = None
-    new_entry['objectClass'] = objectClass_attrvalue.keys()
-
-    # Sanitize new_entry's attributes
-    for attr_type in new_entry.keys():
-      # Attributes to be deleted
-      if self._delete_attr_types.has_key(attr_type):
-        del new_entry[attr_type]
-        continue
-      if self._phonenumber_syntax.has_key(attr_type):
-        new_entry[attr_type] = map(sanitize_phonenumber,new_entry[attr_type])
-      # Transform attributes holding DNs
-      if self._dn_attr_types.has_key(attr_type):
-        new_entry[attr_type] = map(self._transform_dn,new_entry[attr_type])
-      # Transform attribute type names
-      if self._attr_type_map.has_key(attr_type):
-        mapped_attr_type = self._attr_type_map[attr_type]
-        if new_entry.has_key(mapped_attr_type):
-          new_entry[mapped_attr_type].extend(new_entry[attr_type])
-        else:
-          new_entry[mapped_attr_type] = new_entry[attr_type]
-        del new_entry[attr_type]
-
-    entry = {}
-    entry.update(new_entry)    
-
-    ldif.LDIFCopy.handle(self,self._transform_dn(dn),entry)
-
-
-##################################################################
-# Main
-##################################################################
-
-ldif_filter = LDIFFilter(
-  infile,
-  outfile,
-  source_namingcontext,
-  target_namingcontext,
-  dn_attr_types=[
-    'modifiersname','creatorsname','seealso',
-    'manager','secretary','documentAuthor',
-    'aliasedObjectName','associatedName',
-  ],
-  delete_object_classes=[
-    'restaurant','pkiUser'
-  ],
-  object_class_map={
-    'inetOrgPerson':['inetOrgPerson','globalPerson'],
-    'labeledURLObject':['labeledURIObject'],
-    'bankArrangement':['germanBankArrangement'],
-  },
-  delete_attr_types=[
-    'destinationIndicator',
-    'owner','member',
-    'modifiersname','modifytimestamp',
-    'creatorsname','createtimestamp','userpassword',
-    'shortname'
-  ],
-  attr_type_map={
-    'usersmimecertificate;binary':'userSMIMECertificate',
-    'usercertificate;binary':'userCertificate',
-    'labeledurl':'labeledURI',
-    'bankarrangementinfo':'germanBankAccountInfo',
-    'bankaccount':'germanBankAccountNumber',
-    'bankcodenumber':'germanBankCode',
-    'bankname':'germanBankName',
-    'band':'musicalOrchestra',
-  },
-)
-
-ldif_filter.parse()
-

+ 0 - 28
desktop/core/ext-py/python-ldap-2.3.11/Demo/Lib/ldif/ldifcopy.py

@@ -1,28 +0,0 @@
-"""
-ldifcopy - reads LDIF from stdin, retrieve values by URL and
-           write resulting LDIF to stdout
-
-Written by Michael Stroeder <michael@stroeder.com>
-
-$Id: ldifcopy.py,v 1.2 2001/12/12 22:04:49 stroeder Exp $
-
-This example translates the naming context of data read from
-input, sanitizes some attributes, maps/removes object classes,
-maps/removes attributes., etc. It's far from being complete though.
-
-Python compability note:
-Tested on Python 2.0+, should run on Python 1.5.x.
-"""
-
-import sys,ldif
-
-infile = sys.stdin
-outfile = sys.stdout
-
-ldif_collector = ldif.LDIFCopy(
-  infile,
-  outfile,
-  process_url_schemes=['file','ftp','http']
-)
-ldif_collector.parse()
-

+ 0 - 144
desktop/core/ext-py/python-ldap-2.3.11/Demo/dn_search.py

@@ -1,144 +0,0 @@
-#!/usr/bin/python2.1
-
-version = '$Revision: 0.0 $'[11:-2]
-
-"""
-$Id$
-$Revision$
-
-Some unit tests for python-ldap.
-"""
-
-True=1 ; False=0 ; # builtin in 2.3!
-
-#import getopt
-#import os
-#import re
-import sys
-#import time
-import unittest
-
-import ldap
-
-class LDAPTestCase( unittest.TestCase ) :
-    """Base class for python-ldap unit tests."""
-
-    def __init__( self , server , base ) :
-        unittest.TestCase.__init__( self )
-        self.server = server
-        self.search_base = base
-
-    def setUp( self ) :
-        self.conn = ldap.initialize( 'ldap://'+self.server )
-
-    def tearDown( self ) :
-        del self.conn
-# end class LDAPTestCase
-
-
-class TestCase1( LDAPTestCase ) :
-    """ Test search_s for returning the 'dn' attribute.  """
-
-    #def __init__( self ) :
-    #    LDAPTestCase.__init__( methodName="" )
-
-    def runTest( self ) :
-        res = self.conn.search_s(   self.search_base ,
-                                    ldap.SCOPE_BASE ,
-                                    '(objectClass=*)' ,
-                                    ['dn']
-                                )
-        assert len(res) == 1 , "Wrong number of results : %s" % repr(res)
-        assert res[0][1].has_key( 'dn' ) , \
-                                    "Attribute 'dn' missing.  %s" % repr(res)
-    # end runTest()
-# end class TestCase1
-
-
-class TestCase2( LDAPTestCase ) :
-    """ Test search_st for returning the 'dn' attribute.  """
-
-    def runTest( self ) :
-        res = self.conn.search_st(   self.search_base ,
-                                    ldap.SCOPE_BASE ,
-                                    '(objectClass=*)' ,
-                                    ['dn'] ,
-                                    4
-                                )
-        assert len(res) == 1, "Wrong number of results : %s" % repr(res)
-        assert res[0][1].has_key( 'dn' ) , \
-                                "Attribute 'dn' missing.  %s" % repr(res)
-    # end runTest()
-# end class TestCase2
-
-
-
-class TestCase3( LDAPTestCase ) :
-    """ Test search/result for returning the 'dn' attribute.  """
-
-    def runTest( self ) :
-        msgid = self.conn.search(   self.search_base ,
-                                    ldap.SCOPE_BASE ,
-                                    '(objectClass=*)' ,
-                                    ['dn']
-                                )
-        res = self.conn.result( msgid , 4 )
-        assert len(res) != 0, "No results from search." % repr(res)
-        #assert res[0] == ldap.RES_SEARCH_RESULT, "unexpected result code %s"
-        data = res[1]
-        assert len(data) == 1, "Wrong number of results : %s" % repr(res)
-        for attr in ( 'dn' , ) :
-            assert data[0][1].has_key( attr ) , \
-                    "Expected attribute '%s' missing.  %s" % (attr, repr(res))
-    # end runTest()
-# end class TestCase3
-
-
-class TestCase4( LDAPTestCase ) :
-    """ Test search/result for returning some attributes.  """
-
-    def runTest( self ) :
-        msgid = self.conn.search(   self.search_base ,
-                                    ldap.SCOPE_BASE ,
-                                    '(objectClass=*)' #,
-                                    #['dn']
-                                )
-        res = self.conn.result( msgid , 4 )
-        assert len(res) != 0, "No results from search." % repr(res)
-        #assert res[0] == ldap.RES_SEARCH_RESULT, "unexpected result code %s"
-        data = res[1]
-        assert len(data) == 1, "Wrong number of results : %s" % repr(res)
-        for attr in ( 'o' , ) :
-            assert data[0][1].has_key( attr ) , \
-                    "Expected attribute '%s' missing.  %s" % (attr, repr(res))
-    # end runTest()
-# end class TestCase3
-
-
-
-
-def suite() :
-    """Build the suite of test cases"""
-
-    # suite1 = unittest.makeSuite( TestCase1 , "test_" )
-    # return unittest.TestSuite( (suite1, ) )
-
-    suite = unittest.TestSuite()
-    server = "barak"
-    base = "o=International Teams"
-    for tclass in ( TestCase1, TestCase2, TestCase3, TestCase4 ) :
-        suite.addTest( tclass( server=server , base=base ) )
-    return suite
-# end suite()
-
-
-
-if __name__ == "__main__" :
-    #unittest.main()
-    unittest.TextTestRunner().run( suite() )
-
-
-## ----------------------------------------------------------------------------
-# History :
-#   $Log$
-

+ 0 - 98
desktop/core/ext-py/python-ldap-2.3.11/Demo/initialize.py

@@ -1,98 +0,0 @@
-"""
-Various examples how to connect to a LDAP host with the new
-factory function ldap.initialize() introduced in OpenLDAP 2 API.
-
-Assuming you have LDAP servers running on
-ldap://localhost:1390 (LDAP with StartTLS)
-ldaps://localhost:1391 (LDAP over SSL)
-ldapi://%2ftmp%2fopenldap2 (domain socket /tmp/openldap2)
-"""
-
-import sys,os,ldap
-
-# Switch off processing .ldaprc or ldap.conf
-os.environ['LDAPNOINIT']='1'
-
-# Set debugging level
-ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
-ldapmodule_trace_level = 2
-ldapmodule_trace_file = sys.stderr
-
-ldap._trace_level = ldapmodule_trace_level
-
-# Complete path name of the file containing all trusted CA certs
-CACERTFILE='/etc/apache2/ssl.crt/ca-bundle.crt'
-
-# TLS-related options have to be set globally since the TLS context is only initialized once
-
-# Force libldap to create a new SSL context
-#ldap.set_option(ldap.OPT_X_TLS_NEWCTX,ldap.OPT_ON)
-# Force cert validation
-#ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,ldap.OPT_X_TLS_DEMAND)
-# Set path name of file containing all trusted CA certificates
-#ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,CACERTFILE)
-
-
-print """##################################################################
-# LDAPv3 connection with StartTLS
-##################################################################
-"""
-
-# Create LDAPObject instance
-l = ldap.initialize('ldap://localhost:1390',trace_level=ldapmodule_trace_level,trace_file=ldapmodule_trace_file)
-
-# Set LDAP protocol version used
-l.protocol_version=ldap.VERSION3
-# Force libldap to create a new SSL context
-l.set_option(ldap.OPT_X_TLS_NEWCTX,ldap.OPT_ON)
-# Force cert validation
-l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,ldap.OPT_X_TLS_DEMAND)
-# Set path name of file containing all trusted CA certificates
-l.set_option(ldap.OPT_X_TLS_CACERTFILE,CACERTFILE)
-
-# Now try StartTLS extended operation
-l.start_tls_s()
-
-# Try a bind to provoke failure if protocol version is not supported
-l.simple_bind_s('','')
-
-# Close connection
-l.unbind_s()
-
-print """##################################################################
-# LDAPv3 connection over SSL
-##################################################################
-"""
-
-# Create LDAPObject instance
-l = ldap.initialize('ldaps://localhost:1391',trace_level=ldapmodule_trace_level,trace_file=ldapmodule_trace_file)
-
-# Set LDAP protocol version used
-l.protocol_version=ldap.VERSION3
-# Force libldap to create a new SSL context
-l.set_option(ldap.OPT_X_TLS_NEWCTX,ldap.OPT_X_TLS_DEMAND)
-# Force cert validation
-l.set_option(ldap.OPT_X_TLS_REQUIRE_CERT,ldap.OPT_X_TLS_DEMAND)
-# Set path name of file containing all trusted CA certificates
-l.set_option(ldap.OPT_X_TLS_CACERTFILE,CACERTFILE)
-
-# Try a bind to provoke failure if protocol version is not supported
-l.simple_bind_s('','')
-
-# Close connection
-l.unbind_s()
-
-print """##################################################################
-# LDAPv3 connection over Unix domain socket
-##################################################################
-"""
-
-# Create LDAPObject instance
-l = ldap.initialize('ldapi://%2ftmp%2fopenldap-socket',trace_level=ldapmodule_trace_level,trace_file=ldapmodule_trace_file)
-# Set LDAP protocol version used
-l.protocol_version=ldap.VERSION3
-# Try a bind to provoke failure if protocol version is not supported
-l.bind_s('','',ldap.AUTH_SIMPLE)
-# Close connection
-l.unbind_s()
-

+ 0 - 33
desktop/core/ext-py/python-ldap-2.3.11/Demo/ldapcontrols.py

@@ -1,33 +0,0 @@
-import ldap,ldapurl,pprint
-
-from ldap.controls import LDAPControl,BooleanControl
-
-l = ldap.initialize('ldap://localhost:1390',trace_level=2)
-
-print 60*'#'
-
-pprint.pprint(l.get_option(ldap.OPT_SERVER_CONTROLS))
-l.manage_dsa_it(1,1)
-pprint.pprint(l.get_option(ldap.OPT_SERVER_CONTROLS))
-print 60*'#'
-
-# Search with ManageDsaIT control (which has no value)
-pprint.pprint(l.search_ext_s(
-  'cn=Test-Referral,ou=Testing,dc=stroeder,dc=de',
-  ldap.SCOPE_BASE,
-  '(objectClass=*)',
-  ['*','+'],
-  serverctrls = [ LDAPControl('2.16.840.1.113730.3.4.2',1,None) ],
-))
-print 60*'#'
-
-# Search with Subentries control (which has boolean value)
-pprint.pprint(l.search_ext_s(
-  'dc=stroeder,dc=de',
-  ldap.SCOPE_SUBTREE,
-  '(objectClass=subentry)',
-  ['*','+'],
-  serverctrls = [ BooleanControl('1.3.6.1.4.1.4203.1.10.1',1,1) ],
-))
-
-print 60*'#'

+ 0 - 63
desktop/core/ext-py/python-ldap-2.3.11/Demo/matchedvalues.py

@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# demo for matched values control (RFC 3876)
-#
-# suppose the uid=jsmith LDAP entry has two mail attributes:
-#
-# dn: uid=jsmith,ou=People,dc=example,dc=com
-# (...)
-# mail: jsmith@example.com
-# mail: jsmith@example.org
-#
-# Let's say you want to fetch only the example.org email. Without MV,
-# you would first fetch all mail attributes and then filter them further
-# on the client. With the MV control, the result can be given to the
-# client already filtered.
-#
-# Sample output:
-# $ ./matchedvalues.py
-# LDAP filter used: (&(objectClass=inetOrgPerson)(mail=*@example.org))
-# Requesting 'mail' attribute back
-#
-# No matched values control:
-# dn: uid=jsmith,ou=People,dc=example,dc=com
-# mail: jsmith@example.org
-# mail: john@example.com
-#
-# Matched values control: (mail=*@example.org)
-# dn: uid=jsmith,ou=People,dc=example,dc=com
-# mail: jsmith@example.org
-
-import ldap
-from ldap.controls import MatchedValuesControl
-
-def print_result(search_result):
-    for n in range(len(search_result)):
-        print "dn: %s" % search_result[n][0]
-        for attr in search_result[n][1].keys():
-            for i in range(len(search_result[n][1][attr])):
-                print "%s: %s" % (attr, search_result[n][1][attr][i])
-        print
-
-
-uri = "ldap://ldap.example.com"
-base = "dc=example,dc=com"
-scope = ldap.SCOPE_SUBTREE
-filter = "(&(objectClass=inetOrgPerson)(mail=*@example.org))"
-control_filter = "(mail=*@example.org)"
-
-ld = ldap.initialize(uri)
-
-mv = MatchedValuesControl(criticality=True, controlValue=control_filter)
-
-res = ld.search_ext_s(base, scope, filter, attrlist = ['mail'])
-print "LDAP filter used: %s" % filter
-print "Requesting 'mail' attribute back"
-print
-print "No matched values control:"
-print_result(res)
-
-res = ld.search_ext_s(base, scope, filter, attrlist = ['mail'], serverctrls = [mv])
-print "Matched values control: %s" % control_filter
-print_result(res)
-

+ 0 - 38
desktop/core/ext-py/python-ldap-2.3.11/Demo/ms_ad_bind.py

@@ -1,38 +0,0 @@
-# How to bind to MS AD with python-ldap and various methods
-
-import ldap,ldap.sasl
-
-ldap_uri = "ldap://dc1.example.com"
-dn = "CN=Anna Blume,CN=Users,DC=addomain,DC=example,DC=com"
-sAMAccountName = "ABlume"
-userPrincipalName = "ablume@addomain.example.com"
-password = 'testsecret'
-
-trace_level = 2
-
-l = ldap.initialize(ldap_uri,trace_level=trace_level)
-
-# Normal LDAPv3 compliant simple bind
-l.simple_bind_s(dn,password)
-
-# This is AD-specific and not LDAPv3 compliant
-l.simple_bind_s(userPrincipalName,password)
-
-# This is AD-specific and not LDAPv3 compliant
-l.simple_bind_s(userPrincipalName,password)
-
-# SASL bind with mech DIGEST-MD5 with sAMAccountName as SASL user name
-sasl_auth = ldap.sasl.sasl(
-  {
-    ldap.sasl.CB_AUTHNAME:sAMAccountName,
-    ldap.sasl.CB_PASS    :password,
-  },
-  'DIGEST-MD5'
-)
-l.sasl_interactive_bind_s("", sasl_auth)
-
-# SASL bind with mech GSSAPI
-# with the help of Kerberos V TGT obtained before with command
-# kinit ablume@ADDOMAIN.EXAMPLE.COM
-sasl_auth = ldap.sasl.sasl({},'GSSAPI')
-l.sasl_interactive_bind_s("", sasl_auth)

+ 0 - 39
desktop/core/ext-py/python-ldap-2.3.11/Demo/ms_ad_specific_controls.py

@@ -1,39 +0,0 @@
-import ldap,pprint
-
-from ldap.controls import BooleanControl
-
-ldap_uri = "ldap://172.16.15.10"
-dn = "CN=Anna Blume,CN=Users,DC=dom2,DC=adtest,DC=local"
-password = 'testsecret'
-trace_level = 2
-LDAP_SERVER_DOMAIN_SCOPE_OID='1.2.840.113556.1.4.1339'
-
-l = ldap.initialize(ldap_uri,trace_level=trace_level)
-
-# Switch off chasing referrals within OpenLDAP's libldap
-l.set_option(ldap.OPT_REFERRALS, 0)
-
-# Simple bind with user's DN and password
-l.simple_bind_s(dn,password)
-
-# Search without any controls
-pprint.pprint(l.search_ext_s(
-  'DC=dom2,DC=adtest,DC=local',
-  ldap.SCOPE_ONELEVEL,
-  '(objectClass=subentry)',
-  ['*'],
-  serverctrls = [],
-))
-
-# Search with LDAP_SERVER_DOMAIN_SCOPE_OID control (which has boolean value)
-pprint.pprint(l.search_ext_s(
-  'DC=dom2,DC=adtest,DC=local',
-  ldap.SCOPE_ONELEVEL,
-  '(objectClass=subentry)',
-  ['*'],
-  serverctrls = [
-    BooleanControl(LDAP_SERVER_DOMAIN_SCOPE_OID,criticality=0,controlValue=1)
-  ],
-))
-
-print 60*'#'

+ 0 - 29
desktop/core/ext-py/python-ldap-2.3.11/Demo/options.py

@@ -1,29 +0,0 @@
-
-import ldap
-
-host="localhost:1390"
-
-print "API info:",ldap.get_option(ldap.OPT_API_INFO)
-print "debug level:",ldap.get_option(ldap.OPT_DEBUG_LEVEL)
-#print "Setting debug level to 255..."
-#ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
-#print "debug level:",ldap.get_option(ldap.OPT_DEBUG_LEVEL)
-print "default size limit:",ldap.get_option(ldap.OPT_SIZELIMIT)
-print "Setting default size limit to 10..."
-ldap.set_option(ldap.OPT_SIZELIMIT,10)
-print "default size limit:",ldap.get_option(ldap.OPT_SIZELIMIT)
-print "Creating connection to",host,"..."
-l=ldap.init(host)
-print "size limit:",l.get_option(ldap.OPT_SIZELIMIT)
-print "Setting connection size limit to 20..."
-l.set_option(ldap.OPT_SIZELIMIT,20)
-print "size limit:",l.get_option(ldap.OPT_SIZELIMIT)
-#print "Setting time limit to 60 secs..."
-l.set_option(ldap.OPT_TIMELIMIT,60)
-#print "time limit:",l.get_option(ldap.OPT_TIMELIMIT)
-print "Binding..."
-l.simple_bind_s("","")
-
-
-
-

+ 0 - 57
desktop/core/ext-py/python-ldap-2.3.11/Demo/page_control.py

@@ -1,57 +0,0 @@
-url = "ldap://localhost:1390/"
-base = "dc=stroeder,dc=de"
-search_flt = r'(objectClass=*)'
-page_size = 10
-
-import ldap,pprint
-from ldap.controls import SimplePagedResultsControl
-
-searchreq_attrlist=['cn','entryDN','entryUUID','mail','objectClass']
-
-#ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
-ldap.set_option(ldap.OPT_REFERRALS, 0)
-l = ldap.initialize(url,trace_level=1)
-l.protocol_version = 3
-l.simple_bind_s("", "")
-
-lc = SimplePagedResultsControl(
-  ldap.LDAP_CONTROL_PAGE_OID,True,(page_size,'')
-)
-
-# Send search request
-msgid = l.search_ext(
-  base,
-  ldap.SCOPE_SUBTREE,
-  search_flt,
-  attrlist=searchreq_attrlist,
-  serverctrls=[lc]
-)
-
-pages = 0
-while True:
-    pages += 1
-    print "Getting page %d" % (pages,)
-    rtype, rdata, rmsgid, serverctrls = l.result3(msgid)
-    print '%d results' % len(rdata)
-#    pprint.pprint(rdata)
-    pctrls = [
-      c
-      for c in serverctrls
-      if c.controlType == ldap.LDAP_CONTROL_PAGE_OID
-    ]
-    if pctrls:
-        est, cookie = pctrls[0].controlValue
-        if cookie:
-            lc.controlValue = (page_size, cookie)
-            msgid = l.search_ext(
-              base,
-              ldap.SCOPE_SUBTREE,
-              search_flt,
-              attrlist=searchreq_attrlist,
-              serverctrls=[lc]
-            )
-        else:
-            break
-    else:
-        print "Warning:  Server ignores RFC 2696 control."
-        break

+ 0 - 32
desktop/core/ext-py/python-ldap-2.3.11/Demo/passwd_ext_op.py

@@ -1,32 +0,0 @@
-"""
-Example showing the use of the password extended operation.
-"""
-
-import sys,ldap,ldapurl,getpass
-
-# Set debugging level
-ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
-ldapmodule_trace_level = 2
-ldapmodule_trace_file = sys.stderr
-
-lu = ldapurl.LDAPUrl(sys.argv[1])
-
-print 'Old password'
-oldpw = getpass.getpass()
-print 'New password'
-newpw = getpass.getpass()
-
-# Set path name of file containing all CA certificates
-# needed to validate server certificates
-ldap.set_option(ldap.OPT_X_TLS_CACERTFILE,'/etc/httpd/ssl.crt/myCA-cacerts.pem')
-
-# Create LDAPObject instance
-l = ldap.initialize(lu.initializeUrl(),trace_level=ldapmodule_trace_level,trace_file=ldapmodule_trace_file)
-
-l.protocol_version=ldap.VERSION3
-
-l.simple_bind_s(lu.dn,oldpw)
-
-l.passwd(lu.dn,oldpw,newpw)
-
-l.unbind_s()

+ 0 - 12
desktop/core/ext-py/python-ldap-2.3.11/Demo/pickle_ldapobject.py

@@ -1,12 +0,0 @@
-import os,ldap,pickle
-
-temp_file_name = os.path.join(os.environ.get('TMP','/tmp'),'pickle_ldap-%d' % (os.getpid()))
-
-l1 = ldap.ldapobject.ReconnectLDAPObject('ldap://localhost:1390',trace_level=1)
-l1.protocol_version = 3
-l1.search_s('',ldap.SCOPE_BASE,'(objectClass=*)')
-
-pickle.dump(l1,open(temp_file_name,'wb'))
-
-l2 = pickle.load(open(temp_file_name,'rb'))
-l2.search_s('',ldap.SCOPE_BASE,'(objectClass=*)')

+ 0 - 3
desktop/core/ext-py/python-ldap-2.3.11/Demo/pyasn1/README

@@ -1,3 +0,0 @@
-The sample scripts herein require module pyasn1.
-
-See http://pyasn1.sourceforge.net/

+ 0 - 58
desktop/core/ext-py/python-ldap-2.3.11/Demo/pyasn1/prereadcontrol.py

@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-"""
-This sample script demonstrates the use of the pre-read control (see RFC 4527).
-
-Originally contributed by Andreas Hasenack <ahasenack@terra.com.br>
-
-Requires module pyasn1 (see http://pyasn1.sourceforge.net/)
-"""
-
-import ldap
-from pyasn1.type import univ
-from pyasn1.codec.der import encoder
-from ldap.controls import LDAPControl
-
-class LDAPString(univ.OctetString): pass
-
-class AttributeSelection(univ.SequenceOf):
-    componentType = LDAPString("")
-
-class PreReadControl(LDAPControl):
-  """
-  Pre-Read LDAP Control
-
-  see RFC 4527
-  """
-
-  controlType = ldap.LDAP_CONTROL_PRE_READ
-
-  def __init__(self, criticality, controlValue=None,encodedControlValue=None):
-    LDAPControl.__init__(self, self.controlType, criticality, controlValue, encodedControlValue)
-
-  def encodeControlValue(self, value):
-    attributeSelection = AttributeSelection()
-    for i in range(len(value)):
-      attributeSelection.setComponentByPosition(i, value[i])
-    res = encoder.encode(attributeSelection)
-    return res
-
-  def decodeControlValue(self, value):
-    # XXX
-    return repr(value)
-
-
-uri = "ldap://localhost:389"
-base = "dc=example,dc=com"
-scope = ldap.SCOPE_SUBTREE
-filter = "(objectClass=sambaUnixIdPool)"
-
-ld = ldap.initialize(uri)
-ld.protocol_version = ldap.VERSION3
-ld.bind_s("uid=LDAP Admin,ou=System Accounts,dc=example,dc=com", "ldapadmin")
-
-pr = PreReadControl(criticality=True, controlValue=['uidNumber','gidNumber'])
-modlist = [(ldap.MOD_INCREMENT, "uidNumber", "1"),(ldap.MOD_INCREMENT, "gidNumber", "1")]
-msg = ld.modify_ext("cn=unixIdPool,dc=example,dc=com", modlist, serverctrls = [pr])
-
-res = ld.result3(msgid = msg, timeout = -1)
-print "res:", res

+ 0 - 24
desktop/core/ext-py/python-ldap-2.3.11/Demo/reconnect.py

@@ -1,24 +0,0 @@
-import sys,time,ldap,ldap.ldapobject,ldapurl
-
-from ldap.ldapobject import *
-
-ldap_url = ldapurl.LDAPUrl(sys.argv[1])
-ldap_url.applyDefaults({
-  'who':'',
-  'cred':'',
-  'filterstr':'(objectClass=*)',
-  'scope':ldap.SCOPE_BASE
-})
-
-ldap.trace_level=1
-
-l = ldap.ldapobject.ReconnectLDAPObject(
-  ldap_url.initializeUrl(),trace_level=ldap.trace_level
-)
-l.protocol_version = ldap.VERSION3
-
-l.simple_bind_s(ldap_url.who,ldap_url.cred)
-
-while 1:
-  l.search_s(ldap_url.dn,ldap_url.scope,ldap_url.filterstr,ldap_url.attrs)
-  sys.stdin.readline()

+ 0 - 52
desktop/core/ext-py/python-ldap-2.3.11/Demo/rename.py

@@ -1,52 +0,0 @@
-import ldap
-from getpass import getpass
-
-# Create LDAPObject instance
-l = ldap.initialize('ldap://localhost:1389',trace_level=1)
-
-print 'Password:'
-cred = getpass()
-
-try:
-
-  # Set LDAP protocol version used
-  l.set_option(ldap.OPT_PROTOCOL_VERSION,3)
-
-  # Try a bind to provoke failure if protocol version is not supported
-  l.bind_s('cn=root,dc=stroeder,dc=com',cred,ldap.AUTH_SIMPLE)
-
-  print 'Using rename_s():'
-
-  l.rename_s(
-    'uid=fred,ou=Unstructured testing tree,dc=stroeder,dc=com',
-    'cn=Fred Feuerstein',
-    'dc=stroeder,dc=com',
-    0
-  )
-
-  l.rename_s(
-    'cn=Fred Feuerstein,dc=stroeder,dc=com',
-    'uid=fred',
-    'ou=Unstructured testing tree,dc=stroeder,dc=com',
-    0
-  )
-
-  m = l.rename(
-    'uid=fred,ou=Unstructured testing tree,dc=stroeder,dc=com',
-    'cn=Fred Feuerstein',
-    'dc=stroeder,dc=com',
-    0
-  )
-  r = l.result(m,1)
-
-  m = l.rename(
-    'cn=Fred Feuerstein,dc=stroeder,dc=com',
-    'uid=fred',
-    'ou=Unstructured testing tree,dc=stroeder,dc=com',
-    0
-  )
-  r = l.result(m,1)
-
-finally:
-
-  l.unbind_s()

+ 0 - 26
desktop/core/ext-py/python-ldap-2.3.11/Demo/resiter.py

@@ -1,26 +0,0 @@
-"""
-Demo for using ldap.resiter.ResultProcessor
-written by Michael Stroeder <michael@stroeder.com>
-
-See http://python-ldap.sourceforge.net for details.
-
-\$Id: resiter.py,v 1.1 2005/11/07 11:24:25 stroeder Exp $
-
-Python compability note:
-Requires Python 2.3+
-"""
-
-import ldap,ldap.resiter
-
-class LDAPObject(ldap.ldapobject.LDAPObject,ldap.resiter.ResultProcessor):
-  pass
-
-l = LDAPObject('ldap://localhost:1390',trace_level=1)
-l.protocol_version = 3
-msgid = l.search('dc=stroeder,dc=de',ldap.SCOPE_SUBTREE,'(cn=m*)')
-
-result_iter = l.allresults(msgid)
-for result_type,result_list,result_msgid,result_serverctrls in result_iter:
-  print result_type,result_list,result_msgid,result_serverctrls
-
-l.unbind_s()

+ 0 - 84
desktop/core/ext-py/python-ldap-2.3.11/Demo/sasl_bind.py

@@ -1,84 +0,0 @@
-# For documentation, see comments in Module/LDAPObject.c and the
-# ldap.sasl module documentation.
-
-import ldap,ldap.sasl
-
-ldap.sasl._trace_level=0
-
-ldap.set_option(ldap.OPT_DEBUG_LEVEL,0)
-
-for ldap_uri,sasl_mech,sasl_cb_value_dict in [
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'CRAM-MD5',
-    {
-      ldap.sasl.CB_AUTHNAME    :'fred',
-      ldap.sasl.CB_PASS        :'secret',
-    }
-  ),
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'PLAIN',
-    {
-      ldap.sasl.CB_AUTHNAME    :'fred',
-      ldap.sasl.CB_PASS        :'secret',
-    }
-  ),
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'LOGIN',
-    {
-      ldap.sasl.CB_AUTHNAME    :'fred',
-      ldap.sasl.CB_PASS        :'secret',
-    }
-  ),
-  (
-    "ldapi://%2Ftmp%2Fopenldap-socket/",
-    'EXTERNAL',
-    { }
-  ),
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'GSSAPI',
-    { }
-  ),
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'NTLM',
-    {
-      ldap.sasl.CB_AUTHNAME    :'fred',
-      ldap.sasl.CB_PASS        :'secret',
-    }
-  ),
-  (
-    "ldap://nb2.stroeder.local:1390/",
-    'DIGEST-MD5',
-    {
-      ldap.sasl.CB_AUTHNAME    :'fred',
-      ldap.sasl.CB_PASS        :'secret',
-    }
-  ),
-]:
-  sasl_auth = ldap.sasl.sasl(sasl_cb_value_dict,sasl_mech)
-  print 20*'*',sasl_auth.mech,20*'*'
-  # Open the LDAP connection
-  l = ldap.initialize(ldap_uri,trace_level=0)
-  # Set protocol version to LDAPv3 to enable SASL bind!
-  l.protocol_version = 3
-  try:
-    l.sasl_interactive_bind_s("", sasl_auth)
-  except ldap.LDAPError,e:
-    print 'Error using SASL mechanism',sasl_auth.mech,str(e)
-  else:
-    print 'Sucessfully bound using SASL mechanism:',sasl_auth.mech
-    try:
-      print 'Result of Who Am I? ext. op:',repr(l.whoami_s())
-    except ldap.LDAPError,e:
-      print 'Error using SASL mechanism',sasl_auth.mech,str(e)
-    try:
-      print 'OPT_X_SASL_USERNAME',repr(l.get_option(ldap.OPT_X_SASL_USERNAME))
-    except AttributeError:
-      pass
-
-  l.unbind()
-  del l

+ 0 - 61
desktop/core/ext-py/python-ldap-2.3.11/Demo/schema.py

@@ -1,61 +0,0 @@
-import sys,ldap,ldap.schema
-
-schema_attrs = ldap.schema.SCHEMA_ATTRS
-
-ldap.set_option(ldap.OPT_DEBUG_LEVEL,0)
-
-ldap._trace_level = 0
-
-subschemasubentry_dn,schema = ldap.schema.urlfetch(sys.argv[-1])
-
-schema_reverse = ldap.schema.SubSchema(schema.ldap_entry())
-
-if subschemasubentry_dn is None:
-  print 'No sub schema sub entry found!'
-  sys.exit(1)
-
-print '*** Schema from',repr(subschemasubentry_dn)
-
-# Display schema
-for attr_type,schema_class in ldap.schema.SCHEMA_CLASS_MAPPING.items():
-  print '*'*20,attr_type,'*'*20
-  for element_id in schema.listall(schema_class):
-    se_orig = schema.get_obj(schema_class,element_id)
-    se_reverse = schema_reverse.get_obj(schema_class,element_id)
-#    assert str(se_orig)==str(se_reverse)
-    print attr_type,str(se_orig)
-print '*** Testing object class inetOrgPerson ***'
-
-inetOrgPerson = schema.get_obj(ldap.schema.ObjectClass,'inetOrgPerson')
-if not inetOrgPerson is None:
-  print inetOrgPerson.must,inetOrgPerson.may
-
-print '*** person,organizationalPerson,inetOrgPerson ***'
-try:
-  print schema.attribute_types(
-    ['person','organizationalPerson','inetOrgPerson']
-  )
-  print schema.attribute_types(
-    ['person','organizationalPerson','inetOrgPerson'],
-    attr_type_filter = [
-      ('no_user_mod',[0]),
-      ('usage',range(2)),
-    ]  
-  )
-except KeyError,e:
-  print '***KeyError',str(e)
-
-drink = schema.get_obj(ldap.schema.AttributeType,'favouriteDrink')
-if not drink is None:
-  print '*** drink ***'
-  print 'drink.names',repr(drink.names)
-  print 'drink.collective',repr(drink.collective)
-
-
-schema.ldap_entry()
-
-print str(schema.get_obj(ldap.schema.MatchingRule,'2.5.13.0'))
-print str(schema.get_obj(ldap.schema.MatchingRuleUse,'2.5.13.0'))
-
-print str(schema.get_obj(ldap.schema.AttributeType,'name'))
-print str(schema.get_inheritedobj(ldap.schema.AttributeType,'cn',['syntax','equality','substr','ordering']))

+ 0 - 100
desktop/core/ext-py/python-ldap-2.3.11/Demo/schema_tree.py

@@ -1,100 +0,0 @@
-"""
-Outputs the object class tree read from LDAPv3 schema
-of a given server
-
-Usage: schema_oc_tree.py [--html] [LDAP URL]
-"""
-
-import sys,getopt,ldap,ldap.schema
-
-
-ldap.trace_level = 1
-
-def PrintSchemaTree(schema,se_class,se_tree,se_oid,level):
-  """ASCII text output for console"""
-  se_obj = schema.get_obj(se_class,se_oid)
-  if se_obj!=None:
-    print '|    '*(level-1)+'+---'*(level>0), \
-          ', '.join(se_obj.names), \
-          '(%s)' % se_obj.oid
-  for sub_se_oid in se_tree[se_oid]:
-    print '|    '*(level+1)
-    PrintSchemaTree(schema,se_class,se_tree,sub_se_oid,level+1)
-
-
-def HTMLSchemaTree(schema,se_class,se_tree,se_oid,level):
-  """HTML output for browser"""
-  se_obj = schema.get_obj(se_class,se_oid)
-  if se_obj!=None:
-    print """
-    <dt><strong>%s (%s)</strong></dt>
-    <dd>
-      %s
-    """ % (', '.join(se_obj.names),se_obj.oid,se_obj.desc)
-  if se_tree[se_oid]:
-    print '<dl>'
-    for sub_se_oid in se_tree[se_oid]:
-      HTMLSchemaTree(schema,se_class,se_tree,sub_se_oid,level+1)
-    print '</dl>'
-  print '</dd>'
-
-
-ldap.set_option(ldap.OPT_DEBUG_LEVEL,0)
-
-ldap._trace_level = 0
-
-subschemasubentry_dn,schema = ldap.schema.urlfetch(sys.argv[-1],ldap.trace_level)
-
-if subschemasubentry_dn is None:
-  print 'No sub schema sub entry found!'
-  sys.exit(1)
-
-try:
-  options,args=getopt.getopt(sys.argv[1:],'',['html'])
-except getopt.error,e:
-  print 'Error: %s\nUsage: schema_oc_tree.py [--html] [LDAP URL]'
-
-html_output = options and options[0][0]=='--html'
-
-oc_tree = schema.tree(ldap.schema.ObjectClass)
-at_tree = schema.tree(ldap.schema.AttributeType)
-
-#for k,v in oc_tree.items():
-#  print k,'->',v
-#for k,v in at_tree.items():
-#  print k,'->',v
-
-if html_output:
-
-  print """<html>
-<head>
-  <title>Object class tree</title>
-</head>
-<body bgcolor="#ffffff">
-<h1>Object class tree</h1>
-<dl>
-"""
-  HTMLSchemaTree(schema,ldap.schema.ObjectClass,oc_tree,'2.5.6.0',0)
-  print """</dl>
-<h1>Attribute type tree</h1>
-<dl>
-"""
-  for a in schema.listall(ldap.schema.AttributeType):
-    if at_tree[a]:
-      HTMLSchemaTree(schema,ldap.schema.AttributeType,at_tree,a,0)
-      print
-
-  print """</dl>
-</body>
-</html>
-"""
-
-else:
-
-  print '*** Object class tree ***\n'
-  print
-  PrintSchemaTree(schema,ldap.schema.ObjectClass,oc_tree,'2.5.6.0',0)
-
-  print '\n*** Attribute types tree ***\n'
-  PrintSchemaTree(schema,ldap.schema.AttributeType,at_tree,'_',0)
-

+ 0 - 106
desktop/core/ext-py/python-ldap-2.3.11/Demo/simple.py

@@ -1,106 +0,0 @@
-import sys,getpass
-import ldap
-
-#l = ldap.open("localhost", 31001)
-l = ldap.open("marta.it.uq.edu.au")
-
-login_dn = "cn=root,ou=CSEE,o=UQ,c=AU"
-login_pw = getpass.getpass("Password for %s: " % login_dn)
-l.simple_bind_s(login_dn, login_pw)
-
-#
-# create a new sub organisation
-#
-
-try:
-    dn = "ou=CSEE,o=UQ,c=AU"
-    print "Adding", repr(dn)
-    l.add_s(dn,
-	 [
-	    ("objectclass",["organizationalUnit"]),
-	    ("ou", ["CSEE"]),
-	    ("description", [
-		    "Department of Computer Science and Electrical Engineering"]),
-	 ]
-       )
-
-except _ldap.LDAPError:
-    pass
-
-#
-# create an entry for me
-#
-
-dn = "cn=David Leonard,ou=CSEE,o=UQ,c=AU"
-print "Updating", repr(dn)
-
-try:
-	l.delete_s(dn)
-except:
-	pass
-
-l.add_s(dn,
-     [
-	("objectclass",			["organizationalPerson"]),
-	("sn",				["Leonard"]),
-	("cn",				["David Leonard"]),
-	("description",			["Ph.D. student"]),
-	("display-name",		["David Leonard"]),
-	#("commonname",			["David Leonard"]),
-	("mail",			["david.leonard@csee.uq.edu.au"]),
-	("othermailbox",		["d@openbsd.org"]),
-	("givenname",			["David"]),
-	("surname",			["Leonard"]),
-	("seeAlso",			["http://www.csee.uq.edu.au/~leonard/"]),
-	("url",				["http://www.csee.uq.edu.au/~leonard/"]),
-	#("homephone",			[]),
-	#("fax",			[]),
-	#("otherfacsimiletelephonenumber",[]),
-	#("officefax",			[]),
-	#("mobile",			[]),
-	#("otherpager",			[]),
-	#("officepager",		[]),
-	#("pager",			[]),
-	("info",			["info"]),
-	("title",			["Mr"]),
-	#("telephonenumber",		[]),
-	("l",				["Brisbane"]),
-	("st",				["Queensland"]),
-	("c",				["AU"]),
-	("co",				["co"]),
-	("o",				["UQ"]),
-	("ou",				["CSEE"]),
-	#("homepostaladdress",		[]),
-	#("postaladdress",		[]),
-	#("streetaddress",		[]),
-	#("street",			[]),
-	("department",			["CSEE"]),
-	("comment",			["comment"]),
-	#("postalcode",			[]),
-	("physicaldeliveryofficename",  ["Bldg 78, UQ, St Lucia"]),
-	("preferredDeliveryMethod",	["email"]),
-	("initials",			["DRL"]),
-	("conferenceinformation",	["MS-conferenceinformation"]),
-	#("usercertificate",		[]),
-	("labeleduri",			["labeleduri"]),
-	("manager",			["cn=Jaga Indulska"]),
-	("reports",			["reports"]),
-	("jpegPhoto",			[open("/www/leonard/leonard.jpg","r").read()]),
-	("uid",				["leonard"]),
-	("userPassword",		[""])
-
-    ])
-
-#
-# search beneath the CSEE/UQ/AU tree
-#
-
-res = l.search_s(
-	"ou=CSEE, o=UQ, c=AU", 
-	_ldap.SCOPE_SUBTREE, 
-	"objectclass=*",
-      )
-print res
-
-l.unbind()
-

+ 0 - 128
desktop/core/ext-py/python-ldap-2.3.11/Demo/simplebrowse.py

@@ -1,128 +0,0 @@
-#! python
-
-#
-# simple LDAP server browsing example
-#
-
-import ldap
-import string
-from traceback import print_exc
-
-url = "ldap://ldap.openldap.org/"
-dn = "dc=openldap,dc=org"
-
-print "Connecting to", url
-
-l = ldap.initialize(url)
-l.bind_s("", "", ldap.AUTH_SIMPLE);
-
-lastdn = dn
-dnlist = None
-
-while 1:
-
-    #-- read a command
-    try:
-        cmd = raw_input(dn + "> ")
-    except EOFError:
-	print
-	break
-
-    try:
-
-	if cmd == "?":
-		print  "cd <dn>	- change DN to <dn>"
-		print  "cd <n>	- change DN to number <n> of last 'ls'"
-		print  "cd -	- change to previous DN"
-		print  "cd ..	- change to one-level higher DN"
-		print  "cd 	- change to root DN"
-		print  "ls	- list children of crrent DN"
-		print  ".	- show attributes of current DN"
-		print  "/<expr>	- list descendents matching filter <expr>"
-		print  "?	- show this help"
-
-	elif cmd == "ls":
-		print "Children of", `dn`, ":"
-		dnlist = []
-		#
-		# List the children at one level down from the current dn
-		# We use the filter 'objectclass=*' to match everything.
-		# We're not interested in attributes at this stage, so
-		# we specify [] as the list of attribute names to retreive.
-		#
-		for name,attrs in l.search_s(dn, ldap.SCOPE_ONELEVEL, 
-		    "objectclass=*", []):
-			#-- shorten resulting dns for output brevity
-			if name.startswith(dn+", "):
-				shortname = "+ "+name[len(dn)+2:]
-			elif name.endswith(", "+dn):
-				shortname = name[:-len(dn)-2]+" +"
-			else:
-				shortname = name
-			print " %3d. %s" % (len(dnlist), shortname)
-			dnlist.append(name)
-
-	elif cmd == "cd":
-		dn = ""
-		dnlist = None
-
-	elif cmd.startswith("cd "):
-		arg = cmd[3:]
-		if arg == '-':
-			lastdn,dn = dn,lastdn
-		elif arg == '..':
-			dn = string.join(ldap.explode_dn(dn)[1:], ",")
-			dn = string.strip(dn)
-                else:
-		        try:
-			        i = int(arg)
-		        except:
-			        godn = arg
-                        else:
-			        if dnlist is None:
-				        print "do an ls first"
-                                else:
-			                godn = dnlist[i]
-		                lastdn = dn
-		                dn = godn
-
-	elif cmd == ".":
-		#
-		# Retrieve all the attributes for the current dn.
-		# We construct a search using SCOPE_BASE (ie just the
-		# given DN) and again filter with "objectclass=*".
-		# No attributes are listed, so the default is for
-		# the client to receive all attributes on the DN.
-		#
-		print "Attributes of", `dn`, ":"
-		for name,attrs in l.search_s(dn, ldap.SCOPE_BASE,
-		    "objectclass=*"):
-			print "  %-24s" % name
-			for k,vals in attrs.items():
-			    for v in vals:
-				if len(v) > 200: 
-					v = `v[:200]` + \
-						("... (%d bytes)" % len(v))
-				else:
-					v = `v`
-				print "      %-12s: %s" % (k, v)
-
-	elif cmd.startswith("/"):
-		#
-		# Search descendent objects to match a given filter.
-		# We use SCOPE_SUBTREE to indicate descendents, and
-		# again specify an empty attribute list to indicate
-		# that we're not interested in them.
-		#
-		expr = cmd[1:]
-		print "Descendents matching filter", `expr`, ":"
-		for name,attrs in l.search_s(dn, ldap.SCOPE_SUBTREE,
-		    expr, []):
-			print "  %24s", name
-
-	else:
-		print "unknown command - try '?' for help"
-
-    except:
-	print_exc()
-

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Doc/.cvsignore

@@ -1,4 +0,0 @@
-python-ldap.pdf
-python-ldap.ps
-*.bck
-*~

+ 0 - 68
desktop/core/ext-py/python-ldap-2.3.11/Doc/Makefile

@@ -1,68 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-PAPER         =
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d .build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html web htmlhelp latex changes linkcheck
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html      to make standalone HTML files"
-	@echo "  web       to make files usable by Sphinx.web"
-	@echo "  htmlhelp  to make HTML files and a HTML help project"
-	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  changes   to make an overview over all changed/added/deprecated items"
-	@echo "  linkcheck to check all external links for integrity"
-
-clean:
-	-rm -rf .build/*
-
-html:
-	mkdir -p .build/html .build/doctrees
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) .build/html
-	@echo
-	@echo "Build finished. The HTML pages are in .build/html."
-
-web:
-	mkdir -p .build/web .build/doctrees
-	$(SPHINXBUILD) -b web $(ALLSPHINXOPTS) .build/web
-	@echo
-	@echo "Build finished; now you can run"
-	@echo "  python -m sphinx.web .build/web"
-	@echo "to start the server."
-
-htmlhelp:
-	mkdir -p .build/htmlhelp .build/doctrees
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) .build/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in .build/htmlhelp."
-
-latex:
-	mkdir -p .build/latex .build/doctrees
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) .build/latex
-	@echo
-	@echo "Build finished; the LaTeX files are in .build/latex."
-	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
-	      "run these through (pdf)latex."
-
-changes:
-	mkdir -p .build/changes .build/doctrees
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) .build/changes
-	@echo
-	@echo "The overview file is in .build/changes."
-
-linkcheck:
-	mkdir -p .build/linkcheck .build/doctrees
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) .build/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in .build/linkcheck/output.txt."

+ 0 - 133
desktop/core/ext-py/python-ldap-2.3.11/Doc/conf.py

@@ -1,133 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# python-ldap documentation build configuration file, created by
-# sphinx-quickstart on Sat Mar 29 15:08:17 2008.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# The contents of this file are pickled, so don't put values in the namespace
-# that aren't pickleable (module imports are okay, they're removed automatically).
-#
-# All configuration values have a default value; values that are commented out
-# serve to show the default value.
-
-import sys
-
-# If your extensions are in another directory, add it here.
-#sys.path.append('some/directory')
-
-# General configuration
-# ---------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['.templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General substitutions.
-project = 'python-ldap'
-copyright = '2008, python-ldap project team'
-
-# The default replacements for |version| and |release|, also used in various
-# other places throughout the built documents.
-#
-# The short X.Y version.
-version = '2.3'
-# The full version, including alpha/beta/rc tags.
-release = '2.3.11.0'
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-today_fmt = '%B %d, %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-
-# Options for HTML output
-# -----------------------
-
-# The style sheet to use for HTML and HTML Help pages. A file of that name
-# must exist either in Sphinx' static/ path, or in one of the custom paths
-# given in html_static_path.
-html_style = 'default.css'
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['.static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Content template for the index page.
-#html_index = ''
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-html_use_modindex = True
-
-# If true, the reST sources are included in the HTML build as _sources/<name>.
-#html_copy_source = True
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'python-ldap-doc'
-
-
-# Options for LaTeX output
-# ------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, document class [howto/manual]).
-latex_documents = [('index', 'python-ldap.tex', 'python-ldap Documentation',
-                    'python-ldap project', 'manual')]
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-latex_use_modindex = True

+ 0 - 44
desktop/core/ext-py/python-ldap-2.3.11/Doc/index.rst

@@ -1,44 +0,0 @@
-.. python-ldap documentation master file, created by sphinx-quickstart on Sat Mar 29 15:08:17 2008.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-##########################
-python-ldap Documentation  
-##########################
-
-.. % $Id: index.rst,v 1.4 2009/10/24 19:31:57 stroeder Exp $
-
-.. topic:: Abstract
-
-   This document describes the package python-ldap with its various modules.  This
-   manual assumes basic knowledge about the Python language and the LDAP standard.
-
-
-********
-Contents
-********
-
-
-.. toctree::
-   :maxdepth: 3 
-
-   installing.rst
-   ldap.rst
-   ldap-async.rst
-   ldap-resiter.rst
-   ldap-controls.rst
-   ldap-dn.rst
-   ldap-filter.rst
-   ldap-modlist.rst
-   ldap-schema.rst
-   ldif.rst
-   ldapurl.rst
-
-******************
-Indices and tables
-******************
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-

+ 0 - 90
desktop/core/ext-py/python-ldap-2.3.11/Doc/installing.rst

@@ -1,90 +0,0 @@
-.. % $Id: ldap-dn.tex,v 1.8 2008/03/26 12:10:12 stroeder Exp 
-
-***********************
-Building and installing
-***********************
-
-Prerequisites
-=============
-
-The following software packages are required to be installed
-on the local system when building python-ldap:
-
-- Python version 2.3 or later including its development files: http://www.python.org/
-- OpenLDAP client libs version 2.3 or later: http://www.openldap.org/
-  It is not possible and not supported to build with prior versions.
-- OpenSSL (optional): http://www.openssl.org/
-- cyrus-sasl (optional): http://asg.web.cmu.edu/sasl/sasl-library.html
-- Kerberos libs, MIT or heimdal (optional)
-
-setup.cfg
-=========
-
-The file setup.cfg allows to set some build and installation
-parameters for reflecting the local installation of required
-software packages. Only section [_ldap] is described here.
-More information about other sections can be found in the
-documentation of Python's DistUtils.
-
-.. data:: library_dirs
-
-   Specifies in which directories to search for required libraries.
-
-.. data:: include_dirs
-
-   Specifies in which directories to search for include files of required libraries.
-
-.. data:: libs
-
-   A space-separated list of library names to link to (see :ref:`libs-used-label`).
-
-.. data:: extra_compile_args
-
-   Compiler options.
-
-.. data:: extra_objects
-
-.. _libs-used-label:
-
-Libs used
----------
-
-.. data:: ldap
-.. data:: ldap_r
-
-   The LDAP protocol library of OpenLDAP. ldap_r is the reentrant version
-   and should be preferred.
-
-.. data:: lber
-
-   The BER encoder/decoder library of OpenLDAP.
-
-.. data:: sasl2
-
-   The Cyrus-SASL library if needed and present during build
-
-.. data:: ssl
-
-   The SSL/TLS library of OpenSSL if needed and present during build
-
-.. data:: crypto
-
-   The basic cryptographic library of OpenSSL if needed and present during build
-
-Example
-=============
-
-The following example is for a full-featured build (including SSL and SASL support)
-of python-ldap with OpenLDAP installed in a different prefix directory
-(here /opt/openldap-2.3) and SASL header files found in /usr/include/sasl.
-Debugging symbols are preserved with compile option -g. ::
-
-  [_ldap]
-  library_dirs = /opt/openldap-2.3/lib
-  include_dirs = /opt/openldap-2.3/include /usr/include/sasl
-
-  extra_compile_args = -g
-  extra_objects =
-
-  libs = ldap_r lber sasl2 ssl crypto
-

+ 0 - 89
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-async.rst

@@ -1,89 +0,0 @@
-.. % $Id: ldap-async.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.async` Framework for stream-processing of large search results
-==============================================================================
-
-.. module:: ldap.async
-   :synopsis: Framework for stream-processing of large search results.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-.. % Author of the module code;
-
-
-.. _ldap.async-example:
-
-Examples for ldap.async
-------------------------
-
-.. _ldap.async-example.List:
-
-Using ldap.async.List
-^^^^^^^^^^^^^^^^^^^^^^
-
-This example demonstrates how to use class ldap.async.List for
-retrieving partial search results even though the exception
-:exc:`ldap.SIZELIMIT_EXCEEDED` was raised because a server side limit was hit. ::
-
-   import sys,ldap,ldap.async
-
-   s = ldap.async.List(
-     ldap.initialize('ldap://localhost'),
-   )
-
-   s.startSearch(
-     'dc=stroeder,dc=com',
-     ldap.SCOPE_SUBTREE,
-     '(objectClass=*)',
-   )
-
-   try:
-     partial = s.processResults()
-   except ldap.SIZELIMIT_EXCEEDED:
-     sys.stderr.write('Warning: Server-side size limit exceeded.\n')
-   else:
-     if partial:
-       sys.stderr.write('Warning: Only partial results received.\n')
-
-   sys.stdout.write(
-     '%d results received.\n' % (
-       len(s.allResults)
-     )
-   )
-
-.. _ldap.async-example.LDIFWriter:
-
-Using ldap.async.LDIFWriter
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This example demonstrates how to use class ldap.async.LDIFWriter
-for writing search results as LDIF to stdout. ::
-
-   import sys,ldap,ldap.async
-
-   s = ldap.async.LDIFWriter(
-     ldap.initialize('ldap://localhost:1390'),
-     sys.stdout
-   )
-
-   s.startSearch(
-     'dc=stroeder,dc=com',
-     ldap.SCOPE_SUBTREE,
-     '(objectClass=*)',
-   )
-
-   try:
-     partial = s.processResults()
-   except ldap.SIZELIMIT_EXCEEDED:
-     sys.stderr.write('Warning: Server-side size limit exceeded.\n')
-   else:
-     if partial:
-       sys.stderr.write('Warning: Only partial results received.\n')
-
-   sys.stderr.write(
-     '%d results received.\n' % (
-       s.endResultBreak-s.beginResultsDropped
-     )
-   )
-

+ 0 - 83
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-controls.rst

@@ -1,83 +0,0 @@
-.. % $Id: ldap-controls.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.controls` High-level access to LDAP controls
-============================================================
-
-.. module:: ldap.controls
-   :synopsis: High-level access to LDAP controls.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-The :mod:`ldap.controls` module defines the following classes:
-
-.. % Author of the module code;
-
-
-.. class:: LDAPControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
-
-   Base class for all LDAP controls. This class should not be used directly,
-   instead one of the following subclasses should be used as appropriate.
-
-
-   .. method:: LDAPControl.encodeControlValue(value)
-
-      Dummy method to be overridden by subclasses.
-
-
-   .. method:: LDAPControl.decodeControlValue(value)
-
-      Dummy method to be overridden by subclasses.
-
-
-   .. method:: LDAPControl.getEncodedTuple()
-
-      Return a readily encoded 3-tuple which can be directly  passed to C module
-      _ldap. This method is called by  function :func:`ldap.EncodeControlTuples`.
-
-
-.. class:: BooleanControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
-
-   Base class for simple controls with booelan control value.    In this base class
-   *controlValue* has to be passed as  boolean type (:const:`True`/:const:`False`
-   or :const:`1`/:const:`0`).
-
-
-.. class:: SimplePagedResultsControl(controlType, criticality [, controlValue=:const:`None` [, encodedControlValue=:const:`None`]])
-
-   The class provides the LDAP Control Extension for Simple Paged Results
-   Manipulation. *controlType* is ignored  in favor of
-   :const:`ldap.LDAP_CONTROL_PAGE_OID`.
-
-
-   .. seealso::
-
-      :rfc:`2696` - LDAP Control Extension for Simple Paged Results Manipulation
-
-.. class:: MatchedValuesControl(criticality [, controlValue=:const:`None`])
-
-   This class provides the LDAP Matched Values control. *controlValue* is an LDAP
-   filter.
-
-
-   .. seealso::
-
-      :rfc:`3876` - Returning Matched Values with the Lightweight Directory Access Protocol version 3 (LDAPv3)
-
-The :mod:`ldap.controls` module defines the following functions:
-
-
-.. function:: EncodeControlTuples(ldapControls)
-
-   Returns list of readily encoded 3-tuples which can be directly  passed to C
-   module _ldap.
-
-   .. % -> list
-
-
-.. function:: DecodeControlTuples(ldapControlTuples)
-
-   Decodes a list of readily encoded 3-tuples as returned by the C module _ldap.
-
-   .. % -> list
-

+ 0 - 106
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-dn.rst

@@ -1,106 +0,0 @@
-.. % $Id: ldap-dn.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.dn` LDAP Distinguished Name handling
-====================================================
-
-.. module:: ldap.dn
-   :synopsis: LDAP Distinguished Name handling.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-.. % Author of the module code;
-
-
-.. seealso::
-
-   For LDAPv3 DN syntax see:
-
-   :rfc:`4514` - Lightweight Directory Access Protocol (LDAP): String Representation of Distinguished Names
-   For LDAPv2 DN syntax (obsoleted by LDAPv3) see:
-
-   :rfc:`1779` - A String Representation of Distinguished Names
-
-The :mod:`ldap.dn` module defines the following functions:
-
-
-.. function:: escape_dn_chars(s)
-
-   This function escapes characters in string *s* which  are special in LDAP
-   distinguished names. You should use  this function when building LDAP DN strings
-   from arbitrary input.
-
-   .. % -> string
-
-
-.. function:: str2dn(s [, flags=:const:`0`])
-
-   This function takes *s* and breaks it up into its component parts  down to AVA
-   level. The optional parameter *flags* describes the DN format of s  (see
-   :ref:`ldap-dn-flags`).
-
-   .. % -> list
-
-
-.. function:: dn2str(dn)
-
-   This function takes a decomposed DN in *dn* and returns  a single string. It's
-   the inverse to :func:`str2dn`.  Special characters are escaped with the help of
-   function :func:`escape_dn_chars`.
-
-   .. % -> string
-
-
-.. function:: explode_dn(dn [, notypes=:const:`0` [, flags=:const:`0`]])
-
-   This function takes *dn* and breaks it up into its component parts.   Each part
-   is known as an RDN (Relative Distinguished Name). The optional  *notypes*
-   parameter is used to specify that only the RDN values be   returned and not
-   their types. The optional parameter *flags*  describes the DN format of s (see
-   :ref:`ldap-dn-flags`).    This function is emulated by function
-   :func:`str2dn`  since the function ldap_explode_dn() in the C library is
-   deprecated.
-
-   .. % -> list
-
-
-.. function:: explode_rdn(rdn [, notypes=:const:`0` [, flags=:const:`0`]])
-
-   This function takes a (multi-valued) *rdn* and breaks it up  into a list of
-   characteristic attributes. The optional  *notypes* parameter is used to specify
-   that only the RDN values be   returned and not their types. The optional *flags*
-   parameter  describes the DN format of s (see :ref:`ldap-dn-flags`).    This
-   function is emulated by function :func:`str2dn`  since the function
-   ldap_explode_rdn() in the C library is deprecated.
-
-   .. % -> list
-
-
-.. _ldap-dn-example:
-
-Examples
-^^^^^^^^^
-
-Splitting a LDAPv3 DN to AVA level:
-
->>> ldap.dn.str2dn('cn=Michael Str\xc3\xb6der,dc=stroeder,dc=com',flags=ldap.DN_FORMAT_LDAPV3)
-[[('cn', 'Michael Str\xc3\xb6der', 4)], [('dc', 'stroeder', 1)], [('dc', 'com', 1)]]
-
-
-Splitting a LDAPv2 DN into RDN parts:
-
->>> ldap.dn.explode_dn('cn=Michael Stroeder;dc=stroeder;dc=com',flags=ldap.DN_FORMAT_LDAPV2)
-['cn=Michael Stroeder', 'dc=stroeder', 'dc=com']
-
-
-Splitting a multi-valued RDN:
-
->>> ldap.dn.explode_rdn('cn=Michael Stroeder+mail=michael@stroeder.com',flags=ldap.DN_FORMAT_LDAPV2)
-['cn=Michael Stroeder', 'mail=michael@stroeder.com']
-
-Splitting a LDAPv3 DN with a multi-valued RDN into its AVA parts:
-
-
->>> ldap.dn.str2dn('cn=Michael Stroeder+mail=michael@stroeder.com,dc=stroeder,dc=com')
-[[('cn', 'Michael Stroeder', 1), ('mail', 'michael@stroeder.com', 1)], [('dc', 'stroeder', 1)], [('dc', 'com', 1)]]
-

+ 0 - 41
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-filter.rst

@@ -1,41 +0,0 @@
-.. % $Id: ldap-filter.rst,v 1.3 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.filter` LDAP filter handling
-============================================
-
-.. module:: ldap.filter
-   :synopsis: LDAP filter handling.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-.. % Author of the module code;
-
-
-.. seealso::
-
-   :rfc:`4515` - Lightweight Directory Access Protocol (LDAP): String Representation of Search Filters.
-
-The :mod:`ldap.filter` module defines the following functions:
-
-
-.. function:: escape_filter_chars(assertion_value[, escape_mode=0])
-
-   This function escapes characters in *assertion_value* which  are special in LDAP
-   filters. You should use this function when  building LDAP filter strings from
-   arbitrary input.    *escape_mode* means:  If :const:`0` only special chars
-   mentioned in RFC 4515 are escaped.  If :const:`1` all NON-ASCII chars are
-   escaped.  If :const:`2` all chars are escaped.
-
-   .. % -> string
-
-
-.. function:: filter_format(filter_template, assertion_values)
-
-   This function applies :func:`escape_filter_chars` to each of the strings in
-   list *assertion_values*. After that *filter_template* containing  as many
-   :const:`%s` placeholders as count of assertion values is  used to build the
-   whole filter string.
-
-   .. % -> string
-

+ 0 - 43
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-modlist.rst

@@ -1,43 +0,0 @@
-.. % $Id: ldap-modlist.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.modlist` Generate modify lists
-==============================================
-
-.. module:: ldap.modlist
-   :synopsis: Generate modify lists.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-The :mod:`ldap.modlist` module defines the following functions:
-
-.. % Author of the module code;
-
-
-.. function:: addModlist(entry [, ignore_attr_types=[]])
-
-   This function builds a list suitable for passing it  directly as argument
-   *modlist* to method :meth:`add` or  its synchronous counterpart :meth:`add_s`.
-   *entry* is a dictionary like returned when  receiving search results.
-
-   .. % -> list
-
-
-.. function:: modifyModlist( old_entry, new_entry [, ignore_attr_types=[] [, ignore_oldexistent=0]])
-
-   This function builds a list suitable for passing it directly as argument
-   *modlist* to method :meth:`modify` or its synchronous counterpart
-   :meth:`modify_s`.  Roughly when applying the resulting modify list to an entry
-   holding  the data *old_entry* it will be modified in such a way that the  entry
-   holds *new_entry* after the modify operation. It is handy in  situations when it
-   is impossible to track user changes to an entry's  data or for synchronizing
-   operations. *old_entry* and *new_entry* are dictionaries  like returned when
-   receiving search results. *ignore_attr_types* is a list of attribute type
-   names which  shall be ignored completely. These attribute types will not appear
-   in the result. If *ignore_oldexistent* is non-zero attribute type names which
-   are in *old_entry* but are not found in *new_entry* at all  are not deleted.
-   This is handy for situations where your application  sets attribute value to "
-   for deleting an attribute.  In most cases leave zero.
-
-   .. % -> list
-

+ 0 - 41
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-resiter.rst

@@ -1,41 +0,0 @@
-.. % $Id: ldap-resiter.rst,v 1.2 2009/10/24 19:32:12 stroeder Exp $
-
-
-:mod:`ldap.resiter` Generator for stream-processing of large search results
-==============================================================================
-
-.. module:: ldap.resiter
-   :synopsis: Generator for stream-processing of large search results.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-.. % Author of the module code;
-
-
-.. _ldap.resiter-example:
-
-Examples for ldap.resiter
--------------------------
-
-.. _ldap.resiter.ResultProcessor-example:
-
-Using ldap.resiter
-^^^^^^^^^^^^^^^^^^
-
-This example demonstrates how to use mix-in class ldap.resiter.ResultProcessor for
-retrieving results and processing them in a for-loop. ::
-
-  import sys,ldap,ldap.resiter
-
-  class MyLDAPObject(ldap.ldapobject.LDAPObject,ldap.resiter.ResultProcessor):
-    pass
-
-  l = MyLDAPObject('ldap://localhost')
-
-  # Asynchronous search method
-  msg_id = l.search('dc=stroeder,dc=com',ldap.SCOPE_SUBTREE,'(objectClass=*)')
-
-  for res_type,res_data,res_msgid,res_controls in self.source.allresults(msg_id):
-    for dn,entry in res_data:
-      # process dn and entry
-      print dn,entry['objectClass']

+ 0 - 21
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap-schema.rst

@@ -1,21 +0,0 @@
-.. % $Id: ldap-schema.rst,v 1.2 2009/04/17 12:14:52 stroeder Exp $
-
-
-:mod:`ldap.schema` Processing LDAPv3 sub schema sub entry
-==============================================================
-
-.. module:: ldap.schema
-   :synopsis: Processing LDAPv3 sub schema sub entry
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-.. % Author of the module code;
-
-.. _ldap.schema-example:
-
-Examples for ldap.schema
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-::
-
-   import ldap.schema

+ 0 - 1196
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldap.rst

@@ -1,1196 +0,0 @@
-.. % $Id: ldap.rst,v 1.16 2010/02/26 08:58:36 stroeder Exp $
-
-*****************************************
-:mod:`ldap` LDAP library interface module
-*****************************************
-
-.. module:: ldap
-   :platform: UNIX,Windows
-   :synopsis: Access to an underlying LDAP C library.
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-This module provides access to the LDAP  (Lightweight Directory Access Protocol)
-C API implemented  in OpenLDAP 2.3 or newer.  It is similar to the C API, with
-the notable differences  that lists are manipulated via Python  list operations
-and errors appear as exceptions.    For far more detailed information on the C
-interface,   please see the (expired) draft-ietf-ldapext-ldap-c-api-04.    This
-documentation is current for the Python LDAP module, version  |release|.  Source
-and binaries are available from http://www.python-ldap.org/.
-
-.. % not standard, in C
-.. % Author of the module code;
-.. % Leave at least one blank line after this, to simplify ad-hoc tools
-.. % that are sometimes used to massage these files.
-.. % ==== 2. ====
-.. % Give a short overview of what the module does.
-.. % If it is platform specific, mention this.
-.. % Mention other important restrictions or general operating principles.
-.. % ==== 3. ====
-.. % List the public functions defined by the module.  Begin with a
-.. % standard phrase.  You may also list the exceptions and other data
-.. % items defined in the module, insofar as they are important for the
-.. % user.
-
-
-Functions
-=========
-
-The :mod:`ldap` module defines the following functions:
-
-.. function:: initialize(uri [, trace_level=0 [, trace_file=sys.stdout [, trace_stack_limit=None]]])
-
-   Opens a new connection with an LDAP server, and return an LDAP object
-   (see :ref:`ldap-objects`) used to perform operations on that server.  Parameter
-   *uri* has to be a valid LDAP URL.
-   The optional arguments are for generating debug log information:
-   *trace_level* specifies the amount of information being logged,
-   *trace_file* specifies a file-like object as target of the debug log and
-   *trace_stack_limit* specifies the stack limit of tracebacks in debug log.
-   Possible values for *trace_level* are
-   :const:`0` for no logging,
-   :const:`1` for only logging the method calls with arguments,
-   :const:`2` for logging the method calls with arguments and the complete results and 
-   :const:`3` for also logging the traceback of method calls.
-
-   .. seealso::
-
-      :rfc:`4516` - Lightweight Directory Access Protocol (LDAP): Uniform Resource Locator
-
-   .. % -> LDAPObject
-
-.. function:: open(host [, port=PORT])
-
-   Opens a new connection with an LDAP server, and return an LDAP object  (see
-   :ref:`ldap-objects`) used to perform operations on that server.  *host* is a
-   string containing solely the host name. *port*  is an integer specifying the
-   port where the LDAP server is  listening (default is 389).  Note: Using this
-   function is deprecated.
-
-   .. % -> LDAPObject
-
-.. % %------------------------------------------------------------
-.. % % get_option
-
-
-.. function:: get_option(option)
-
-   This function returns the value of the global option  specified by *option*.
-
-   .. % -> None
-
-.. % %------------------------------------------------------------
-.. % % set_option
-
-
-.. function:: set_option(option, invalue)
-
-   This function sets the value of the global option  specified by *option* to
-   *invalue*.
-
-   .. % -> None
-
-.. _ldap-constants:
-
-Constants
-=========
-
-The module defines various constants.
-
-General
--------
-
-.. data:: PORT
-
-   The assigned TCP port number (389) that LDAP servers listen on.
-
-.. data:: SASL_AVAIL
-
-   Integer where a non-zero value indicates that python-ldap was built with
-   support for SASL (Cyrus-SASL).
-
-.. data:: TLS_AVAIL
-
-   Integer where a non-zero value indicates that python-ldap was built with
-   support for SSL/TLS (OpenSSL or similar libs).
-
-
-.. _ldap-options:
-
-Options
--------
-
-.. seealso::
-
-   :manpage:`ldap.conf{5}` and :manpage:`ldap_get_options{3}`
-
-
-For use with functions and method set_option() and get_option() the
-following option identifiers are defined as constants:
-
-.. data:: OPT_API_FEATURE_INFO
-
-.. data:: OPT_API_INFO
-
-.. data:: OPT_CLIENT_CONTROLS
-
-.. data:: OPT_DEBUG_LEVEL
-
-   Sets the debug level within the underlying LDAP C lib.
-
-.. data:: OPT_DEREF
-
-   Specifies how alias derefencing is done within the underlying LDAP C lib.
-
-.. data:: OPT_ERROR_STRING
-
-.. data:: OPT_DIAGNOSTIC_MESSAGE
-
-.. data:: OPT_HOST_NAME
-
-.. data:: OPT_MATCHED_DN
-
-.. data:: OPT_NETWORK_TIMEOUT
-
-.. data:: OPT_PROTOCOL_VERSION
-
-   Sets the LDAP protocol version used for a connection. This is mapped to
-   object attribute `ldap.LDAPObject.protocol_version`
-
-.. data:: OPT_REFERRALS
-
-   int specifying whether referrals should be automatically chased within
-   the underlying LDAP C lib.
-
-.. data:: OPT_REFHOPLIMIT
-
-.. data:: OPT_RESTART
-
-.. data:: OPT_SERVER_CONTROLS
-
-.. data:: OPT_SIZELIMIT
-
-.. data:: OPT_SUCCESS
-
-.. data:: OPT_TIMELIMIT
-
-.. data:: OPT_TIMEOUT
-
-.. data:: OPT_URI
-
-.. data:: OPT_X_SASL_AUTHCID
-
-.. data:: OPT_X_SASL_AUTHZID
-
-.. data:: OPT_X_SASL_MECH
-
-.. data:: OPT_X_SASL_NOCANON
-
-   If set to zero SASL host name canonicalization is disabled.
-
-.. data:: OPT_X_SASL_REALM
-
-.. data:: OPT_X_SASL_SECPROPS
-
-.. data:: OPT_X_SASL_SSF
-
-.. data:: OPT_X_SASL_SSF_EXTERNAL
-
-.. data:: OPT_X_SASL_SSF_MAX
-
-.. data:: OPT_X_SASL_SSF_MIN
-
-.. data:: OPT_X_TLS
-
-.. data:: OPT_X_TLS_ALLOW
-
-.. data:: OPT_X_TLS_CACERTDIR
-
-.. data:: OPT_X_TLS_CACERTFILE
-
-.. data:: OPT_X_TLS_CERTFILE
-
-.. data:: OPT_X_TLS_CIPHER_SUITE
-
-.. data:: OPT_X_TLS_CTX
-
-.. data:: OPT_X_TLS_DEMAND
-
-.. data:: OPT_X_TLS_HARD
-
-.. data:: OPT_X_TLS_KEYFILE
-
-.. data:: OPT_X_TLS_NEVER
-
-.. data:: OPT_X_TLS_RANDOM_FILE
-
-.. data:: OPT_X_TLS_REQUIRE_CERT
-
-.. data:: OPT_X_TLS_TRY
-
-
-.. _ldap-dn-flags:
-
-DN format flags
-----------------
-
-This constants are used for DN-parsing functions found in
-sub-module :mod:`ldap.dn`.
-
-.. seealso::
-
-   :manpage:`ldap_str2dn{3}`
-
-
-.. data:: DN_FORMAT_LDAP
-
-.. data:: DN_FORMAT_LDAPV3
-
-.. data:: DN_FORMAT_LDAPV2
-
-.. data:: DN_FORMAT_DCE
-
-.. data:: DN_FORMAT_UFN
-
-.. data:: DN_FORMAT_AD_CANONICAL
-
-.. data:: DN_FORMAT_MASK
-
-.. data:: DN_PRETTY
-
-.. data:: DN_SKIP
-
-.. data:: DN_P_NOLEADTRAILSPACES
-
-.. data:: DN_P_NOSPACEAFTERRDN
-
-.. data:: DN_PEDANTIC
-
-
-
-.. _ldap-exceptions:
-
-Exceptions
-==========
-
-The module defines the following exceptions:
-
-.. exception:: LDAPError
-
-   This is the base class of all execeptions raised by the module :mod:`ldap`.
-   Unlike the C interface, errors are not returned as result codes, but
-   are instead turned into exceptions, raised as soon an the error condition 
-   is detected.
-
-   The exceptions are accompanied by a dictionary possibly
-   containing an string value for the key :const:`desc`
-   (giving an English description of the error class)
-   and/or a string value for the key :const:`info`
-   (giving a string containing more information that the server may have sent).
-
-   A third possible field of this dictionary is :const:`matched` and
-   is set to a truncated form of the name provided or alias dereferenced
-   for the lowest entry (object or alias) that was matched.
-
-
-.. exception:: ADMINLIMIT_EXCEEDED
-
-.. exception:: AFFECTS_MULTIPLE_DSAS
-
-.. exception:: ALIAS_DEREF_PROBLEM
-
-   A problem was encountered when dereferencing an alias.
-   (Sets the :const:`matched` field.)
-
-.. exception:: ALIAS_PROBLEM
-
-   An alias in the directory points to a nonexistent entry.
-   (Sets the :const:`matched` field.)
-
-.. exception:: ALREADY_EXISTS
-
-   The entry already exists. E.g. the *dn* specified with :meth:`add()`
-   already exists in the DIT.
-
-.. exception:: AUTH_UNKNOWN
-
-   The authentication method specified to :meth:`bind()` is not known.
-
-.. exception:: BUSY
-
-   The DSA is busy.
-
-.. exception:: CLIENT_LOOP
-
-.. exception:: COMPARE_FALSE
-
-   A compare operation returned false.
-   (This exception should never be seen because :meth:`compare()` returns
-   a boolean result.)
-
-.. exception:: COMPARE_TRUE
-
-   A compare operation returned true.
-   (This exception should never be seen because :meth:`compare()` returns
-   a boolean result.)
-
-.. exception:: CONFIDENTIALITY_REQUIRED
-
-   Indicates that the session is not protected by a protocol such
-   as Transport Layer Security (TLS), which provides session
-   confidentiality.
-
-.. exception:: CONNECT_ERROR
-
-.. exception:: CONSTRAINT_VIOLATION
-
-   An attribute value specified or an operation started violates some
-   server-side constraint
-   (e.g., a postalAddress has too many lines or a line that is too long
-   or a password is expired).
-
-.. exception:: CONTROL_NOT_FOUND
-
-.. exception:: DECODING_ERROR
-
-   An error was encountered decoding a result from the LDAP server.
-
-.. exception:: ENCODING_ERROR
-
-   An error was encountered encoding parameters to send to the LDAP server.
-
-.. exception:: FILTER_ERROR
-
-   An invalid filter was supplied to :meth:`search()`
-   (e.g. unbalanced parentheses).
-
-.. exception:: INAPPROPRIATE_AUTH
-
-   Inappropriate authentication was specified (e.g. :const:`AUTH_SIMPLE`
-   was specified and the entry does not have a userPassword attribute).
-
-.. exception:: INAPPROPRIATE_MATCHING
-
-   Filter type not supported for the specified attribute.
-
-.. exception:: INSUFFICIENT_ACCESS
-
-   The user has insufficient access to perform the operation.
-
-.. exception:: INVALID_CREDENTIALS
-
-   Invalid credentials were presented during :meth:`bind()` or
-   :meth:`simple_bind()`.
-   (e.g., the wrong password).
-
-.. exception:: INVALID_DN_SYNTAX
-
-   A syntactically invalid DN was specified. (Sets the :const:`matched` field.)
-
-.. exception:: INVALID_SYNTAX
-
-   An attribute value specified by the client did not comply to the
-   syntax defined in the server-side schema.
-
-.. exception:: IS_LEAF
-
-   The object specified is a leaf of the diretcory tree.
-   Sets the :const:`matched` field of the exception dictionary value.
-
-.. exception:: LOCAL_ERROR
-
-   Some local error occurred. This is usually due to failed memory allocation.
-
-.. exception:: LOOP_DETECT
-
-   A loop was detected.
-
-.. exception:: MORE_RESULTS_TO_RETURN
-
-.. exception:: NAMING_VIOLATION
-
-   A naming violation occurred. This is raised e.g. if the LDAP server
-   has constraints about the tree naming.
-
-.. exception:: NO_OBJECT_CLASS_MODS
-
-   Modifying the objectClass attribute as requested is not allowed
-   (e.g. modifying structural object class of existing entry).
-
-.. exception:: NOT_ALLOWED_ON_NONLEAF
-
-   The operation is not allowed on a non-leaf object.
-
-.. exception:: NOT_ALLOWED_ON_RDN
-
-   The operation is not allowed on an RDN.
-
-.. exception:: NOT_SUPPORTED
-
-.. exception:: NO_MEMORY
-
-.. exception:: NO_OBJECT_CLASS_MODS
-
-   Object class modifications are not allowed.
-
-.. exception:: NO_RESULTS_RETURNED
-
-.. exception:: NO_SUCH_ATTRIBUTE
-
-   The attribute type specified does not exist in the entry.
-
-.. exception:: NO_SUCH_OBJECT
-
-   The specified object does not exist in the directory.
-   Sets the :const:`matched` field of the exception dictionary value.
-
-.. exception:: OBJECT_CLASS_VIOLATION
-
-   An object class violation occurred when the LDAP server checked
-   the data sent by the client against the server-side schema
-   (e.g. a "must" attribute was missing in the entry data).
-
-.. exception:: OPERATIONS_ERROR
-
-   An operations error occurred.
-
-.. exception:: OTHER
-
-   An unclassified error occurred.
-
-.. exception:: PARAM_ERROR
-
-   An ldap routine was called with a bad parameter.
-
-.. exception:: PARTIAL_RESULTS
-
-   Partial results only returned. This exception is raised if
-   a referral is received when using LDAPv2.
-   (This exception should never be seen with LDAPv3.)
-
-.. exception:: PROTOCOL_ERROR
-
-   A violation of the LDAP protocol was detected.
-
-.. exception:: RESULTS_TOO_LARGE
-
-   The result does not fit into a UDP packet. This happens only when using
-   UDP-based CLDAP (connection-less LDAP) which is not supported anyway.
-
-.. exception:: SASL_BIND_IN_PROGRESS
-
-.. exception:: SERVER_DOWN
-
-   The  LDAP  library  can't  contact the LDAP server.
-
-.. exception:: SIZELIMIT_EXCEEDED
-
-   An LDAP size limit was exceeded.
-   This could be due to a ``sizelimit`` configuration on the LDAP server.
-
-.. exception:: STRONG_AUTH_NOT_SUPPORTED
-
-   The LDAP server does not support strong authentication.
-
-.. exception:: STRONG_AUTH_REQUIRED
-
-   Strong authentication is required  for the operation.
-
-.. exception:: TIMELIMIT_EXCEEDED
-
-   An LDAP time limit was exceeded.
-
-.. exception:: TIMEOUT
-
-   A timelimit was exceeded while waiting for a result from the server.
-
-.. exception:: TYPE_OR_VALUE_EXISTS
-
-   An  attribute  type or attribute value specified already 
-   exists in the entry.
-
-.. exception:: UNAVAILABLE
-
-   The DSA is unavailable.
-
-.. exception:: UNAVAILABLE_CRITICAL_EXTENSION
-
-   Indicates that the LDAP server was unable to satisfy a request
-   because one or more critical extensions were not available. Either
-   the server does not support the control or the control is not appropriate
-   for the operation type.
-
-.. exception:: UNDEFINED_TYPE
-
-   An attribute type used is not defined in the server-side schema.
-
-.. exception:: UNWILLING_TO_PERFORM
-
-   The  DSA is  unwilling to perform the operation.
-
-.. exception:: USER_CANCELLED
-
-   The operation was cancelled via the :meth:`abandon()` method.
-
-The above exceptions are raised when a result code from an underlying API
-call does not indicate success.
-
-
-.. _ldap-objects:
-
-LDAPObject class
-================
-
-.. % This label is generally useful for referencing this section, but is
-.. % also used to give a filename when generating HTML.
-
-.. %\noindent
-
-Instances of :class:`ldap.LDAPObject` are returned by :func:`initialize()`
-and :func:`open()` (deprecated). The connection is automatically unbound
-and closed  when the LDAP object is deleted.
-
-Arguments for LDAPv3 controls
------------------------------
-
-The :mod:`ldap.controls` module can be used for constructing and
-decoding LDAPv3 controls. These arguments are available in the methods
-with names ending in :const:`_ext` or :const:`_ext_s`:
-
-*serverctrls*
-  is a list of :class:`LDAPControl` instances sent to the server along
-  with the LDAP request (see module :mod:`ldap.controls`). These are
-  controls which alter the behaviour of the server when processing the
-  request if the control is supported by the server. The effect of controls
-  might differ depending on the type of LDAP request or controls might not
-  be applicable with certain LDAP requests at all.
-
-*clientctrls*
-  is a list of :class:`LDAPControl` instances passed to the
-  client API and alter the behaviour of the client when processing the
-  request.
-
-
-Sending LDAP requests
----------------------
-
-Most methods on LDAP objects initiate an asynchronous request to the
-LDAP server and return a message id that can be used later to retrieve
-the result with :meth:`result()`.
-
-Methods with names ending in :const:`_s` are the synchronous form 
-and wait for and return with the server's result, or with
-:const:`None` if no data is expected.
-
-LDAPObject instances have the following methods:
-
-.. %%------------------------------------------------------------
-.. %% abandon
-.. method:: LDAPObject.abandon(msgid)
-
-.. method:: LDAPObject.abandon_ext(msgid [, serverctrls=None [, clientctrls=None]])
-
-   Abandons an LDAP operation in progress without waiting for a LDAP response.
-   The *msgid* argument should be the message ID of an outstanding LDAP
-   operation as returned by the asynchronous methods :meth:`search()`, :meth:`modify()`, etc. 
-   The caller can expect that the result of an abandoned operation will not be
-   returned from a future call to :meth:`result()`.
-
-   *serverctrls* and *clientctrls* like described above.
-
-
-.. %%------------------------------------------------------------
-.. %% add
-.. method:: LDAPObject.add(dn, modlist)
-
-   .. % -> int
-
-.. method:: LDAPObject.add_s(dn, modlist)
-
-   .. % -> None
-
-.. method:: LDAPObject.add_ext(dn, modlist [, serverctrls=None [, clientctrls=None]]) 
-
-   .. % -> int
-
-.. method:: LDAPObject.add_ext_s(dn, modlist [, serverctrls=None [, clientctrls=None]])
-
-   ..  % -> None
-
-   Performs an LDAP add operation. The *dn* argument is the distinguished
-   name (DN) of the entry to add, and *modlist* is a list of attributes to be
-   added. The modlist is similar the one passed to :meth:`modify()`, except that the
-   operation integer is omitted from the tuples in modlist. You might want to
-   look into sub-module \refmodule{ldap.modlist} for generating the modlist.
-
-   The asynchronous methods :meth:`add()` and :meth:`add_ext()`
-   return the message ID of the initiated request.
-   
-   *serverctrls* and *clientctrls* like described above.
-
-.. %%------------------------------------------------------------
-.. %% bind
-.. method:: LDAPObject.bind(who, cred, method)
-
-   .. % -> int
-
-.. method:: LDAPObject.bind_s(who, cred, method)
-
-   .. % -> None
-
-.. method:: LDAPObject.simple_bind([who='' [, cred='']])
-
-   .. % -> int
-
-.. method:: LDAPObject.simple_bind_s([who='' [, cred='']])
-
-   ..  % -> None
-
-   After an LDAP object is created, and before any other operations can be
-   attempted over the connection, a bind operation must be performed.
-
-   This method attempts to bind with the LDAP server using 
-   either simple authentication, or Kerberos (if available).
-   The first and most general method, :meth:`bind()`,
-   takes a third parameter, *method* which can currently solely
-   be :const:`AUTH_SIMPLE`.
-   
-
-.. %%------------------------------------------------------------
-.. %% sasl_interactive_bind_s
-.. method:: LDAPObject.sasl_interactive_bind_s(who, auth)
-
-   .. % -> None
-
-   This call is used to bind to the directory with a SASL bind request.
-
-
-.. %%------------------------------------------------------------
-.. %% cancel
-.. method:: LDAPObject.cancel( cancelid, [, serverctrls=None [, clientctrls=None]])
-
-   Send cancels extended operation for an LDAP operation specified by *cancelid*.
-   The *cancelid* should be the message id of an outstanding LDAP operation as returned
-   by the asynchronous methods search(), modify() etc.  The caller
-   can expect that the result of an abandoned operation will not be
-   returned from a future call to :meth:`result()`.
-   In opposite to :meth:`abandon()` this extended operation gets an result from
-   the server and thus should be preferred if the server supports it.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   :rfc:`3909` - Lightweight Directory Access Protocol (LDAP): Cancel Operation
-
-
-.. %%------------------------------------------------------------
-.. %% compare
-.. method:: LDAPObject.compare(dn, attr, value)
-
-   .. % -> int
-
-.. method:: LDAPObject.compare_s(dn, attr, value)
-
-   .. % -> tuple
-
-.. method:: LDAPObject.compare_ext(dn, attr, value [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> int
-
-.. method:: LDAPObject.compare_ext_s(dn, attr, value [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> tuple
-
-   Perform an LDAP comparison between the attribute named *attr* of 
-   entry *dn*, and the value *value*. The synchronous forms
-   returns :const:`0` for false, or :const:`1` for true.
-   The asynchronous forms returns the message ID of the initiated request, 
-   and the result of the asynchronous compare can be obtained using 
-   :meth:`result()`.  
-
-   Note that the asynchronous technique yields the answer
-   by raising the exception objects :exc:`ldap.COMPARE_TRUE` or
-   :exc:`ldap.COMPARE_FALSE`.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   .. note::
-   
-      A design fault in the LDAP API prevents *value* 
-      from containing nul characters.
-
-.. %%------------------------------------------------------------
-.. %% delete
-.. method:: LDAPObject.delete(dn)
-
-   .. % -> int
-
-.. method::  LDAPObject.delete_s(dn)
-
-   .. % -> None
-
-.. method:: LDAPObject.delete_ext(dn [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> int
-
-.. method:: LDAPObject.delete_ext_s(dn [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> None
-
-   Performs an LDAP delete operation on *dn*. The asynchronous form
-   returns the message id of the initiated request, and the result can be obtained
-   from a subsequent call to :meth:`result()`.
-
-   *serverctrls* and *clientctrls* like described above.
-
-.. %%------------------------------------------------------------
-.. %% modify
-.. method:: LDAPObject.modify(dn, modlist)
-
-   .. % -> int
-
-.. method:: LDAPObject.modify_s(dn, modlist)
-
-   .. % -> None
-
-.. method:: LDAPObject.modify_ext(dn, modlist [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> int
-
-.. method:: LDAPObject.modify_ext_s(dn, modlist [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> None
-
-   Performs an LDAP modify operation on an entry's attributes. 
-   The *dn* argument is the distinguished name (DN) of the entry to modify,
-   and *modlist* is a list of modifications to make to that entry.
-
-   Each element in the list *modlist* should be a tuple of the form 
-   *(mod_op,mod_type,mod_vals)*,
-   where *mod_op* indicates the operation (one of :const:`MOD_ADD`, 
-   :const:`MOD_DELETE`, or :const:`MOD_REPLACE`),
-   *mod_type* is a string indicating the attribute type name, and 
-   *mod_vals* is either a string value or a list of string values to add, 
-   delete or replace respectively.  For the delete operation, *mod_vals*
-   may be :const:`None` indicating that all attributes are to be deleted.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   The asynchronous methods :meth:`modify()` and :meth:`modify_ext()`
-   return the message ID of the initiated request.
-
-   You might want to look into sub-module :mod:`ldap.modlist` for
-   generating *modlist*.
-
-
-.. %%------------------------------------------------------------
-.. %% modrdn
-.. method:: LDAPObject.modrdn(dn, newrdn [, delold=1])
-
-   .. %-> int
-
-
-.. method::  LDAPObject.modrdn_s(dn, newrdn [, delold=1])
-
-   .. % -> None
-
-   Perform a ``modify RDN`` operation, (i.e. a renaming operation).
-   These routines take *dn* (the DN of the entry whose RDN is to be changed,
-   and *newrdn*, the new RDN to give to the entry. The optional parameter
-   *delold* is used to specify whether the old RDN should be kept as an
-   attribute of the entry or not.
-   The asynchronous version returns the initiated message id.
-
-   This operation is emulated by :meth:`rename()` and :meth:`rename_s()` methods
-   since the modrdn2* routines in the C library are deprecated.
-
-
-.. %%------------------------------------------------------------
-.. %% passwd
-.. method:: LDAPObject.passwd(user, oldpw, newpw [, serverctrls=None [, clientctrls=None]])
-
-   .. %-> int
-
-.. method:: LDAPObject.passwd_s(user, oldpw, newpw [, serverctrls=None [, clientctrls=None]])
-
-   .. % -> None
-
-   Perform a ``LDAP Password Modify Extended Operation`` operation
-   on the entry specified by *user*.
-   The old password in *oldpw* is replaced with the new
-   password in *newpw* by a LDAP server supporting this operation.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   The asynchronous version returns the initiated message id.
-
-   .. seealso::
-
-      :rfc:`3062` - LDAP Password Modify Extended Operation
-
-
-
-.. %%------------------------------------------------------------
-.. %% rename
-.. method:: LDAPObject.rename(dn, newrdn [, newsuperior=None [, delold=1 [, serverctrls=None [, clientctrls=None]]]])
-
-   ..  %-> int
-
-.. method:: LDAPObject.rename_s(dn, newrdn [, newsuperior=None [, delold=1 [, serverctrls=None [, clientctrls=None]]]])
-
-   ..  % -> None
-
-   Perform a ``Rename`` operation, (i.e. a renaming operation).
-   These routines take *dn* (the DN of the entry whose RDN is to be changed,
-   and *newrdn*, the new RDN to give to the entry.
-   The optional parameter *newsuperior* is used to specify
-   a new parent DN for moving an entry in the tree
-   (not all LDAP servers support this).
-   The optional parameter *delold* is used to specify
-   whether the old RDN should be kept as an attribute of the entry or not.
-
-   *serverctrls* and *clientctrls* like described above.
-
-.. %%------------------------------------------------------------
-.. %% result
-.. method:: LDAPObject.result([msgid=RES_ANY [, all=1 [, timeout=-1]]])
-
-   .. % -> 2-tuple
-
-   This method is used to wait for and return the result of an operation
-   previously initiated by one of the LDAP *asynchronous* operations
-   (eg :meth:`search()`, :meth:`modify()`, etc.) 
-
-   The *msgid* parameter is the integer identifier returned by that method. 
-   The identifier is guaranteed to be unique across an LDAP session,
-   and tells the :meth:`result()` method to request the result of that
-   specific operation.
-
-   If a result is desired from any one of the in-progress operations,
-   *msgid* should be specified as the constant :const:`RES_ANY`
-   and the method :meth:`result2()` should be used instead.
-
-   The *all* parameter only has meaning for :meth:`search()` responses
-   and is used to select whether a single entry of the search
-   response should be returned, or to wait for all the results
-   of the search before returning.
-
-   A search response is made up of zero or more search entries
-   followed by a search result. If *all* is 0, search entries will
-   be returned one at a time as they come in, via separate calls
-   to :meth:`result()`. If all is 1, the search response will be returned
-   in its entirety, i.e. after all entries and the final search
-   result have been received.
-
-   For *all* set to 0, result tuples
-   trickle in (with the same message id), and with the result types
-   :const:`RES_SEARCH_ENTRY` and :const:`RES_SEARCH_REFERENCE`,
-   until the final result which has a result type of :const:`RES_SEARCH_RESULT`
-   and a (usually) empty data field.  When all is set to 1, only one result is returned,
-   with a result type of RES_SEARCH_RESULT, and all the result tuples
-   listed in the data field.
-
-   The *timeout* parameter is a limit on the number of seconds that the
-   method will wait for a response from the server. 
-   If *timeout* is negative (which is the default),
-   the method will wait indefinitely for a response.
-   The timeout can be expressed as a floating-point value, and
-   a value of :const:`0` effects a poll.
-   If a timeout does occur, a :exc:`ldap.TIMEOUT` exception is raised,
-   unless polling, in which case ``(None, None)`` is returned.
-
-   The :meth:`result()` method returns a tuple of the form 
-   ``(result-type, result-data)``.
-   The first element, ``result-type`` is a string, being one of
-   these module constants:
-   :const:`RES_BIND`, :const:`RES_SEARCH_ENTRY`,
-   :const:`RES_SEARCH_REFERENCE`, :const:`RES_SEARCH_RESULT`, 
-   :const:`RES_MODIFY`, :const:`RES_ADD`, :const:`RES_DELETE`, 
-   :const:`RES_MODRDN`, or :const:`RES_COMPARE`.
-
-   If *all* is :const:`0`, one response at a time is returned on
-   each call to :meth:`result()`, with termination indicated by 
-   ``result-data`` being an empty list.
-
-   See :meth:`search()` for a description of the search result's 
-   ``result-data``, otherwise the ``result-data`` is normally meaningless.
-
-
-
-.. %%------------------------------------------------------------
-.. %% result2
-.. method:: LDAPObject.result2([msgid=RES_ANY [, all=1 [, timeout=-1]]])
-
-   .. % -> 3-tuple
-
-   This method behaves almost exactly like :meth:`result()`. But
-   it returns a 3-tuple also containing the message id of the
-   outstanding LDAP operation a particular result message belongs
-   to. This is especially handy if one needs to dispatch results
-   obtained with ``msgid=``:const:`RES_ANY` to several consumer
-   threads which invoked a particular LDAP operation.
-
-
-.. %%------------------------------------------------------------
-.. %% result3
-.. method:: LDAPObject.result3([msgid=RES_ANY [, all=1 [, timeout=-1]]])
-
-   .. % -> 4-tuple
-
-   This method behaves almost exactly like :meth:`result2()`. But it
-   returns an extra item in the tuple, the decoded server controls.
-
-
-.. %%------------------------------------------------------------
-.. %% search
-.. method:: LDAPObject.search(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0]]])
-   
-   ..  %->int
-
-.. method:: LDAPObject.search_s(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0]]])
-
-   .. %->list|None
-
-.. method:: LDAPObject.search_st(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, timeout=-1]]]])
-
-.. method:: LDAPObject.search_ext(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, serverctrls=None [, clientctrls=None [, timeout=-1 [, sizelimit=0]]]]]]])
-
-   ..  %->int
-
-.. method:: LDAPObject.search_ext_s(base, scope [,filterstr='(objectClass=*)' [, attrlist=None [, attrsonly=0 [, serverctrls=None [, clientctrls=None [, timeout=-1 [, sizelimit=0]]]]]]])
-
-   .. %->list|None
-
-   Perform an LDAP search operation, with *base* as the DN of the entry
-   at which to start the search, *scope* being one of 
-   :const:`SCOPE_BASE` (to search the object itself), 
-   :const:`SCOPE_ONELEVEL` (to search the object's immediate children), or
-   :const:`SCOPE_SUBTREE` (to search the object and all its descendants).
-
-   The *filterstr* argument is a string representation of the filter to apply in
-   the search.
-
-   .. seealso:: 
-
-      :rfc:`4515` - Lightweight Directory Access Protocol (LDAP): String Representation of Search Filters.
-
-
-   Each result tuple is of the form ``(dn, attrs)``, 
-   where *dn* is a string containing the DN (distinguished name) of the
-   entry, and *attrs* is a dictionary containing the attributes associated
-   with the entry. The keys of *attrs* are strings, and the associated
-   values are lists of strings.
-
-   The DN in *dn* is automatically extracted using the underlying libldap
-   function :cfunc:`ldap_get_dn()`, which may raise an exception if the
-   DN is malformed.
-
-   If *attrsonly* is non-zero, the values of *attrs* will be meaningless
-   (they are not transmitted in the result).
-
-   The retrieved attributes can be limited with the *attrlist* parameter.
-   If *attrlist* is :const:`None`, all the attributes of each entry are returned.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   The synchronous form with timeout, :meth:`search_st()` or :meth:`search_ext_s()`,
-   will block for at most *timeout* seconds (or indefinitely if *timeout*
-   is negative). A :exc:`ldap.TIMEOUT` exception is raised if no result is received
-   within the specified time.
-
-   The amount of search results retrieved can be limited with the
-   *sizelimit* parameter when using :meth:`search_ext()`
-   or :meth:`search_ext_s()` (client-side search limit). If non-zero
-   not more than *sizelimit* results are returned by the server.
-
-
-
-.. %%------------------------------------------------------------
-.. %% start_tls_s
-.. method:: LDAPObject.start_tls_s()
-
-   .. % -> None    
-
-    Negotiate TLS with server. The ``version`` attribute must have been
-    set to :const:`VERSION3` (which it is by default) before calling this method.
-    If TLS could not be started an exception will be raised.
-
-   .. seealso::
-
-      :rfc:`2830` - Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security
-
-
-
-.. %%------------------------------------------------------------
-.. %% unbind
-.. method:: LDAPObject.unbind()
-
-   .. % -> int
-
-.. method:: LDAPObject.unbind_s()
-
-   .. % -> None
-
-.. method:: LDAPObject.unbind_ext([, serverctrls=None [, clientctrls=None]])
-
-   .. % -> int
-
-.. method:: LDAPObject.unbind_ext_s([, serverctrls=None [, clientctrls=None]])
-
-   .. % -> None
-
-   This call is used to unbind from the directory, terminate the
-   current association, and free resources. Once called, the connection to the
-   LDAP server is closed and the LDAP object is marked invalid.
-   Further invocation of methods on the object will yield exceptions.
-
-   *serverctrls* and *clientctrls* like described above.
-
-   These methods are all synchronous in nature.
-
-
-.. %%------------------------------------------------------------
-.. %% whoami_s
-.. method:: LDAPObject.whoami_s()
-
-   .. % -> string
-
-   This synchronous method implements the LDAP "Who Am I?"
-   extended operation.
-
-   It is useful for finding out to find out which identity
-   is assumed by the LDAP server after a SASL bind.
-
-   .. seealso::
-
-      :rfc:`4532` - Lightweight Directory Access Protocol (LDAP) "Who am I?" Operation
-
-
-Connection-specific LDAP options
---------------------------------
-
-.. %%------------------------------------------------------------
-.. %% get_option
-.. method:: LDAPObject.get_option(option)
-
-   .. % -> None
-
-   This method returns the value of the LDAPObject option
-   specified by *option*.
-
-
-.. %%------------------------------------------------------------
-.. %% set_option
-.. method:: LDAPObject.set_option(option, invalue)
-
-   .. % -> None
-
-   This method sets the value of the LDAPObject option
-   specified by *option* to *invalue*.
-
-
-Object attributes
------------------
-
-If the underlying library provides enough information,
-each LDAP object will also have the following attributes.
-These attributes are mutable unless described as read-only.
-
-.. %%------------------------------------------------------------
-.. %% deref
-.. attribute:: LDAPObject.deref
-
-   .. % -> int
-
-   Controls whether aliases are automatically dereferenced.
-   This must be one of :const:`DEREF_NEVER`, :const:`DEREF_SEARCHING`, :const:`DEREF_FINDING`,
-   or :const:`DEREF_ALWAYS`.
-   This option is mapped to option constant :const:`OPT_DEREF`
-   and used in the underlying OpenLDAP lib.
-
-
-.. %%------------------------------------------------------------
-.. %% network_timeout
-.. attribute:: LDAPObject.network_timeout
-
-   .. % -> int
-
-   Limit on waiting for a network response, in seconds. 
-   Defaults to :const:`NO_LIMIT`.
-   This option is mapped to option constant :const:`OPT_NETWORK_TIMEOUT`
-   and used in the underlying OpenLDAP lib.
-
-
-.. %%------------------------------------------------------------
-.. %% protocol_version
-.. attribute:: LDAPObject.protocol_version
-
-   .. % -> int
-
-   Version of LDAP in use (either :const:`VERSION2` for LDAPv2
-   or :const:`VERSION3` for LDAPv3).
-   This option is mapped to option constant :const:`OPT_PROTOCOL_VERSION`
-   and used in the underlying OpenLDAP lib.
-
-   .. note::
-
-      It is highly recommended to set the protocol version after establishing
-      a LDAP connection with :func:`initialize()` and before submitting
-      the first request.
-      
-
-.. %%------------------------------------------------------------
-.. %% sizelimit
-.. attribute:: LDAPObject.sizelimit
-
-   .. % -> int
-
-   Limit on size of message to receive from server. 
-   Defaults to :const:`NO_LIMIT`.
-   This option is mapped to option constant :const:`OPT_SIZELIMIT`
-   and used in the underlying OpenLDAP lib. Its use is deprecated
-   in favour of *sizelimit* parameter when using :meth:`search_ext()`.
-
-
-.. %%------------------------------------------------------------
-.. %% timelimit
-.. attribute:: LDAPObject.timelimit
-
-   .. % -> int
-
-   Limit on waiting for any response, in seconds. 
-   Defaults to :const:`NO_LIMIT`.
-   This option is mapped to option constant :const:`OPT_TIMELIMIT`
-   and used in the underlying OpenLDAP lib. Its use is deprecated
-   in favour of using *timeout*.
-
-
-.. %%------------------------------------------------------------
-.. %% timeout
-.. attribute:: LDAPObject.timeout
-
-   .. % -> int
-
-   Limit on waiting for any response, in seconds. 
-   Defaults to :const:`NO_LIMIT`.
-   This option is used in the wrapper module.
-
-
-.. _ldap-example:
-
-Example
-=======
-
-The following example demonstrates how to open a connection to an
-LDAP server using the :mod:`ldap` module and invoke a synchronous
-subtree search.
-
->>> import ldap
->>> l = ldap.initialize('ldap://localhost:1390')
->>> l.search_s('ou=Testing,dc=stroeder,dc=de',ldap.SCOPE_SUBTREE,'(cn=fred*)',['cn','mail'])
-[('cn=Fred Feuerstein,ou=Testing,dc=stroeder,dc=de', {'cn': ['Fred Feuerstein']})]
->>> r = l.search_s('ou=Testing,dc=stroeder,dc=de',ldap.SCOPE_SUBTREE,'(objectClass=*)',['cn','mail'])
->>> for dn,entry in r:
->>>   print 'Processing',repr(dn)
->>>   handle_ldap_entry(entry)
-
-

+ 0 - 120
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldapurl.rst

@@ -1,120 +0,0 @@
-.. % $Id: ldapurl.rst,v 1.5 2010/02/05 13:13:19 stroeder Exp $
-
-################################
-:mod:`ldapurl` LDAP URL handling
-################################
-
-.. module:: ldapurl
-   :synopsis: Parses and generates LDAP URLs
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-This module parses and generates LDAP URLs.    It is implemented in pure Python
-and does not rely on any  non-standard modules. Therefore it can be used stand-
-alone without  the rest of the python-ldap package.    Compability note: This
-module has been solely tested on Python 2.x and above.
-
-.. seealso::
-
-   :rfc:`4516` - The LDAP URL Format
-
-
-The :mod:`ldapurl` module exports the following constants:
-
-.. data:: SEARCH_SCOPE
-
-   This dictionary maps a search scope string identifier  to the corresponding
-   integer value used with search operations  in :mod:`ldap`.
-
-
-.. data:: SEARCH_SCOPE_STR
-
-   This dictionary is the inverse to :const:`SEARCH_SCOPE`. It  maps a search scope
-   integer value to the corresponding string identifier  used in a LDAP URL string
-   representation.
-
-
-.. data:: LDAP_SCOPE_BASE
-
-
-.. data:: LDAP_SCOPE_ONELEVEL
-
-
-.. data:: LDAP_SCOPE_SUBTREE
-
-
-
-.. _ldapurl-ldapurl:
-
-LDAPUrl Objects
-^^^^^^^^^^^^^^^^
-
-A :class:`LDAPUrl` object represents a complete LDAP URL.
-
-All class methods:
-
-Class attributes:
-
-Instance attributes:
-
-.. Here the actual docstring could be used provided it is fixed according rst rules
-.. autoclass:: ldapurl.LDAPUrl 
-
-
-.. _ldapurl-ldapurlextension:
-
-LDAPUrlExtension Objects
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-A :class:`LDAPUrlExtension` object represents a single LDAP URL extension.
-
-All class methods:
-
-Class attributes:
-
-Instance attributes:
-
-.. Here the actual docstring could be used provided it is fixed according rst rules
-.. autoclass:: ldapurl.LDAPUrlExtension
-
-
-.. _ldapurl-example:
-
-Example
-^^^^^^^^
-
-Important security advice:
-For security reasons you shouldn't specify passwords in LDAP URLs
-unless you really know what you are doing.
-
-The following example demonstrates how to parse a LDAP URL
-with :mod:`ldapurl` module.
-
-
->>> import ldapurl
->>> ldap_url = ldapurl.LDAPUrl('ldap://localhost:1389/dc=stroeder,dc=com?cn,mail???bindname=cn=Michael%2cdc=stroeder%2cdc=com,X-BINDPW=secret')
->>> # Using the parsed LDAP URL by reading the class attributes
->>> ldap_url.dn
-'dc=stroeder,dc=com'
->>> ldap_url.hostport
-'localhost:1389'
->>> ldap_url.attrs
-['cn','mail']
->>> ldap_url.filterstr
-'(objectclass=*)'
->>> ldap_url.who
-'cn=Michael,dc=stroeder,dc=com'
->>> ldap_url.cred
-'secret'
->>> ldap_url.scope
-0
-
-
-The following example demonstrates how to generate a LDAP URL
-with \module{ldapurl} module.
-
->>> import ldapurl
->>> ldap_url = ldapurl.LDAPUrl(hostport='localhost:1389',dn='dc=stroeder,dc=com',attrs=['cn','mail'],who='cn=Michael,dc=stroeder,dc=com',cred='secret')
->>> ldap_url.unparse()
-'ldap://localhost:1389/dc=stroeder,dc=com?cn,mail?base?(objectclass=*)?bindname=cn=Michael%2Cdc=stroeder%2Cdc=com,X-BINDPW=secret'
-

+ 0 - 63
desktop/core/ext-py/python-ldap-2.3.11/Doc/ldif.rst

@@ -1,63 +0,0 @@
-.. % $Id: ldif.rst,v 1.5 2010/02/05 13:12:06 stroeder Exp $
-
-#####################################
-:mod:`ldif` LDIF parser and generator
-#####################################
-
-.. module:: ldif
-   :synopsis: Parses and generates LDIF files
-.. moduleauthor:: python-ldap project (see http://www.python-ldap.org/)
-
-
-This module parses and generates LDAP data in the format LDIF.    It is
-implemented in pure Python and does not rely on any  non-standard modules.
-Therefore it can be used stand-alone without  the rest of the python-ldap
-package.
-
-.. seealso::
-
-   :rfc:`2849` - The LDAP Data Interchange Format (LDIF) - Technical Specification
-
-
-.. _ldif-example:
-
-Example
-^^^^^^^^
-
-The following example demonstrates how to write LDIF output
-of an LDAP entry with :mod:`ldif` module.
-
->>> import sys,ldif
->>> entry={'objectClass':['top','person'],'cn':['Michael Stroeder'],'sn':['Stroeder']}
->>> dn='cn=Michael Stroeder,ou=Test'
->>> ldif_writer=ldif.LDIFWriter(sys.stdout)
->>> ldif_writer.unparse(dn,entry)
-dn: cn=Michael Stroeder,ou=Test
-cn: Michael Stroeder
-objectClass: top
-objectClass: person
-sn: Stroeder
-
-
-The following example demonstrates how to parse an LDIF file
-with :mod:`ldif` module, skip some entries and write the result to stdout. ::
-
-   import sys
-   from ldif import LDIFParser, LDIFWriter
-
-   skip_dn = ["uid=foo,ou=People,dc=example,dc=com", 
-      "uid=bar,ou=People,dc=example,dc=com"]
-
-   class MyLDIF(LDIFParser):
-      def __init__(self, input, output):
-         LDIFParser.__init__(self, input)
-         self.writer = LDIFWriter(output)
-
-      def handle(self, dn, entry):
-         for i in skip_dn:
-            if i == dn: return
-         self.writer.unparse(dn, entry)
-
-   parser = MyLDIF(open("input.ldif", 'rb'), sys.stdout)
-   parser.parse()
-

+ 0 - 27
desktop/core/ext-py/python-ldap-2.3.11/INSTALL

@@ -1,27 +0,0 @@
-------------------------------
-Installing python-ldap
-------------------------------
-
-Prerequisites:
-
-  Required:
-
-    - Python 2.3 or newer (see http://www.python.org)
-
-    - OpenLDAP libs (see http://www.openldap.org)
-      You need OpenLDAP 2.3.x client libs or newer for full
-      functionality. It is not possible and not supported
-      by the python-ldap project to build with prior versions.
-
-  Optional:
-
-    - Cyrus SASL 2.1.x or newer (see http://asg.web.cmu.edu/sasl/sasl-library.html)
-
-    - OpenSSL 0.9.7 or newer (see http://www.openssl.org)
-
-Quick build instructions:
-    edit setup.cfg (see Build/ for platform-specific examples)
-    python setup.py build
-    python setup.py install
-
-$Id: INSTALL,v 1.9 2008/06/19 08:56:03 stroeder Exp $

+ 0 - 13
desktop/core/ext-py/python-ldap-2.3.11/LICENCE

@@ -1,13 +0,0 @@
-
-The python-ldap package is distributed under Python-style license.
-
-Standard disclaimer:
-   This software is made available by the author(s) to the public for free
-   and "as is".  All users of this free software are solely and entirely
-   responsible for their own choice and use of this software for their
-   own purposes.  By using this software, each user agrees that the
-   author(s) shall not be liable for damages of any kind in relation to
-   its use or performance. The author(s) do not warrant that this software
-   is fit for any purpose.
-
-$Id: LICENCE,v 1.1 2002/09/18 18:51:22 stroeder Exp $

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Lib/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 301
desktop/core/ext-py/python-ldap-2.3.11/Lib/dsml.py

@@ -1,301 +0,0 @@
-"""
-dsml - generate and parse DSMLv1 data
-(see http://www.oasis-open.org/committees/dsml/)
-
-See http://www.python-ldap.org/ for details.
-
-$Id: dsml.py,v 1.14 2009/12/03 22:11:26 stroeder Exp $
-
-Python compability note:
-Tested with Python 2.0+.
-"""
-
-__version__ = '2.3.11'
-
-import string,base64
-
-def list_dict(l):
-  """
-  return a dictionary with all items of l being the keys of the dictionary
-  """
-  d = {}
-  for i in l:
-    d[i]=None
-  return d
-
-
-special_entities = (
-  ('&','&amp;'),
-  ('<','&lt;'),
-  ('"','&quot;'),
-  ("'",'&apos;'),
-)
-
-def replace_char(s):
-  for char,entity in special_entities:
-    s = string.replace(s,char,entity)
-  return s
-
-class DSMLWriter:
-
-  def __init__(
-    self,f,base64_attrs=[],dsml_comment='',indent='    '
-  ):
-    """
-    Parameters:
-    f
-          File object for output.
-    base64_attrs
-          Attribute types to be base64-encoded.
-    dsml_comment
-          Text placed in comment lines behind <dsml:dsml>.
-    indent
-          String used for indentiation of next nested level.
-    """
-    self._output_file = f
-    self._base64_attrs = list_dict(map(string.lower,base64_attrs))
-    self._dsml_comment = dsml_comment
-    self._indent = indent
-
-  def _needs_base64_encoding(self,attr_type,attr_value):
-    if self._base64_attrs:
-      return self._base64_attrs.has_key(string.lower(attr_type))
-    else:
-      try:
-        unicode(attr_value,'utf-8')
-      except UnicodeError:
-        return 1
-      else:
-        return 0
-
-  def writeHeader(self):
-    """
-    Write the header
-    """
-    self._output_file.write('\n'.join([
-        '<?xml version="1.0" encoding="UTF-8"?>',
-        '<!DOCTYPE root PUBLIC "dsml.dtd" "http://www.dsml.org/1.0/dsml.dtd">',
-        '<dsml:dsml xmlns:dsml="http://www.dsml.org/DSML">',
-        '%s<dsml:directory-entries>\n' % (self._indent),
-      ])
-    )
-    if self._dsml_comment:
-      self._output_file.write('%s<!--\n' % (self._indent))
-      self._output_file.write('%s%s\n' % (self._indent,self._dsml_comment))
-      self._output_file.write('%s-->\n' % (self._indent))
-
-  def writeFooter(self):
-    """
-    Write the footer
-    """
-    self._output_file.write('%s</dsml:directory-entries>\n' % (self._indent))
-    self._output_file.write('</dsml:dsml>\n')
-    
-  def unparse(self,dn,entry):
-    return self.writeRecord(dn,entry)
-
-  def writeRecord(self,dn,entry):
-    """
-    dn
-          string-representation of distinguished name
-    entry
-          dictionary holding the LDAP entry {attr:data}
-    """
-
-    # Write line dn: first
-    self._output_file.write(
-      '%s<dsml:entry dn="%s">\n' % (
-        self._indent*2,replace_char(dn)
-      )
-    )
-
-    objectclasses = entry.get('objectclass',entry.get('objectClass',[]))
-
-    self._output_file.write('%s<dsml:objectclass>\n' % (self._indent*3))
-    for oc in objectclasses:
-      self._output_file.write('%s<dsml:oc-value>%s</dsml:oc-value>\n' % (self._indent*4,oc))
-    self._output_file.write('%s</dsml:objectclass>\n' % (self._indent*3))
-
-    attr_types = entry.keys()[:]
-    try:
-      attr_types.remove('objectclass')
-      attr_types.remove('objectClass')
-    except ValueError:
-      pass
-    attr_types.sort()
-    for attr_type in attr_types:
-      self._output_file.write('%s<dsml:attr name="%s">\n' % (self._indent*3,attr_type))
-      for attr_value_item in entry[attr_type]:
-        needs_base64_encoding = self._needs_base64_encoding(
-          attr_type,attr_value_item
-        )
-        if needs_base64_encoding:
-          attr_value_item = base64.encodestring(attr_value_item)
-        else:
-          attr_value_item = replace_char(attr_value_item)
-  	self._output_file.write('%s<dsml:value%s>\n' % (
-            self._indent*4,
-            ' encoding="base64"'*needs_base64_encoding
-          )
-        )
-  	self._output_file.write('%s%s\n' % (
-            self._indent*5,
-            attr_value_item
-          )
-        )
-  	self._output_file.write('%s</dsml:value>\n' % (
-            self._indent*4,
-          )
-        )
-      self._output_file.write('%s</dsml:attr>\n' % (self._indent*3))
-    self._output_file.write('%s</dsml:entry>\n' % (self._indent*2))
-    return
-
-
-try:
-
-  import xml.sax,xml.sax.handler
-
-except ImportError:
-  pass
-
-else:
-
-  class DSMLv1Handler(xml.sax.handler.ContentHandler):
-    """
-    Content handler class for DSMLv1
-    """
-
-    def __init__(self,parser_instance):
-      self._parser_instance = parser_instance
-      xml.sax.handler.ContentHandler.__init__(self)
-
-    def startDocument(self):
-      pass
-
-    def endDocument(self):
-      pass
-
-    def startElement(self,raw_name,attrs):
-      assert raw_name.startswith(''),'Illegal name'
-      name = raw_name[5:]
-      if name=='dsml':
-        pass
-      elif name=='directory-entries':
-        self._parsing_entries = 1
-      elif name=='entry':
-        self._dn = attrs['dn']
-        self._entry = {}
-      elif name=='attr':
-        self._attr_type = attrs['name'].encode('utf-8')
-        self._attr_values = []
-      elif name=='value':
-        self._attr_value = ''
-        self._base64_encoding = attrs.get('encoding','').lower()=='base64'
-      # Handle object class tags
-      elif name=='objectclass':
-        self._object_classes = []
-      elif name=='oc-value':
-        self._oc_value = ''
-      # Unhandled tags
-      else:
-        raise ValueError,'Unknown tag %s' % (raw_name)
-
-    def endElement(self,raw_name):
-      assert raw_name.startswith('dsml:'),'Illegal name'
-      name = raw_name[5:]
-      if name=='dsml':
-        pass
-      elif name=='directory-entries':
-        self._parsing_entries = 0
-      elif name=='entry':
-        self._parser_instance.handle(self._dn,self._entry)
-        del self._dn
-        del self._entry
-      elif name=='attr':
-        self._entry[self._attr_type] = self._attr_values
-        del self._attr_type
-        del self._attr_values
-      elif name=='value':
-        if self._base64_encoding:
-          attr_value = base64.decodestring(self._attr_value.strip())
-        else:
-          attr_value = self._attr_value.strip().encode('utf-8')
-        self._attr_values.append(attr_value)
-        del attr_value
-        del self._attr_value
-        del self._base64_encoding
-      # Handle object class tags
-      elif name=='objectclass':
-        self._entry['objectClass'] = self._object_classes
-        del self._object_classes
-      elif name=='oc-value':
-        self._object_classes.append(self._oc_value.strip().encode('utf-8'))
-        del self._oc_value
-      # Unhandled tags
-      else:
-        raise ValueError,'Unknown tag %s' % (raw_name)
-
-    def characters(self,ch):
-      if self.__dict__.has_key('_oc_value'):
-        self._oc_value = self._oc_value + ch
-      elif self.__dict__.has_key('_attr_value'):
-        self._attr_value = self._attr_value + ch
-      else:
-        pass
-
-
-  class DSMLParser:
-    """
-    Base class for a DSMLv1 parser. Applications should sub-class this
-    class and override method handle() to implement something meaningful.
-
-    Public class attributes:
-    records_read
-          Counter for records processed so far
-    """
-
-    def __init__(
-      self,
-      input_file,
-      ContentHandlerClass,
-      ignored_attr_types=None,
-      max_entries=0,
-    ):
-      """
-      Parameters:
-      input_file
-          File-object to read the DSMLv1 input from
-      ignored_attr_types
-          Attributes with these attribute type names will be ignored.
-      max_entries
-          If non-zero specifies the maximum number of entries to be
-          read from f.
-      line_sep
-          String used as line separator
-      """
-      self._input_file = input_file
-      self._max_entries = max_entries
-      self._ignored_attr_types = list_dict(map(string.lower,(ignored_attr_types or [])))
-      self._current_record = None,None
-      self.records_read = 0
-      self._parser = xml.sax.make_parser()
-      self._parser.setFeature(xml.sax.handler.feature_namespaces,0)
-      content_handler = ContentHandlerClass(self)
-      self._parser.setContentHandler(content_handler)
-
-    def handle(self,*args,**kwargs):
-      """
-      Process a single content DSMLv1 record. This method should be
-      implemented by applications using DSMLParser.
-      """
-      import pprint
-      pprint.pprint(args)
-      pprint.pprint(kwargs)
-
-    def parse(self):
-      """
-      Continously read and parse DSML records
-      """
-      self._parser.parse(self._input_file)
-

+ 0 - 4
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/.cvsignore

@@ -1,4 +0,0 @@
-*.pyc
-*.pyo
-*.bck
-*~

+ 0 - 56
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/__init__.py

@@ -1,56 +0,0 @@
-"""
-ldap - base module
-
-See http://www.python-ldap.org/ for details.
-
-$Id: __init__.py,v 1.67 2009/12/03 22:11:26 stroeder Exp $
-"""
-
-# This is also the overall release version number
-
-__version__ = '2.3.11'
-
-import sys
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-  _trace_level = 0
-  _trace_file = sys.stderr
-  _trace_stack_limit = None
-
-from _ldap import *
-
-class DummyLock:
-  """Define dummy class with methods compatible to threading.Lock"""
-  def __init__(self):
-    pass
-  def acquire(self):
-    pass
-  def release(self):
-    pass
-
-
-try:
-  # Check if Python installation was build with thread support
-  import thread
-except ImportError:
-  LDAPLock = DummyLock
-else:
-  import threading
-  LDAPLock = threading.Lock
-
-# Create module-wide lock for serializing all calls
-# into underlying LDAP lib
-_ldap_module_lock = LDAPLock()
-
-from functions import open,initialize,init,get_option,set_option
-
-from ldap.dn import explode_dn,explode_rdn,str2dn,dn2str
-del str2dn
-del dn2str
-
-# More constants
-
-# For compability of 2.3 and 2.4 OpenLDAP API
-OPT_DIAGNOSTIC_MESSAGE = OPT_ERROR_STRING

+ 0 - 316
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/async.py

@@ -1,316 +0,0 @@
-"""
-ldap.async - handle async LDAP operations
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: async.py,v 1.28 2009/07/26 11:09:57 stroeder Exp $
-
-Python compability note:
-Tested on Python 2.0+ but should run on Python 1.5.x.
-"""
-
-import ldap
-
-from ldap import __version__
-
-
-_searchResultTypes={
-  ldap.RES_SEARCH_ENTRY:None,
-  ldap.RES_SEARCH_RESULT:None,
-  ldap.RES_SEARCH_REFERENCE:None,
-}
-
-_entryResultTypes={
-  ldap.RES_SEARCH_ENTRY:None,
-  ldap.RES_SEARCH_RESULT:None,
-}
-
-
-class WrongResultType(Exception):
-
-  def __init__(self,receivedResultType,expectedResultTypes):
-    self.receivedResultType = receivedResultType
-    self.expectedResultTypes = expectedResultTypes
-    Exception.__init__(self)
-
-  def __str__(self):
-    return 'Received wrong result type %s (expected one of %s).' % (
-      self.receivedResultType,
-      ', '.join(self.expectedResultTypes),
-    )
-      
-
-class AsyncSearchHandler:
-  """
-  Class for stream-processsing LDAP search results
-  """
-
-  def __init__(self,l):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    """
-    self._l = l
-    self._msgId = None
-
-  def startSearch(
-    self,
-    searchRoot,
-    searchScope,
-    filterStr,
-    attrList=None,
-    attrsOnly=0,
-    timeout=-1,
-    sizelimit=0,
-    serverctrls=None,
-    clientctrls=None
-  ):
-    """
-    searchRoot
-        See parameter base of method LDAPObject.search()
-    searchScope
-        See parameter scope of method LDAPObject.search()
-    filterStr
-        See parameter filter of method LDAPObject.search()
-    attrList=None
-        See parameter attrlist of method LDAPObject.search()
-    attrsOnly
-        See parameter attrsonly of method LDAPObject.search()
-    timeout
-        Maximum time the server shall use for search operation
-    sizelimit
-        Maximum number of entries a server should return
-        (request client-side limit)
-    serverctrls
-        list of server-side LDAP controls
-    clientctrls
-        list of client-side LDAP controls
-    """
-    self._msgId = self._l.search_ext(
-      searchRoot,searchScope,filterStr,
-      attrList,attrsOnly,serverctrls,clientctrls,timeout,sizelimit
-    )
-    return # startSearch()
-
-  def preProcessing(self):
-    """
-    Do anything you want after starting search but
-    before receiving and processing results
-    """
-
-  def postProcessing(self):
-    """
-    Do anything you want after receiving and processing results
-    """
-
-  def processResults(self,ignoreResultsNumber=0,processResultsCount=0,timeout=-1):
-    """
-    ignoreResultsNumber
-        Don't process the first ignoreResultsNumber results.
-    processResultsCount
-        If non-zero this parameters indicates the number of results
-        processed is limited to processResultsCount.
-    timeout
-        See parameter timeout of ldap.LDAPObject.result()
-    """
-    self.preProcessing()
-    result_counter = 0
-    end_result_counter = ignoreResultsNumber+processResultsCount
-    go_ahead = 1
-    partial = 0
-    self.beginResultsDropped = 0
-    self.endResultBreak = result_counter
-    try:
-      result_type,result_list = None,None
-      while go_ahead:
-        while result_type is None and not result_list:
-          result_type,result_list,result_msgid,result_serverctrls = self._l.result3(self._msgId,0,timeout)
-        if not result_list:
-          break
-        if not _searchResultTypes.has_key(result_type):
-          raise WrongResultType(result_type,_searchResultTypes.keys())
-        # Loop over list of search results
-        for result_item in result_list:
-          if result_counter<ignoreResultsNumber:
-            self.beginResultsDropped = self.beginResultsDropped+1
-          elif processResultsCount==0 or result_counter<end_result_counter:
-            self._processSingleResult(result_type,result_item)
-          else:
-            go_ahead = 0 # break-out from while go_ahead
-            partial = 1
-            break # break-out from this for-loop
-          result_counter = result_counter+1
-        result_type,result_list = None,None
-        self.endResultBreak = result_counter
-    finally:
-      if partial and self._msgId!=None:
-        self._l.abandon(self._msgId)
-    self.postProcessing()
-    return partial # processResults()
-
-  def _processSingleResult(self,resultType,resultItem):
-    """
-    Process single entry
-
-    resultType
-        result type
-    resultItem
-        Single item of a result list
-    """
-    pass
-
-
-class List(AsyncSearchHandler):
-  """
-  Class for collecting all search results.
-  
-  This does not seem to make sense in the first place but think
-  of retrieving exactly a certain portion of the available search
-  results.
-  """
-
-  def __init__(self,l):
-    AsyncSearchHandler.__init__(self,l)
-    self.allResults = []
-
-  def _processSingleResult(self,resultType,resultItem):
-    self.allResults.append((resultType,resultItem))
-
-
-class Dict(AsyncSearchHandler):
-  """
-  Class for collecting all search results into a dictionary {dn:entry}
-  """
-
-  def __init__(self,l):
-    AsyncSearchHandler.__init__(self,l)
-    self.allEntries = {}
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self.allEntries[dn] = entry
-
-
-class IndexedDict(Dict):
-  """
-  Class for collecting all search results into a dictionary {dn:entry}
-  and maintain case-sensitive equality indexes to entries
-  """
-
-  def __init__(self,l,indexed_attrs=None):
-    Dict.__init__(self,l)
-    self.indexed_attrs = indexed_attrs or tuple()
-    self.index = {}.fromkeys(self.indexed_attrs,{})
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self.allEntries[dn] = entry
-      for a in self.indexed_attrs:
-	if entry.has_key(a):
-	  for v in entry[a]:
-	    try:
-    	      self.index[a][v].append(dn)
-	    except KeyError:
-    	      self.index[a][v] = [ dn ]
-
-
-class FileWriter(AsyncSearchHandler):
-  """
-  Class for writing a stream of LDAP search results to a file object
-  """
-
-  def __init__(self,l,f,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    f
-        File object instance where the LDIF data is written to
-    """
-    AsyncSearchHandler.__init__(self,l)
-    self._f = f
-    self.headerStr = headerStr
-    self.footerStr = footerStr
-
-  def preProcessing(self):
-    """
-    The headerStr is written to output after starting search but
-    before receiving and processing results.
-    """
-    self._f.write(self.headerStr)
-
-  def postProcessing(self):
-    """
-    The footerStr is written to output after receiving and
-    processing results.
-    """
-    self._f.write(self.footerStr)
-
-
-class LDIFWriter(FileWriter):
-  """
-  Class for writing a stream LDAP search results to a LDIF file
-  """
-
-  def __init__(self,l,writer_obj,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-    
-    Parameters:
-    l
-        LDAPObject instance
-    writer_obj
-        Either a file-like object or a ldif.LDIFWriter instance
-        used for output
-    """
-    import ldif
-    if isinstance(writer_obj,ldif.LDIFWriter):
-      self._ldif_writer = writer_obj
-    else:
-      self._ldif_writer = ldif.LDIFWriter(writer_obj)
-    FileWriter.__init__(self,l,self._ldif_writer._output_file,headerStr,footerStr)
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self._ldif_writer.unparse(dn,entry)
-
-class DSMLWriter(FileWriter):
-  """
-  Class for writing a stream LDAP search results to a DSML file
-  """
-
-  def __init__(self,l,writer_obj,headerStr='',footerStr=''):
-    """
-    Initialize a StreamResultHandler
-
-    Parameters:
-    l
-        LDAPObject instance
-    writer_obj
-        Either a file-like object or a ldif.DSMLWriter instance
-        used for output
-    """
-    import dsml
-    if isinstance(writer_obj,dsml.DSMLWriter):
-      self._dsml_writer = writer_obj
-    else:
-      self._dsml_writer = dsml.DSMLWriter(writer_obj)
-    FileWriter.__init__(self,l,self._dsml_writer._output_file,headerStr,footerStr)
-
-  def _processSingleResult(self,resultType,resultItem):
-    if _entryResultTypes.has_key(resultType):
-      # Search continuations are ignored
-      dn,entry = resultItem
-      self._dsml_writer.unparse(dn,entry)
-

+ 0 - 125
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/cidict.py

@@ -1,125 +0,0 @@
-"""
-This is a convenience wrapper for dictionaries
-returned from LDAP servers containing attribute
-names of variable case.
-
-See http://www.python-ldap.org/ for details.
-
-$Id: cidict.py,v 1.13 2009/04/17 14:34:34 stroeder Exp $
-"""
-
-__version__ = """$Revision: 1.13 $"""
-
-from UserDict import UserDict
-from string import lower
-
-class cidict(UserDict):
-  """
-  Case-insensitive but case-respecting dictionary.
-  """
-
-  def __init__(self,default=None):
-    self._keys = {}
-    UserDict.__init__(self,{})
-    self.update(default or {})
-
-  def __getitem__(self,key):
-    return self.data[lower(key)]
-
-  def __setitem__(self,key,value):
-    lower_key = lower(key)
-    self._keys[lower_key] = key
-    self.data[lower_key] = value
-
-  def __delitem__(self,key):
-    lower_key = lower(key)
-    del self._keys[lower_key]
-    del self.data[lower_key]
-
-  def update(self,dict):
-    for key in dict.keys():
-      self[key] = dict[key]
-
-  def has_key(self,key):
-    return UserDict.has_key(self,lower(key))
-
-  def __contains__(self,key):
-    return self.has_key(key)
-
-  def get(self,key,failobj=None):
-    try:
-      return self[key]
-    except KeyError:
-      return failobj
-
-  def keys(self):
-    return self._keys.values()
-
-  def items(self):
-    result = []
-    for k in self._keys.values():
-      result.append((k,self[k]))
-    return result
-
-
-def strlist_minus(a,b):
-  """
-  Return list of all items in a which are not in b (a - b).
-  a,b are supposed to be lists of case-insensitive strings.
-  """
-  temp = cidict()
-  for elt in b:
-    temp[elt] = elt
-  result = [
-    elt
-    for elt in a
-    if not temp.has_key(elt)
-  ]
-  return result
-
-
-def strlist_intersection(a,b):
-  """
-  Return intersection of two lists of case-insensitive strings a,b.
-  """
-  temp = cidict()
-  for elt in a:
-    temp[elt] = elt
-  result = [
-    temp[elt]
-    for elt in b
-    if temp.has_key(elt)
-  ]
-  return result
-
-
-def strlist_union(a,b):
-  """
-  Return union of two lists of case-insensitive strings a,b.
-  """
-  temp = cidict()
-  for elt in a:
-    temp[elt] = elt
-  for elt in b:
-    temp[elt] = elt
-  return temp.values()
-
-
-if __debug__ and __name__ == '__main__':
-  x = { 'AbCDeF' : 123 }
-  cix = cidict(x)
-  assert cix["ABCDEF"] == 123
-  assert cix.get("ABCDEF",None) == 123
-  assert cix.get("not existent",None) is None
-  cix["xYZ"] = 987
-  assert cix["XyZ"] == 987
-  assert cix.get("XyZ",None) == 987
-  cix_keys = cix.keys()
-  cix_keys.sort()
-  assert cix_keys==['AbCDeF','xYZ'],ValueError(repr(cix_keys))
-  cix_items = cix.items()
-  cix_items.sort()
-  assert cix_items==[('AbCDeF',123),('xYZ',987)],ValueError(repr(cix_items))
-  del cix["abcdEF"]
-  assert not cix._keys.has_key("abcdef")
-  assert not cix.has_key("AbCDef")

+ 0 - 133
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/controls.py

@@ -1,133 +0,0 @@
-"""
-controls.py - support classes for LDAP controls
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: controls.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
-
-Description:
-The ldap.controls module provides LDAPControl classes.
-Each class provides support for a certain control.
-"""
-
-from ldap import __version__
-
-__all__ = [
-  'LDAPControl',
-]
-
-
-from types import ClassType
-
-import _ldap,ldap
-
-
-class LDAPControl:
-  """
-  Base class for all LDAP controls
-  """
-
-  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
-    self.controlType = controlType
-    self.criticality = criticality
-    self.controlValue = controlValue or self.decodeControlValue(encodedControlValue)
-
-  def __repr__(self):
-    return '%s(%s,%s,%s)' % (self.__class__.__name__,self.controlType,self.criticality,self.controlValue)
-
-  def encodeControlValue(self,value):
-    return value
-
-  def decodeControlValue(self,encodedValue):
-    return encodedValue
-
-  def getEncodedTuple(self):
-    return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue))
-
-
-class BooleanControl(LDAPControl):
-  """
-  Base class for simple controls with booelan control value
-
-  In this base class controlValue has to be passed as
-  boolean type (True/False or 1/0).
-  """
-  boolean2ber = { 1:'\x01\x01\xFF', 0:'\x01\x01\x00' }
-  ber2boolean = { '\x01\x01\xFF':1, '\x01\x01\x00':0 }
-
-  def encodeControlValue(self,value):
-    return self.boolean2ber[int(value)]
-
-  def decodeControlValue(self,encodedValue):
-    return self.ber2boolean[encodedValue]
-
-
-class SimplePagedResultsControl(LDAPControl):
-  """
-  LDAP Control Extension for Simple Paged Results Manipulation
-
-  see RFC 2696
-  """
-  controlType = ldap.LDAP_CONTROL_PAGE_OID
-
-  def __init__(self,controlType,criticality,controlValue=None,encodedControlValue=None):
-    LDAPControl.__init__(self,ldap.LDAP_CONTROL_PAGE_OID,criticality,controlValue,encodedControlValue)
-
-  def encodeControlValue(self,value):
-    size,cookie = value
-    return _ldap.encode_page_control(size,cookie)
-
-  def decodeControlValue(self,encodedValue):
-    size,cookie = _ldap.decode_page_control(encodedValue)
-    return size,cookie
-
-
-class MatchedValuesControl(LDAPControl):
-  """
-  LDAP Matched Values control, as defined in RFC 3876
-
-  from ldap.controls import MatchedValuesControl
-  control = MatchedValuesControl(criticality, filter)
-  """
-  
-  controlType = ldap.LDAP_CONTROL_VALUESRETURNFILTER
-  
-  def __init__(self, criticality, controlValue=None):
-    LDAPControl.__init__(self, self.controlType, criticality, controlValue, None) 
-
-  def encodeControlValue(self, value):
-    return _ldap.encode_valuesreturnfilter_control(value)
-
-
-def EncodeControlTuples(ldapControls):
-  """
-  Return list of readily encoded 3-tuples which can be directly
-  passed to C module _ldap
-  """
-  if ldapControls is None:
-    return None
-  else:
-    result = [
-      c.getEncodedTuple()
-      for c in ldapControls
-    ]
-    return result
-
-
-def DecodeControlTuples(ldapControlTuples):
-  """
-  Return list of readily encoded 3-tuples which can be directly
-  passed to C module _ldap
-  """
-  return [
-    knownLDAPControls.get(controlType,LDAPControl)
-      (controlType,criticality,encodedControlValue=encodedControlValue)
-    for controlType,criticality,encodedControlValue in ldapControlTuples or []
-  ]
-
-# Build a dictionary of known LDAPControls
-knownLDAPControls = {}
-for symbol_name in dir():
-  c = eval(symbol_name)
-  if type(c) is ClassType and hasattr(c,'controlType'):
-    knownLDAPControls[c.controlType] = c

+ 0 - 110
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/dn.py

@@ -1,110 +0,0 @@
-"""
-dn.py - misc stuff for handling distinguished names (see RFC 4514)
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: dn.py,v 1.9 2009/07/26 11:09:58 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+
-"""
-
-from ldap import __version__
-
-
-import _ldap
-
-import ldap.functions
-
-
-def escape_dn_chars(s):
-  """
-  Escape all DN special characters found in s
-  with a back-slash (see RFC 4514, section 2.4)
-  """
-  if s:
-    s = s.replace('\\','\\\\')
-    s = s.replace(',' ,'\\,')
-    s = s.replace('+' ,'\\+')
-    s = s.replace('"' ,'\\"')
-    s = s.replace('<' ,'\\<')
-    s = s.replace('>' ,'\\>')
-    s = s.replace(';' ,'\\;')
-    s = s.replace('=' ,'\\=')
-    s = s.replace('\000' ,'\\\000')    
-    if s[0]=='#' or s[0]==' ':
-      s = ''.join(('\\',s))
-    if s[-1]==' ':
-      s = ''.join((s[:-1],'\\ '))
-  return s
-
-
-def str2dn(dn,flags=0):
-  """
-  This function takes a DN as string as parameter and returns
-  a decomposed DN. It's the inverse to dn2str().
-  
-  flags describes the format of the dn
-
-  See also the OpenLDAP man-page ldap_str2dn(3)
-  """
-  if not dn:
-    return []
-  return ldap.functions._ldap_function_call(_ldap.str2dn,dn,flags)
-
-
-def dn2str(dn):
-  """
-  This function takes a decomposed DN as parameter and returns
-  a single string. It's the inverse to str2dn() but will always
-  return a DN in LDAPv3 format compliant to RFC 4514.
-  """
-  return ','.join([
-    '+'.join([
-      '='.join((atype,escape_dn_chars(avalue or '')))
-      for atype,avalue,dummy in rdn])
-    for rdn in dn
-  ])
-
-def explode_dn(dn,notypes=0,flags=0):
-  """
-  explode_dn(dn [, notypes=0]) -> list
-  
-  This function takes a DN and breaks it up into its component parts.
-  The notypes parameter is used to specify that only the component's
-  attribute values be returned and not the attribute types.
-  """
-  if not dn:
-    return []
-  dn_decomp = str2dn(dn,flags)
-  rdn_list = []
-  for rdn in dn_decomp:
-    if notypes:
-      rdn_list.append('+'.join([
-        escape_dn_chars(avalue or '')
-	for atype,avalue,dummy in rdn
-      ]))
-    else:
-      rdn_list.append('+'.join([
-        '='.join((atype,escape_dn_chars(avalue or '')))
-	for atype,avalue,dummy in rdn
-      ]))
-  return rdn_list
-
-
-def explode_rdn(rdn,notypes=0,flags=0):
-  """
-  explode_rdn(rdn [, notypes=0]) -> list
-  
-  This function takes a RDN and breaks it up into its component parts
-  if it is a multi-valued RDN.
-  The notypes parameter is used to specify that only the component's
-  attribute values be returned and not the attribute types.
-  """
-  if not rdn:
-    return []
-  rdn_decomp = str2dn(rdn,flags)[0]
-  if notypes:
-    return [avalue or '' for atype,avalue,dummy in rdn_decomp]
-  else:
-    return ['='.join((atype,escape_dn_chars(avalue or ''))) for atype,avalue,dummy in rdn_decomp]

+ 0 - 56
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/filter.py

@@ -1,56 +0,0 @@
-"""
-filters.py - misc stuff for handling LDAP filter strings (see RFC2254)
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: filter.py,v 1.7 2009/07/26 11:09:58 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+
-"""
-
-from ldap import __version__
-
-
-def escape_filter_chars(assertion_value,escape_mode=0):
-  """
-  Replace all special characters found in assertion_value
-  by quoted notation.
-  
-  escape_mode
-  	If 0 only special chars mentioned in RFC 2254
-	are escaped.
-  	If 1 all NON-ASCII chars are escaped.
-  	If 2 all chars are escaped.
-  """
-  if escape_mode:
-    r = []
-    if escape_mode==1:
-      for c in assertion_value:
-	if c < '0' or c > 'z' or c in "\\*()":
-          c = "\\%02x" % ord(c)
-	r.append(c)
-    elif escape_mode==2:
-      for c in assertion_value:
-	r.append("\\%02x" % ord(c))
-    else:
-      raise ValueError('escape_mode must be 0, 1 or 2.')
-    s = ''.join(r)
-  else:
-    s = assertion_value.replace('\\', r'\5c')
-    s = s.replace(r'*', r'\2a')
-    s = s.replace(r'(', r'\28')
-    s = s.replace(r')', r'\29')
-    s = s.replace('\x00', r'\00')
-  return s 
-
-
-def filter_format(filter_template,assertion_values):
-  """
-  filter_template
-        String containing %s as placeholder for assertion values.
-  assertion_values
-        List or tuple of assertion values. Length must match
-        count of %s in filter_template.
-  """
-  return filter_template % (tuple(map(escape_filter_chars,assertion_values)))

+ 0 - 124
desktop/core/ext-py/python-ldap-2.3.11/Lib/ldap/functions.py

@@ -1,124 +0,0 @@
-"""
-functions.py - wraps functions of module _ldap
-
-See http://www.python-ldap.org/ for details.
-
-\$Id: functions.py,v 1.24 2009/09/15 13:31:29 stroeder Exp $
-
-Compability:
-- Tested with Python 2.0+ but should work with Python 1.5.x
-- functions should behave exactly the same like in _ldap
-
-Usage:
-Directly imported by ldap/__init__.py. The symbols of _ldap are
-overridden.
-
-Thread-lock:
-Basically calls into the LDAP lib are serialized by the module-wide
-lock _ldapmodule_lock.
-"""
-
-from ldap import __version__
-
-__all__ = [
-  'open','initialize','init',
-  'explode_dn','explode_rdn',
-  'get_option','set_option',
-]
-
-import sys,_ldap,ldap
-
-from ldap import LDAPError
-
-from ldap.dn import explode_dn,explode_rdn
-
-from ldap.ldapobject import LDAPObject
-
-if __debug__:
-  # Tracing is only supported in debugging mode
-  import traceback
-
-def _ldap_function_call(func,*args,**kwargs):
-  """
-  Wrapper function which locks calls to func with via
-  module-wide ldap_lock
-  """
-  if __debug__:
-    if ldap._trace_level>=1:
-      ldap._trace_file.write('*** %s.%s (%s,%s)\n' % (
-        '_ldap',repr(func),
-        repr(args),repr(kwargs)
-      ))
-      if ldap._trace_level>=3:
-        traceback.print_stack(limit=ldap._trace_stack_limit,file=ldap._trace_file)
-  ldap._ldap_module_lock.acquire()
-  try:
-    try:
-      result = func(*args,**kwargs)
-    finally:
-      ldap._ldap_module_lock.release()
-  except LDAPError,e:
-    if __debug__ and ldap._trace_level>=2:
-      ldap._trace_file.write('=> LDAPError: %s\n' % (str(e)))
-    raise
-  if __debug__ and ldap._trace_level>=2:
-    if result!=None and result!=(None,None):
-      ldap._trace_file.write('=> result: %s\n' % (repr(result)))
-  return result
-
-
-def initialize(uri,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None):
-  """
-  Return LDAPObject instance by opening LDAP connection to
-  LDAP host specified by LDAP URL
-  
-  Parameters:
-  uri
-        LDAP URL containing at least connection scheme and hostport,
-        e.g. ldap://localhost:389
-  trace_level
-        If non-zero a trace output of LDAP calls is generated.
-  trace_file
-        File object where to write the trace output to.
-        Default is to use stdout.
-  """
-  return LDAPObject(uri,trace_level,trace_file,trace_stack_limit)
-
-
-def open(host,port=389,trace_level=0,trace_file=sys.stdout,trace_stack_limit=None):
-  """
-  Return LDAPObject instance by opening LDAP connection to
-  specified LDAP host
-  
-  Parameters:
-  host
-        LDAP host and port, e.g. localhost
-  port
-        integer specifying the port number to use, e.g. 389
-  trace_level
-        If non-zero a trace output of LDAP calls is generated.
-  trace_file
-        File object where to write the trace output to.
-        Default is to use stdout.
-  """
-  return initialize('ldap://%s:%d' % (host,port),trace_level,trace_file,trace_stack_limit)
-
-init = open
-
-
-def get_option(option):
-  """
-  get_option(name) -> value
-
-  Get the value of an LDAP global option.
-  """
-  return _ldap_function_call(_ldap.get_option,option)
-
-
-def set_option(option,invalue):
-  """
-  set_option(name, value)
-  
-  Set the value of an LDAP global option.
-  """
-  _ldap_function_call(_ldap.set_option,option,invalue)

Some files were not shown because too many files changed in this diff