

def insert_dirname(self, dirname):
    'Ensure that a specific directory exists in the breakpoint tree'
    if (not self.exists(nodify(dirname))):
        nodename = nodify(dirname)
        (parent, child) = os.path.split(dirname)
        if self.root:
            if (nodename == nodify(self.root)):
                path = nodify(child)
                base = ''
            else:
                self.insert_dirname(parent)
                base = nodify(parent)
                path = nodify(child)
        elif (child == ''):
            path = nodify(parent)
            base = ''
        else:
            self.insert_dirname(parent)
            base = nodify(parent)
            path = nodify(child)
        files = sorted(self.get_children(base), reverse=False)
        index = len([item for item in files if (item < nodify(dirname))])
        self.insert(base, index, nodename, text=path, open=True, tags=['directory'])

dataset/ETHPy150Open pybee/duvet/duvet/widgets.py FileView.insert_dirname/original