From 2945610dbdb4f39ff7ff8cd185b9430e3335982b Mon Sep 17 00:00:00 2001 From: lxsameer Date: Sun, 5 Jun 2011 00:51:56 +0430 Subject: [PATCH] cleanup added to django menu --- src/lib/modes.el | 20 -------------------- src/plugins/django.el | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/lib/modes.el b/src/lib/modes.el index c2ccdfe..0f72c8f 100644 --- a/src/lib/modes.el +++ b/src/lib/modes.el @@ -90,26 +90,6 @@ can define their key bindings easily." (setq project-path (read-directory-name "Project source tree: ")) ) -(defun kuso/get-todo () - "Get a list of TODO entries from the project source tree" - (interactive) -) - -(defun kuso/cleanup () - "Remove all the unneecessary files form project." - (interactive) - (let (buffer commands) - (if (string= project-path "") - (get-project-path) - ) - (setq commands "rm -fv `find @@pp@@ -iname \"*.pyc\"` && rm -fv `find @@pp@@ -iname \"*~\"` && rm -fv `find @@pp@@ -iname \"\.#*\"` && rm -vf `find @@pp@@ -iname \"#*\"`") - (setq commands (replace-regexp-in-string "@@pp@@" project-path commands)) - (setq buffer (get-buffer-create "*Cleanup*")) - (switch-to-buffer buffer) - (start-process-shell-command "Cleanup" buffer commands) - ) - - ) ;; ---------------------------------------------------------------------- ;; Minor Modes diff --git a/src/plugins/django.el b/src/plugins/django.el index 4143662..f96bcc1 100644 --- a/src/plugins/django.el +++ b/src/plugins/django.el @@ -89,6 +89,8 @@ binding for Kuso IDE django plugin" (define-key-after global-map [menu-bar django shell] '("Project shell" . django-shell) 'manage) (define-key-after global-map [menu-bar django sep2] '("--") 'runserver-extra) (define-key-after global-map [menu-bar django pylintcheck] '("Check buffer with pylint" . pylint-check-current-buffer) 'django-shell) + (define-key-after global-map [menu-bar django cleanup] '("Cleanup source tree" . django/cleanup) 'pylintcheck) + ) (defun django/destruct-menus () @@ -177,6 +179,29 @@ binding for Kuso IDE django plugin" (manage-command "*Custom*" "custom" command) ) + +(defun django/cleanup () + "Remove all the unneecessary files form project." + (interactive) + (let (buffer commands) + (if (string= project-path "") + (get-project-path) + ) + (setq commands "rm -fv `find @@pp@@ -iname \"*.pyc\"` && rm -fv `find @@pp@@ -iname \"*~\"` && rm -fv `find @@pp@@ -iname \"\.#*\"` && rm -vf `find @@pp@@ -iname \"#*\"`") + (setq commands (replace-regexp-in-string "@@pp@@" project-path commands)) + (setq buffer (get-buffer-create "*Cleanup*")) + (switch-to-buffer buffer) + (start-process-shell-command "Cleanup" buffer commands) + ) + + ) + +(defun kuso/get-todo () + "Get a list of TODO entries from the project source tree" + (interactive) +) + + (defun pylint-check-current-buffer () "Run pylint on current buffer." (interactive)