Remove encoded parameters in filename

Ubunutu places a 255 char limit on the length of a filename, so we run
out of room to store things.  And the long filenames were rather
unwieldy for tab completion
This commit is contained in:
Mark Evenson 2022-09-04 12:14:30 +02:00
parent e6b431a2fd
commit 80224ac99a
2 changed files with 30 additions and 27 deletions

View File

@ -59,28 +59,34 @@ source using 3 with linespoints pointnumber 11 title 'yes', ~
plot plot
data))) data)))
(defun gnuplot-legend (filename) (defun parameters-for (path)
(let* ((name (let* ((name
(do-urlencode:urldecode (pathname-name filename) :queryp t)) (pathname-name path))
(all-pairs (config-base
(first (make-pathname :defaults path
(split-sequence:split-sequence +filename-record-separator+ name))) :name (subseq name 0 (search
(pairs (string +filename-record-separator+)
(split-sequence:split-sequence #\space all-pairs)) name :from-end t))
(assoc-pairs :type "json"))
(loop :for pair :in pairs (config
:collecting (let ((key-value (split-sequence:split-sequence #\= pair))) (alexandria:read-file-into-string config-base))
`(,(first key-value) . ,(second key-value)))))) (j
(flet (jsown:parse config)))
((get-value (key) (values
(alexandria:assoc-value assoc-pairs key :test 'equal))) j
config-base)))
(defun gnuplot-legend (path)
(let ((jsown (parameters-for path)))
(flet ((get-value (key)
(get-path jsown key)))
(values (values
(format nil "l=~a α_1=~a α_2=~a k=~a" (format nil "l=~a α_1=~a α_2=~a k=~a"
(get-value "look_ahead") (get-value '$.consensus_settings.glacier.look_ahead)
(get-value "evidence_alpha") (get-value '$.consensus_settings.glacier.evidence_alpha)
(get-value "evidence_alpha_2") (get-value '$.consensus_settings.glacier.evidence_alpha_2)
(get-value "initial_query_size")) (get-value '$.consensus_settings.glacier.query.initial_query_size))
assoc-pairs)))) jsown))))

View File

@ -17,9 +17,7 @@ template."
(loop :for (path value) :in parameters (loop :for (path value) :in parameters
:doing :doing
(set-path jsown path value))) (set-path jsown path value)))
(let* ((parameter-string (let* ((machine
(encode-parameters jsown))
(machine
(machine-instance)) (machine-instance))
(time (time
(format nil "~a" (get-universal-time))) (format nil "~a" (get-universal-time)))
@ -27,7 +25,6 @@ template."
(string +filename-record-separator+)) (string +filename-record-separator+))
(base (base
(concatenate 'string (concatenate 'string
parameter-string separator
machine separator machine separator
time)) time))
(input-settings (input-settings