(defvar dojo-uwsgi-process nil "If it exists, the uwsgi process corresponding to dojo-uwsgi-project. Otherwise nil.") (defun dojo-uwsgi-set-project (project) (if (not (null dojo-uwsgi-process)) (progn (delete-process dojo-uwsgi-process) (setq dojo-uwsgi-process nil) (message "Old uwsgi process stopped."))) (if (not (null project)) (progn (setq dojo-uwsgi-process (start-process "dojo-mode-uwsgi" "dojo-mode-uwsgi" "uwsgi" (concat dojo-workspace-path project "/debug.ini"))) (message "Started uwsgi process for project %s" project))) (dojo-core-window-update-js-mode-line) (force-mode-line-update t)) (defcustom dojo-uwsgi-project nil "Project, relative to the dojo-workspace-path, where a debug.ini for usage with uwsgi is located. Once this variable is set to such a project, the corresponding uwsgi process is started. The project name given in this variable may not start or end with a slash. Slashes inside are allowed." :type 'string :group 'dojo :initialize 'custom-initialize-default :set (lambda (symbol value) (dojo-uwsgi-set-project value) (if (not (null value)) (set-default symbol value)))) (defun dojo-uwsgi-set (project) (dojo-uwsgi-set-project project) (setq dojo-uwsgi-project project) (custom-set-variables (list 'dojo-uwsgi-project (format "%s" project)))) (defun dojo-uwsgi-start-cdes () (interactive) (dojo-uwsgi-set "cdes-web")) (defun dojo-uwsgi-start-esm () (interactive) (dojo-uwsgi-set "iteg-esm.web")) (defun dojo-uwsgi-start-mda () (interactive) (dojo-uwsgi-set "mda.web")) (defun dojo-uwsgi-start-obusec () (interactive) (dojo-uwsgi-set "obusec.web")) (defun dojo-uwsgi-start-rsecm () (interactive) (dojo-uwsgi-set "rsecm.web")) (defun dojo-uwsgi-start-tisgraph () (interactive) (dojo-uwsgi-set "tisgraph.web")) (defun dojo-uwsgi-stop () (interactive) (dojo-uwsgi-set nil)) (provide 'dojo-util-process)