[Lisppaste-cvs] CVS update: lisppaste2/README.lisp lisppaste2/irc-notification.lisp lisppaste2/package.lisp lisppaste2/variable.lisp lisppaste2/web-server.lisp

Brian Mastenbrook bmastenbrook at common-lisp.net
Sun Nov 7 21:01:53 UTC 2004


Update of /project/lisppaste/cvsroot/lisppaste2
In directory common-lisp.net:/home/bmastenbrook/lisppaste2

Modified Files:
	README.lisp irc-notification.lisp package.lisp variable.lisp 
	web-server.lisp 
Log Message:
General fixes, fix pastes made by lisppaste.el

Date: Sun Nov  7 22:01:44 2004
Author: bmastenbrook

Index: lisppaste2/README.lisp
diff -u lisppaste2/README.lisp:1.15 lisppaste2/README.lisp:1.16
--- lisppaste2/README.lisp:1.15	Wed Oct 20 22:37:50 2004
+++ lisppaste2/README.lisp	Sun Nov  7 22:01:43 2004
@@ -1,4 +1,4 @@
-;;;; $Id: README.lisp,v 1.15 2004/10/20 20:37:50 bmastenbrook Exp $
+;;;; $Id: README.lisp,v 1.16 2004/11/07 21:01:43 bmastenbrook Exp $
 ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/README.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -35,11 +35,15 @@
 (lisppaste:start-lisppaste)
 
 #-lisppaste-no-irc
-(lisppaste:start-irc-notification
- :channels '("#lisp" "#scheme" "#opendarwin" "#macdev" "#fink"
-             "#jedit" "#dylan" "#emacs" "#xemacs" "#colloquy" "#adium"
-             "#growl" "#chicken" "#quicksilver" "#svn" "#slate"
-             "#squeak" "#wiki" "#nebula" "#imgames")
- :nickname "lisppaste"
- :server "orwell.freenode.net"
- :port 6667)
+(progn
+  (lisppaste:start-irc-notification
+   :channels '("#lisp" "#scheme" "#opendarwin" "#macdev" "#fink"
+               "#jedit" "#dylan" "#emacs" "#xemacs" "#colloquy" "#adium"
+               "#growl" "#chicken" "#quicksilver" "#svn" "#slate"
+               "#squeak" "#wiki" "#nebula" "#imgames")
+   :nickname "lisppaste"
+   :server "orwell.freenode.net"
+   :port 6667)
+  (lisppaste:start-irc-notification
+   :channels '("#lisppaste" "#pearpc" "#fpc" "#hprog")
+   :nickname "lisppaste2"))


