Bladeren bron

Keep plugin-conf-error condition with near the plugin handling code.

Brit Butler 11 jaren geleden
bovenliggende
commit
57f9aeb696
3 gewijzigde bestanden met toevoegingen van 8 en 11 verwijderingen
  1. 1 2
      plugins/twitter.lisp
  2. 0 9
      src/conditions.lisp
  3. 7 0
      src/config.lisp

+ 1 - 2
plugins/twitter.lisp

@@ -75,7 +75,6 @@ coleslaw:post and returns the tweet content.")
75 75
 
76 76
   ;; fallback to chirp for credential erros
77 77
   (chirp:account/verify-credentials)
78
-  
79 78
   (when tweet-format
80 79
     (setf *tweet-format* tweet-format)))
81 80
 
@@ -87,7 +86,7 @@ coleslaw:post and returns the tweet content.")
87 86
      :do (tweet-new-post file)))
88 87
 
89 88
 (defun tweet-new-post (file)
90
-  "Retrieve most recent post from in memory DB and publish it."
89
+  "Retrieve content matching FILE from in memory DB and publish it."
91 90
   (let ((post (coleslaw::find-content-by-path file)))
92 91
     (chirp:statuses/update (%format-post 0 post))))
93 92
 

+ 0 - 9
src/conditions.lisp

@@ -1,9 +0,0 @@
1
-(in-package :coleslaw)
2
-
3
-(define-condition plugin-conf-error ()
4
-  ((plugin :initform "Plugin":initarg :plugin :reader plugin)
5
-   (message :initform "" :initarg :message :reader message))
6
-  (:report (lambda (condition stream)
7
-             (format stream "~A: ~A" (plugin condition) (message condition))))
8
-  (:documentation "Condition to signal when the plugin is misconfigured."))
9
-

+ 7 - 0
src/config.lisp

@@ -19,6 +19,13 @@
19 19
 (defparameter *config* nil
20 20
   "A variable to store the blog configuration and plugin settings.")
21 21
 
22
+(define-condition plugin-conf-error ()
23
+  ((plugin  :initarg :plugin :reader plugin)
24
+   (message :initarg :message :reader message))
25
+  (:report (lambda (condition stream)
26
+             (format stream "~A: ~A" (plugin condition) (message condition))))
27
+  (:documentation "Condition to signal when the plugin is misconfigured."))
28
+
22 29
 (defun enable-plugin (name args)
23 30
   "Given a plugin, NAME, compile+load it and call its ENABLE function with ARGS."
24 31
   (flet ((plugin-path (sym)