'Parse the wtmp file.'

def Parse(self, stat, file_object, knowledge_base):

    (_, _) = (stat, knowledge_base)
    users = {}
    wtmp = file_object.read(10000000)
    while wtmp:
        try:
            record = UtmpStruct(wtmp)
        except RuntimeError:
            break
        wtmp = wtmp[record.size:]
        if (record.ut_type != 7):
            continue
        record.user = record.user.split('\x00', 1)[0]
        try:
            users[record.user] = max(users[record.user], record.sec, 0)
        except KeyError:
            users[record.user] = record.sec
    for (user, last_login) in users.iteritems():
        (yield rdf_client.User(username=utils.SmartUnicode(user), last_logon=(last_login * 1000000)))
