'@type filename: C{str}
@param filename: The name of the file from which to read username and
password information.
@type delim: C{str}
@param delim: The field delimiter used in the file.
@type usernameField: C{int}
@param usernameField: The index of the username after splitting a
line on the delimiter.
@type passwordField: C{int}
@param passwordField: The index of the password after splitting a
line on the delimiter.
@type caseSensitive: C{bool}
@param caseSensitive: If true, consider the case of the username when
performing a lookup.  Ignore it otherwise.
@type hash: Three-argument callable or L{None}
@param hash: A function used to transform the plaintext password
received over the network to a format suitable for comparison
against the version stored on disk.  The arguments to the callable
are the username, the network-supplied password, and the in-file
version of the password.  If the return value compares equal to the
version stored on disk, the credentials are accepted.
@type cache: C{bool}
@param cache: If true, maintain an in-memory cache of the
contents of the password file.  On lookups, the mtime of the
file will be checked, and the file will only be re-parsed if
the mtime is newer than when the cache was generated.'

def __init__(self, filename, delim=':', usernameField=0, passwordField=1, caseSensitive=True, hash=None, cache=False):

    self.filename = filename
    self.delim = delim
    self.ufield = usernameField
    self.pfield = passwordField
    self.caseSensitive = caseSensitive
    self.hash = hash
    self.cache = cache
    if (self.hash is None):
        self.credentialInterfaces = (credentials.IUsernamePassword, credentials.IUsernameHashedPassword)
    else:
        self.credentialInterfaces = (credentials.IUsernamePassword,)