Index: lisppaste2/irc-notification.lisp
diff -u lisppaste2/irc-notification.lisp:1.3 lisppaste2/irc-notification.lisp:1.4
--- lisppaste2/irc-notification.lisp:1.3	Sun Oct 24 21:54:33 2004
+++ lisppaste2/irc-notification.lisp	Sun Nov  7 22:01:43 2004
@@ -1,4 +1,4 @@
-;;;; $Id: irc-notification.lisp,v 1.3 2004/10/24 19:54:33 bmastenbrook Exp $
+;;;; $Id: irc-notification.lisp,v 1.4 2004/11/07 21:01:43 bmastenbrook Exp $
 ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/irc-notification.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -94,6 +94,14 @@
   (setf (car (rassoc nickname *nicknames* :test #'string=))
 	(remove channel (car (rassoc nickname *nicknames* :test #'string=))
 		:test #'string=)))
+
+(defun quit-all-connections ()
+  (mapc #'(lambda (e)
+            (ignore-errors (irc:quit e)))
+        (mapcar #'cdr *connections*)))
+
+(defun hup-all-connections ()
+  (mapc #'hup-irc-connection (mapcar #'car *connections*)))
 
 (defun hup-irc-connection (nickname &optional (server *default-irc-server*))
   (ignore-errors (irc:quit (nick-connection nickname)))


Index: lisppaste2/package.lisp
diff -u lisppaste2/package.lisp:1.9 lisppaste2/package.lisp:1.10
--- lisppaste2/package.lisp:1.9	Wed Oct 20 22:22:13 2004
+++ lisppaste2/package.lisp	Sun Nov  7 22:01:43 2004
@@ -1,4 +1,4 @@
-;;;; $Id: package.lisp,v 1.9 2004/10/20 20:22:13 bmastenbrook Exp $
+;;;; $Id: package.lisp,v 1.10 2004/11/07 21:01:43 bmastenbrook Exp $
 ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/package.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -10,6 +10,7 @@
       (:use :cl #+sbcl :sb-bsd-sockets :html-encode)
     (:export :start-lisppaste :join-new-irc-channel
              :start-irc-notification :hup-irc-connection
+             :quit-all-connections :hup-all-connections
              :shut-up :un-shut-up :irc-say-help
              :kill-paste :kill-paste-annotations :kill-paste-annotation
              :display-paste-url :find-paste)))


Index: lisppaste2/variable.lisp
diff -u lisppaste2/variable.lisp:1.35 lisppaste2/variable.lisp:1.36
--- lisppaste2/variable.lisp:1.35	Sun Oct 24 21:54:33 2004
+++ lisppaste2/variable.lisp	Sun Nov  7 22:01:43 2004
@@ -1,4 +1,4 @@
-;;;; $Id: variable.lisp,v 1.35 2004/10/24 19:54:33 bmastenbrook Exp $
+;;;; $Id: variable.lisp,v 1.36 2004/11/07 21:01:43 bmastenbrook Exp $
 ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/variable.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -23,12 +23,12 @@
 
 (in-package :lisppaste)
 
-(defparameter *internal-http-port* 8081
+(defparameter *internal-http-port* 8080
   "Port lisppaste's araneida will listen on for requests from Apache.")
-(defparameter *external-http-port* 8081
+(defparameter *external-http-port* 80
   "Port lisppaste's araneida will listen on for requests from remote clients.")
 
-(defparameter *paste-site-name* "www.unmutual.info"
+(defparameter *paste-site-name* "paste.lisp.org"
   "Website we are running on (used for creating links).")
 
 (defparameter *paste-external-url*
@@ -37,7 +37,7 @@
                       :host *paste-site-name*
                       ;;; comment out this next line when running
                       ;;; behind a proxying apache
-		      :port *external-http-port*
+		      #| :port *external-http-port* |#
                       ) "/"))
 
 (defparameter *old-url* (araneida:merge-url
@@ -53,6 +53,8 @@
                                         ; be ignored when not running
                                         ; with an IRC connection
 
+(defvar *owner-email* "chandler at unmutual.info") ; the owner of this lisppaste
+
 (defvar *paste-maximum-size* 51200) ; in bytes
 
 (defvar *pastes-per-page* 50) ; for the paste list
@@ -123,6 +125,9 @@
 (defparameter *recent-url*
   (araneida:merge-url *paste-external-url* "recent"))
 
+(defparameter *email-redirect-url*
+  (araneida:merge-url *paste-external-url* "email"))
+
 (defparameter *main-system-server-url* (araneida:merge-url *paste-external-url*
                                                            "system-server/"))
 
@@ -153,7 +158,6 @@
 
 (defvar *pastes* nil)
 (defvar *paste-counter* 0)
-
 (defvar *channels* '("None"))
 
 (defvar *paste-file*


Index: lisppaste2/web-server.lisp
diff -u lisppaste2/web-server.lisp:1.68 lisppaste2/web-server.lisp:1.69
--- lisppaste2/web-server.lisp:1.68	Wed Oct 20 22:37:50 2004
+++ lisppaste2/web-server.lisp	Sun Nov  7 22:01:43 2004
@@ -1,4 +1,4 @@
-;;;; $Id: web-server.lisp,v 1.68 2004/10/20 20:37:50 bmastenbrook Exp $
+;;;; $Id: web-server.lisp,v 1.69 2004/11/07 21:01:43 bmastenbrook Exp $
 ;;;; $Source: /project/lisppaste/cvsroot/lisppaste2/web-server.lisp,v $
 
 ;;;; See the LICENSE file for licensing information.
@@ -14,7 +14,7 @@
    (annotations :initarg :annotations :initform nil :accessor paste-annotations)
    (annotation-counter :initarg :annotation-counter :initform 0 :accessor paste-annotation-counter)
    (channel :initarg :channel :initform "" :accessor paste-channel)
-   (colorization-mode :initarg :colorization-mode :initform :none :accessor paste-colorization-mode)))
+   (colorization-mode :initarg :colorization-mode :initform "" :accessor paste-colorization-mode)))
 
 (defun paste-display-url (paste)
   (araneida:urlstring (araneida:merge-url *display-paste-url* (prin1-to-string (paste-number paste)))))
@@ -50,6 +50,8 @@
 
 (defclass stats-handler (lisppaste-basic-handler) ())
 
+(defclass email-redirect-handler (lisppaste-basic-handler) ())
+
 (defvar *referer-hash* (make-hash-table :test #'equalp))
 
 (defvar *referer-example-hash* (make-hash-table :test #'equalp))
@@ -81,7 +83,7 @@
                (incf (gethash "Google" *referer-hash* 0) count)))))
 
 (defmethod araneida:handle-request-response :around ((handler lisppaste-basic-handler) method request)
-  (with-open-file (*trace-output* (times-file-for-class handler)
+  (progn #+nil with-open-file #+nil (*trace-output* (times-file-for-class handler)
                                   :direction :output
                                   :if-exists :append :if-does-not-exist :create)
     (time
@@ -225,6 +227,8 @@
          "Lisppaste is graciously hosted by "
          (b ((a :href "http://www.common-lisp.net/") "common-lisp.net"))
          " - a hosting service for projects written in Common Lisp (like this one)."
+         (p)
+         "Questions? Comments? Want lisppaste in your channel? " ((a :href ,(araneida:urlstring *email-redirect-url*)) "Email me") "."
          ))
        ((td :valign top :align right)
         ((form :method post :action ,(araneida:urlstring *submit-paste-url*))
@@ -1038,6 +1042,9 @@
          (colorize-string (or
                            (araneida:body-param "colorize" (araneida:request-body request))
                            (and paste
+                                (when (eql (paste-colorization-mode paste) :none)
+                                  (setf (paste-colorization-mode paste) "")
+                                  nil)
                                 (> (length (paste-colorization-mode paste)) 0)
                                 (paste-colorization-mode paste))
                            ))
@@ -1157,6 +1164,19 @@
             (format nil "Invalid paste number ~A!" paste-number)
             ))))))
 
+(defmethod araneida:handle-request-response ((handler email-redirect-handler) method request)
+  (let ((email-url (concatenate 'string "mailto:" *owner-email*)))
+    (araneida:request-send-headers
+     request
+     :location email-url
+     :expires "Fri, 30 Oct 1998 14:19:41 GMT"
+     :pragma "no-cache"
+     :response-code 302 :response-text "Redirected")
+    (araneida:html-stream
+     (araneida:request-stream request)
+     `(html (body (h1 "Redirected"))))
+    t))
+
 (araneida:install-handler
  (araneida:http-listener-handler *paste-listener*)
  (make-instance 'new-paste-handler)
@@ -1211,3 +1231,8 @@
  (araneida:http-listener-handler *paste-listener*)
  (make-instance 'recent-handler)
  (araneida:urlstring *recent-url*) t)
+
+(araneida:install-handler
+ (araneida:http-listener-handler *paste-listener*)
+ (make-instance 'email-redirect-handler)
+ (araneida:urlstring *email-redirect-url*) t)





More information about the Lisppaste-cvs mailing list