changeset 241:2138ea478adb

Improve printing of list-collections. Ignore-this: 3073e6c1462cf98ca5752179ab6ecb1d darcs-hash:20100414191443-16a00-e2f9962b0cea652890be18297fdbd4bf7d533c84.gz committer: Jamie Forth <j.forth@gold.ac.uk>
author j.forth <j.forth@gold.ac.uk>
date Thu, 24 Feb 2011 11:23:18 +0000
parents c454b4fc9aad
children 66f9c2913ac7
files implementations/midi-db/db-select-functions.lisp implementations/midi-db/methods.lisp
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/implementations/midi-db/db-select-functions.lisp	Thu Feb 24 11:23:18 2011 +0000
+++ b/implementations/midi-db/db-select-functions.lisp	Thu Feb 24 11:23:18 2011 +0000
@@ -74,6 +74,7 @@
   #.(clsql:locally-enable-sql-reader-syntax)
   (let ((header-rows (clsql:select
 		      [collection-id]
+		      [composition-id]
 		      [filename]
 		      [timebase]
 		      [start]
@@ -94,6 +95,7 @@
   #.(clsql:locally-enable-sql-reader-syntax)
   (let ((header-rows (clsql:select
 		      [collection-id]
+		      [composition-id]
 		      [filename]
 		      [timebase]
 		      [start]
--- a/implementations/midi-db/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
+++ b/implementations/midi-db/methods.lisp	Thu Feb 24 11:23:18 2011 +0000
@@ -18,8 +18,8 @@
 			     compositions (stream *standard-output*))
   "FIXME: better formatting."
   (let ((collection-rows (%get-all-collection-headers)))
-    (flet ((print-separator (&optional (columns 77))
-	     (format stream "~% ~A"
+    (flet ((print-separator (&optional (columns 70))
+	     (format stream "~%~A~%"
 		     (make-sequence 'string columns :initial-element #\-))))
       (loop for collection-row in collection-rows
 	 do (destructuring-bind (collection-id collection-name description)
@@ -42,11 +42,10 @@
 	      collection-identifier)
 	     (%get-all-composition-headers))))
     (loop for composition-header in composition-headers
-       do (destructuring-bind (collection-id filename timebase start
-					      duration owner version
-					      creation-timestamp
-					      deletion-timestamp)
-	      composition-header
-	    (format stream "~%Collection-id: ~A filename: ~A timebase: ~A start: ~A duration: ~A owner: ~A version: ~A created: ~A deleted: ~A~%"
-		    collection-id filename timebase start duration owner
-		    version creation-timestamp deletion-timestamp)))))
+       do (destructuring-bind (collection-id composition-id filename
+       timebase start duration owner version creation-timestamp
+       deletion-timestamp) composition-header
+	    (format stream "~%Collection-id: ~A Composition-id: ~A filename: ~A timebase: ~A start: ~A duration: ~A owner: ~A version: ~A created: ~A deleted: ~A~%"
+		    collection-id composition-id filename timebase
+		    start duration owner version creation-timestamp
+		    deletion-timestamp)))))