diff options
-rw-r--r-- | rt-liberation-rest.el | 24 | ||||
-rw-r--r-- | rt-liberation.el | 2 |
2 files changed, 19 insertions, 7 deletions
diff --git a/rt-liberation-rest.el b/rt-liberation-rest.el index a13b039..2121aba 100644 --- a/rt-liberation-rest.el +++ b/rt-liberation-rest.el @@ -108,7 +108,6 @@ (defun rt-liber-rest-query-runner (op query-string) "Run OP on QUERY-STRING." - (message "starting REST '%s' query at %s..." op (current-time-string)) (when (or (not (stringp op)) (not (stringp query-string))) (error "bad arguments")) @@ -157,6 +156,16 @@ (rt-liber-rest-query-runner "ls" query) 'rt-liber-rest-ticketsql-runner-parser-f)) +(defun rt-liber-rest-show-process (response) + "Process and return the show query response." + (when (not (stringp response)) + (error "argument not a string")) + (with-temp-buffer + (save-excursion + (insert response)) + (rt-liber-rest-parse-http-header) + (buffer-substring (point) (point-max)))) + (defun rt-liber-rest-show-query-runner (idsublist) "Iterate over IDSUBLIST and return the collected result." (when (not (listp idsublist)) @@ -172,15 +181,18 @@ (setq c (1+ c))) (insert - (rt-liber-rest-query-runner "show" (caar ticket-ids))) - (setq ticket-ids (cdr ticket-ids)))) + (rt-liber-rest-show-process + (rt-liber-rest-query-runner "show" (caar ticket-ids)))) + (setq ticket-ids (cdr ticket-ids)) + (when ticket-ids + (insert "\n--\n")))) (buffer-substring (point-min) (point-max)))) (defun rt-liber-rest-run-show-base-query (idsublist) "Run \"show\" type query against the server with IDSUBLIST." - ;;(rt-liber-parse-answer - (rt-liber-rest-show-query-runner idsublist)) -;;#'rt-liber-ticket-base-retriever-parser-f)) + (rt-liber-parse-answer + (rt-liber-rest-show-query-runner idsublist) + #'rt-liber-ticket-base-retriever-parser-f)) (provide 'rt-liberation-rest) diff --git a/rt-liberation.el b/rt-liberation.el index 532e034..c7a3a33 100644 --- a/rt-liberation.el +++ b/rt-liberation.el @@ -1077,7 +1077,7 @@ string then that will be the name of the new buffer." (interactive "Mquery: ") (condition-case excep (rt-liber-browser-startup - (rt-liber-run-show-base-query + (rt-liber-rest-run-show-base-query (rt-liber-rest-run-ls-query query)) query new) (rt-liber-no-result-from-query-error |