def get(self, project_id): pdb = Projects() project = pdb.get(project_id) if project['projpath']: dirname = str(project['projpath']) if os.path.isdir(dirname): shutil.rmtree(dirname, onerror=onerror) pdb.remove(project_id) self.redirect('/')
def post(self, project_id): pdb = Projects() project = pdb.get(project_id) if project['filename']: filename = os.path.join(self.get_project_dir(), str(project['filename'])) if os.path.exists(filename): os.remove(filename) pdb.remove(project_id) self.redirect('/')
def post(self, project_id): pdb = Projects() project = pdb.get(project_id) if project['filename']: filename = os.path.join(self.get_project_dir(), str(project['filename'])) if os.path.exists(filename): os.remove(filename) pdb.remove(project_id) self.redirect('/')
def post(self, project_id): pdb = Projects() project = pdb.get(project_id) if project['projpath']: dirname = str(project['projpath']) if os.path.isdir(dirname): try: shutil.rmtree(dirname, onerror=onerror) except Exception as err: raise HTTPError(dirname, 403, err, None, None) else: pdb.remove(project_id) self.redirect('/')
def post(self, project_id): pdb = Projects() project = pdb.get(project_id) if project['projpath']: dirname = str(project['projpath']) if os.path.isdir(dirname): try: shutil.rmtree(dirname, onerror=onerror) except Exception as err: raise HTTPError(dirname, 403, err, None, None) else: pdb.remove(project_id) self.redirect('/')