def do_remove_subfiles(self):
        "Remove all subfiles while keeping subdirectories in place."
        self.begin_rm()
        # Delete all subfiles from current directory.
        node = TreeviewNode.current(self.__tree)
        self.__rm_dir(self.update, node.path)
        # Build a new SizeTree to find the result.
        tree = SizeTree(self.update, node.path)
        self.begin_rm_update(tree.total_nodes)
        # Record the difference and patch the Viewtree.
        diff = tree.total_size - node.total_size
        self.patch_tree(node, tree)
        # Fix all parent nodes with the correct size.
        self.update_parents(node.parent, diff)
        self.end_rm()
Remove all subfiles while keeping subdirectories in place.
recipes/Python/577632_Directory_Pruner_1/recipe-577632.py