Skip to content

Commit

Permalink
Merge pull request #281 from ardumont/0.7.3
Browse files Browse the repository at this point in the history
0.7.3
  • Loading branch information
ardumont committed Aug 14, 2015
2 parents dc77390 + cdc5fa7 commit dfbccfc
Show file tree
Hide file tree
Showing 25 changed files with 904 additions and 510 deletions.
1 change: 1 addition & 0 deletions Cask
Expand Up @@ -16,6 +16,7 @@
"org-trello-query.el"
"org-trello-backend.el"
"org-trello-proxy.el"
"org-trello-date.el"
"org-trello-buffer.el"
"org-trello-input.el"
"org-trello-controller.el"
Expand Down
14 changes: 10 additions & 4 deletions TODO.org
Expand Up @@ -5,6 +5,7 @@
* TODO Backlog
** Bug
- [ ] #240 - Preserve non-trello related tags/other meta data
- [ ] #278 - Too much checklist sync?

** Features

Expand All @@ -30,10 +31,15 @@
- [ ] #245 - Trying to sync a card: orgtrello-buffer/compute-marker: Wrong type argument: numberp, nil
- [ ] #248 - Installing from melpa (unstable) works, but then it errs on an undefined variable "error-messages"
- [ ] #263 - Colors broken in org trello
* TODO 0.7.3 [0%]
- [ ] Update version
- [ ] #277 - Improve date time policy conversion
- [ ] #278 - Too much checklist sync?

* DONE 0.7.3 [100%]
CLOSED: [2015-08-14 Fri 22:37]
- [X] Update version
- [X] Close #277 - Improve date time policy conversion
- [X] Improve release + upload to marmalade scripts
- [X] Fix flycheck warnings
- [X] Some refactoring
- [X] Release notes

* DONE 0.7.2 [100%]
CLOSED: [2015-08-05 Wed 19:26]
Expand Down
1 change: 1 addition & 0 deletions load-org-trello-tests.el
Expand Up @@ -33,6 +33,7 @@
"test/org-trello-entity-test.el"
"test/org-trello-entity-test.el"
"test/org-trello-cbx-test.el"
"test/org-trello-date-test.el"
"test/org-trello-buffer-test.el"
"test/org-trello-controller-test.el"
"test/org-trello-data-test.el"
Expand Down
1 change: 1 addition & 0 deletions load-org-trello.el
Expand Up @@ -15,6 +15,7 @@
"org-trello-backend.el"
"org-trello-entity.el"
"org-trello-cbx.el"
"org-trello-date.el"
"org-trello-buffer.el"
"org-trello-controller.el"
"org-trello-data.el"
Expand Down
42 changes: 31 additions & 11 deletions org-trello-action.el
Expand Up @@ -25,44 +25,64 @@ Return nil if no error message."
"Given a list of error messages ERROR-MSGS, compute them as a string."
(apply 'concat (--map (concat "- " it "\n") error-msgs)))

(defun orgtrello-action-controls-or-actions-then-do (control-or-action-fns fn-to-execute &optional nolog-p)
(defun orgtrello-action-controls-or-actions-then-do (control-or-action-fns
fn-to-execute
&optional nolog-p)
"If CONTROL-OR-ACTION-FNS is ok, execute the function FN-TO-EXECUTE.
If there are errors, display them (unless NOLOG-P is set)."
(if control-or-action-fns
(-if-let (error-messages (-> control-or-action-fns orgtrello-action--execute-controls orgtrello-action--filter-error-messages))
(-if-let (error-messages (-> control-or-action-fns
orgtrello-action--execute-controls
orgtrello-action--filter-error-messages))
(unless nolog-p
;; there are some trouble, we display all the error messages to help the user understand the problem
(orgtrello-log-msg orgtrello-log-error "List of errors:\n %s" (orgtrello-action--compute-error-message error-messages)))
;; there are some trouble, we display all the error messages to help
;; the user understand the problem
(orgtrello-log-msg orgtrello-log-error "List of errors:\n %s"
(orgtrello-action--compute-error-message
error-messages)))
;; ok execute the function as the controls are ok
(funcall fn-to-execute))
;; no control, we simply execute the function
(funcall fn-to-execute)))

(defun orgtrello-action-functional-controls-then-do (control-fns entity fn-to-execute &optional args)
(defun orgtrello-action-functional-controls-then-do (control-fns
entity
fn-to-execute
&optional args)
"If CONTROL-FNS are ok, pass ENTITY as parameter to FN-TO-EXECUTE.
ENTITY and ARGS are function parameter of FN-TO-EXECUTE.
If any errors are thrown during controls, then display them."
(if control-fns
(-if-let (error-messages (-> control-fns (orgtrello-action--execute-controls entity) orgtrello-action--filter-error-messages))
;; there are some trouble, we display all the error messages to help the user understand the problem
(orgtrello-log-msg orgtrello-log-error "List of errors:\n %s" (orgtrello-action--compute-error-message error-messages))
(-if-let (error-messages (-> control-fns
(orgtrello-action--execute-controls entity)
orgtrello-action--filter-error-messages))
;; there are some trouble, we display all the error messages to help
;; the user understand the problem
(orgtrello-log-msg orgtrello-log-error "List of errors:\n %s"
(orgtrello-action--compute-error-message
error-messages))
;; ok execute the function as the controls are ok
(funcall fn-to-execute entity args))
;; no control, we simply execute the function
(funcall fn-to-execute entity args)))

(defun orgtrello-action-msg-controls-or-actions-then-do (msg control-or-action-fns fn-to-execute &optional nolog-p)
(defun orgtrello-action-msg-controls-or-actions-then-do (msg
control-or-action-fns
fn-to-execute
&optional nolog-p)
"A decorator fn to display some log MSG.
Then execute some CONTROL-OR-ACTION-FNS.
If all controls are ok, then execute the parameter-less FN-TO-EXECUTE.
`(Optionally)`
if NOLOG-P is set, this will not log anything."
(unless nolog-p (orgtrello-log-msg orgtrello-log-info (concat msg "...")))
(orgtrello-action-controls-or-actions-then-do control-or-action-fns fn-to-execute nolog-p))
(orgtrello-action-controls-or-actions-then-do control-or-action-fns
fn-to-execute nolog-p))

(defun orgtrello-action--too-deep-level (entity)
"Given an ENTITY with level too deep, display an error message about it."
"Your arborescence depth is too deep. We only support up to depth 3.\nLevel 1 - card\nLevel 2 - checklist\nLevel 3 - items")
"Your arborescence depth is too deep. We only support up to depth 3.
Level 1 - card\nLevel 2 - checklist\nLevel 3 - items")

(orgtrello-log-msg orgtrello-log-debug "orgtrello-action loaded!")

Expand Down

0 comments on commit dfbccfc

Please sign in to comment.