cleanup added to django menu
This commit is contained in:
parent
5586dbef67
commit
2945610dbd
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue