class documentation
class LDIFWriter: (source)
Constructor: LDIFWriter(output_file, base64_attrs, cols, line_sep, encoding)
Write LDIF entry or change records to file object.
Parameters | |
output | File for output |
base64 | List of attribute types to be base64-encoded in any case |
cols | Specifies how many columns a line may have before it is folded into many lines |
line | line separator |
encoding | Encoding to use for converting values to bytes. Note that the spec requires the dn field to be UTF-8 encoded, so it does not really make sense to use anything else. Default: 'utf8'. |
Method | __init__ |
Undocumented |
Method | unparse |
Write an entry or change record to the output file. |
Instance Variable | records |
Undocumented |
Method | _fold |
Output string line as one or more folded lines. |
Method | _needs |
Return True if attr_value has to be base-64 encoded. |
Method | _unparse |
Write a single attribute type/value pair. |
Method | _unparse |
No summary |
Method | _unparse |
Detect and write the changetype. |
Method | _unparse |
No summary |
Instance Variable | _base64 |
Undocumented |
Instance Variable | _cols |
Undocumented |
Instance Variable | _encoding |
Undocumented |
Instance Variable | _line |
Undocumented |
Instance Variable | _output |
Undocumented |
def __init__(self, output_file, base64_attrs=(), cols=76, line_sep=b'\n', encoding='utf8'):
(source)
¶
Undocumented
Write an entry or change record to the output file.
Parameters | |
dn:string | distinguished name |
record:Union[Dict[string, List[string]], List[Tuple]] | Either a dictionary holding an entry or a list of additions (2-tuple) or modifications (3-tuple). |
Return True if attr_value has to be base-64 encoded.
This is the case because of special chars or because attr_type is in self._base64_attrs