File: ldifcopy.py

package info (click to toggle)
python-ldap 3.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,368 kB
  • sloc: python: 9,558; ansic: 3,052; makefile: 139; sh: 79
file content (22 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
ldifcopy - reads LDIF from stdin, retrieve values by URL and
           write resulting LDIF to stdout

Written by Michael Stroeder <michael@stroeder.com>

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.
"""

import sys,ldif

infile = sys.stdin
outfile = sys.stdout

ldif_collector = ldif.LDIFCopy(
  infile,
  outfile,
  process_url_schemes=['file','ftp','http']
)
ldif_collector.parse()