functions Module

This module contains various mldap helper functions

functions.deprecated(message=None)[source]

Call this function with an optional message to raise a warning for a depracated function.

functions.epochFromDatetime(dt=datetime.datetime(2015, 3, 2, 1, 27, 14, 516082))[source]

Given a datetime object (defaults to now), return the windows datetime field used in the accountExpires field.

The date when the account expires. This value represents the number of 100-nanosecond intervals since January 1, 1601 (UTC). A value of 0 or 0x7FFFFFFFFFFFFFFF (9223372036854775807) indicates that the account never expires.

functions.epochToDatetime(epoch)[source]

Given the windows datetime field used in the accountExpires field, return a datetime object representing it.

The date when the account expires. This value represents the number of 100-nanosecond intervals since January 1, 1601 (UTC). A value of 0 or 0x7FFFFFFFFFFFFFFF (9223372036854775807) indicates that the account never expires.

functions.flatten(l)[source]

Given a list of no elements, return None. given a list of one element, return just the element, given a list of more than one element, return the list.

functions.now(dt=datetime.datetime(2015, 3, 2, 1, 27, 14, 516068))[source]

Return the current datetime.datetime object.

functions.unicodePasswd(str_passwd)[source]

Encode password as unicode for AD.