def remove_file(request, filename): """Removes the file. Keyword arguments: filename (str) -- the full path to file (default '') """ status = backshell.remove_file(filename) return redirect('cd', os.path.split(filename)[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])