summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-04-05 20:12:45 -0700
committercolin <colin@cicadas.surf>2023-04-05 20:12:45 -0700
commit9ee2abe0548805555bd5056c3ed1db940802bfa2 (patch)
tree4937ce9533aa2cc890d7f2906961e05d46ddacbc
parentab15bf0b61a8f7787f7a4fbd810d05904d768c0f (diff)
Hmm... I thoguth I committed some of this already
-rw-r--r--.gitignore6
-rw-r--r--fussy.asd2
-rw-r--r--fussy.el5
-rw-r--r--fussy.lisp66
-rw-r--r--package.lisp3
5 files changed, 60 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index 3f1fa72..eb4c89a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,6 @@
*~
-files/* \ No newline at end of file
+*svg
+files/*
+files/*/*
+files/*/*/*
+files/*/*/*/* \ No newline at end of file
diff --git a/fussy.asd b/fussy.asd
index 783f83e..3bf76a0 100644
--- a/fussy.asd
+++ b/fussy.asd
@@ -8,7 +8,7 @@
:serial t
:depends-on (#:hyperquirks
#:bknr.datastore
- #:lazybones
+ #:lazybones-hunchentoot
#:dexador
#:spinneret
#:lass
diff --git a/fussy.el b/fussy.el
index 7049ee2..818786c 100644
--- a/fussy.el
+++ b/fussy.el
@@ -9,7 +9,7 @@
(string= suffix
(cl-subseq str (- (length str) (length suffix))))))
-(defun fussy-is-theme-p (pkg-entry)
+ (defun fussy-is-theme-p (pkg-entry)
(let ((name (symbol-name (cl-first pkg-entry))))
(and (or (fussy-string-ends-with name "-theme")
(fussy-string-ends-with name "-themes"))
@@ -52,6 +52,9 @@ called filename."
(error (push package-name failed-to-install)))))
failed-to-install))
+(defun remove-all-themes ()
+ ())
+
(defun locate-theme-package (theme)
"Given a symbol naming a theme, find the name of the package that
the theme came from."
diff --git a/fussy.lisp b/fussy.lisp
index 2b419ee..def6d46 100644
--- a/fussy.lisp
+++ b/fussy.lisp
@@ -21,7 +21,8 @@ the emacs' reader readtable."
;; TODO: HANDLE HTTP ERRORS, HANDLE TIMEOUT, HANDLE READ ERRORS
(multiple-value-bind (stream status) (dexador:get archive :want-stream t)
(when (= 200 status)
- (let ((*readtable* (emacs-reader-readtable)))
+ (let* ((*package* (find-package :fussy))
+ (*readtable* (emacs-reader-readtable)))
(read stream)))))
(defclass/std theme-pkg (db:store-object)
@@ -123,8 +124,15 @@ differs from the theme-pkg instance already in the data store."
;; restart-case with some restarts or something later, or will
;; just catch the error in the caller of update-theme-packages
(when themes-to-update
+ ;; delete the temporary .emacs.d
+ (uiop:delete-directory-tree
+ (uiop:merge-pathnames* ".emacs.d/" (full-theme-image-directory))
+ :validate t
+ :if-does-not-exist :ignore)
+
(generate-images-for-packages
(mapcar #'archive-theme-name themes-to-update))
+
;; if we didn't error: update the db
(dolist (archive-theme themes-to-update)
(process-archive-theme archive-theme)))))
@@ -183,7 +191,10 @@ returns a list of those names."
store-directory
fussy-el
:std ""
- :documentation "These paths are by default equal to the config directory.")))
+ :documentation "These paths are by default equal to the config directory.")
+ (port :std 8888)
+ (domain :std "localhost")
+ (address :std "0.0.0.0")))
(defvar *config* nil)
@@ -215,17 +226,7 @@ are treated as such.")
:directory (full-store-directory)
:subsystems (list (make-instance 'db:store-object-subsystem)))))
-(defun start (&key config-file)
- (unless config-file
- (setf config-file
- (or (uiop:getenv "FUSSY_CONFIG")
- (asdf:system-relative-pathname :fussy "config.sexp"))))
- (setf *config*
- (load-config-from-file config-file)
- *config-directory*
- (uiop:pathname-directory-pathname config-file))
- (create-db)
- (update-theme-packages))
+
(defparameter +standard-themes+
@@ -261,8 +262,37 @@ that they are not loaded during image gen.")
(defun generate-images-for-packages (package-names)
(when package-names
(uiop:run-program
- (format-emacs-evocation-script package-names))
- ;; we delete the custom location .emacs.d directory after each run.
- ;; I'm doing this so that
- (uiop:delete-directory-tree
- (emacs-dot-d-directory) :validate t)))
+ (format-emacs-evocation-script package-names))))
+
+(defvar *server*
+ (lzb:create-server))
+
+
+
+(lzb:defendpoint* :get "/hello" () ()
+ "what in the fuck? is fucking hjappening?")
+
+ (lzb:provision-app ()
+ :title "Emacs Themes Library"
+ :content-type "text/html")
+
+
+
+(defun start (&key config-file)
+ (unless config-file
+ (setf config-file
+ (or (uiop:getenv "FUSSY_CONFIG")
+ (asdf:system-relative-pathname :fussy "config.sexp"))))
+ (setf *config*
+ (load-config-from-file config-file)
+ *config-directory*
+ (uiop:pathname-directory-pathname config-file))
+ (setf *server*
+ (lzb:create-server
+ :port (port *config*)
+ :address (address *config*)
+ :domain (domain *config*)))
+ (create-db)
+ (update-theme-packages)
+ (lzb:install-app *server* (lzb:app))
+ (lzb:start-server *server*))
diff --git a/package.lisp b/package.lisp
index 61fb793..4c4d387 100644
--- a/package.lisp
+++ b/package.lisp
@@ -3,5 +3,6 @@
(defpackage #:fussy
(:use #:cl)
(:local-nicknames (#:db #:bknr.datastore)
- (#:a #:alexandria-2))
+ (#:a #:alexandria-2)
+ (#:lzb #:lazybones))
(:import-from #:defclass-std #:defclass/std))