diff --git a/apk.builder/pyMySDKWebFrontEnd/application.py b/apk.builder/pyMySDKWebFrontEnd/application.py index e51406d..9034882 100644 --- a/apk.builder/pyMySDKWebFrontEnd/application.py +++ b/apk.builder/pyMySDKWebFrontEnd/application.py @@ -30,6 +30,7 @@ (r"/workspace/([^/]*)/?", workspace.WorkspaceHandler), (r"/project/([^/]*)/([^/]*)/?", project.ProjectHandler), (r"/new/([^/]*)/?", project.NewHandler), + (r"/del/([^/]*)/([^/]*)/?", project.DelHandler), (r"/build/([^/]*)/([^/]*)/?", build.BuildHandler), (r"/build/progress/([^/]*)/([^/]*)/?", build.BuildProgressHandler), (r"/download/([^/]*)/([^/]*)/?", download.DownloadHandler), diff --git a/apk.builder/pyMySDKWebFrontEnd/handler/project.py b/apk.builder/pyMySDKWebFrontEnd/handler/project.py index 448c9ef..91d3b57 100644 --- a/apk.builder/pyMySDKWebFrontEnd/handler/project.py +++ b/apk.builder/pyMySDKWebFrontEnd/handler/project.py @@ -14,7 +14,7 @@ # limitations under the License. # -import os,sys +import os,sys,shutil from ahandler import AHandler try : import pyMySDKAPKBuilder.workspace @@ -155,3 +155,18 @@ def post(self, workspace_name) : return self.redirect("/workspace/%s" %(workspace_name)) +class DelHandler(AHandler) : + + def get(self, workspace_name, project_id) : + return self.post(workspace_name, project_id) + + + def post(self, workspace_name, project_id) : + workspace_project = self.get_workspace(workspace_name, project_id) + if workspace_project and os.path.exists(workspace_project.context["work_dir"]): + if os.path.samefile(workspace_project.context["work_dir"], workspace_project.root) : + self.application.del_workspace(workspace_project.root) + shutil.rmtree(workspace_project.context["work_dir"]) + return self.redirect("/workspace/%s" %(workspace_name)) + + diff --git a/apk.builder/pyMySDKWebFrontEnd/templates/ui/projectentry.html b/apk.builder/pyMySDKWebFrontEnd/templates/ui/projectentry.html index 37d168c..d5c8c65 100644 --- a/apk.builder/pyMySDKWebFrontEnd/templates/ui/projectentry.html +++ b/apk.builder/pyMySDKWebFrontEnd/templates/ui/projectentry.html @@ -10,16 +10,22 @@