def remove_directory(request, dirname): """Removes the directory. Keyword arguments: dirname (str) -- the full path to directory (default '') """ status = backshell.remove_dir(dirname) return redirect('cd', os.path.split(dirname)[0])
def remove(request, filename): """Removes the file or directory. Keyword arguments: filename (str) -- the full path to the file (default '') """ if os.path.isfile(filename): status = backshell.remove_file(filename) elif os.path.isdir(filename): status = backshell.remove_dir(filename) return redirect('cd', os.path.split(filename)[0])