'Parse rsync\'s "ls -l" style output and return a dictionary of
database.item indexed by the "name" field.'

def _parse_output(self, output, prefix):

    regex = re.compile('-[rwx-]{9}    +(\\d+)    (\\d{4}/\\d\\d/\\d\\d    \\d\\d:\\d\\d:\\d\\d)    (.*)')
    res = {}
    for line in output.splitlines():
        match = regex.match(line)
        if match:
            groups = match.groups()
            timestamp = time.mktime(time.strptime(groups[1], '%Y/%m/%d    %H:%M:%S'))
            if prefix:
                fname = ('%s/%s' % (prefix, groups[2]))
            else:
                fname = groups[2]
            item = database.item(fname, int(groups[0]), int(timestamp))
            res[item.name] = item
    return res
