1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-27 08:23:49 +03:00

r26628: python: Add more documentation, simplify code in Samba3 module.

This commit is contained in:
Jelmer Vernooij
2007-12-29 18:14:15 -06:00
committed by Stefan Metzmacher
parent 2596b479ab
commit 3c329ee73d
7 changed files with 175 additions and 87 deletions

View File

@@ -159,11 +159,19 @@ class Ldb(ldb.Ldb):
self.add_ldif(open(ldif_path, 'r').read())
def add_ldif(self, ldif):
"""Add data based on a LDIF string.
:param ldif: LDIF text.
"""
for changetype, msg in self.parse_ldif(ldif):
assert changetype == ldb.CHANGETYPE_NONE
self.add(msg)
def modify_ldif(self, ldif):
"""Modify database based on a LDIF string.
:param ldif: LDIF text.
"""
for (changetype, msg) in self.parse_ldif(ldif):
assert changetype == ldb.CHANGETYPE_MODIFY
self.modify(msg)