code: def __delete_directory(self, directory):
          
  
          for node in itertools.chain(self.__script_editor.model.get_project_nodes(directory),
                                      self.__script_editor.model.get_directory_nodes(directory)):
              self.__script_editor.model.unregister_project_nodes(node)
              if node.family == "Directory":
                  self.__script_editor.model.unregister_project_nodes(node)
                  self.__script_editor.model.unregister_directory(node)
              elif node.family == "Project":
                  self.__script_editor.remove_project(directory)
              self.__delete_path(directory)
docs: Deletes given directory.
  
          :param directory: Directory to delete.
          :type directory: unicode