

def get_tree(self, name=None, backup=None, root=None, agent=None):
    'See :func:`burpui.misc.backend.interface.BUIbackend.get_tree`'
    res = []
    if ((not name) or (not backup)):
        return res
    if (not root):
        top = ''
    else:
        try:
            top = root.decode('utf-8', 'replace')
        except UnicodeDecodeError:
            top = root
    filemap = self.status('c:{0}:b:{1}:p:{2}\n'.format(name, backup, top))
    useful = False
    for line in filemap:
        if ((not useful) and re.match('^-list begin-$', line)):
            useful = True
            continue
        if (useful and re.match('^-list end-$', line)):
            useful = False
            continue
        if useful:
            tree = {
                
            }
            match = re.search('^(.{10})\\s', line)
            if match:
                if re.match('^(d|l)', match.group(1)):
                    tree['type'] = 'd'
                else:
                    tree['type'] = 'f'
                spl = re.split('\\s+', line, 7)
                tree['mode'] = spl[0]
                tree['inodes'] = spl[1]
                tree['uid'] = spl[2]
                tree['gid'] = spl[3]
                tree['size'] = '{0:.1eM}'.format(_hr(spl[4]))
                tree['date'] = '{0} {1}'.format(spl[5], spl[6])
                tree['name'] = spl[7]
                tree['parent'] = top
                res.append(tree)
    return res

dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp1.py Burp.get_tree/original