938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
|
938
939
940
941
942
943
944
945
946
947
948
949
950
951
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
(let ((indx (hash-table-ref/default test-field-index fieldname #f)))
(if indx
(if (>= indx (vector-length datavec))
#f ;; index to high, should raise an error I suppose
(vector-ref datavec indx))
#f)))
(define (to-alist dat)
(cond
((list? dat) (map to-alist dat))
((vector? dat)
(map to-alist (vector->list dat)))
((pair? dat)
(cons (to-alist (car dat))
(to-alist (cdr dat))))
((hash-table? dat)
(map to-alist (hash-table->alist dat)))
(else
(if dat
dat
""))))
;; NOTE: list-runs and list-db-targets operate on local db!!!
;;
(if (or (args:get-arg "-list-runs")
(args:get-arg "-list-db-targets"))
(if (launch:setup-for-run)
(let* (;; (dbstruct (make-dbr:dbstruct path: *toppath* local: (args:get-arg "-local")))
(runpatt (args:get-arg "-list-runs"))
|
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
|
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
|
-
-
+
+
+
+
|
"cpuload"
"final_logf"
"shortdir"
"rundir"
"uname"
)
)
(newdat (to-alist data))
(allrundat (car (map cdr newdat))) ;; (car (map cdr (car (map cdr newdat)))))
(newdat (common:to-alist data))
(allrundat (if (null? newdat)
'()
(car (map cdr newdat)))) ;; (car (map cdr (car (map cdr newdat)))))
(runs (append
(list "runs" ;; sheetname
metadat-fields)
(map (lambda (run)
;; (print "run: " run)
(let* ((runname (car run))
(rundat (cdr run))
|
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
|
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
|
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
|
(cons runs (map car run-pages)))))
;; (print "allrundat:")
;; (pp allrundat)
;; (print "runs:")
;; (pp runs)
;(print "sheets: ")
;; (pp sheets)
(if (eq? dmode 'ods)
(let* ((tempdir (conc "/tmp/" (current-user-name) "/" (random 10000) "_" (current-process-id)))
(outputfile (or (args:get-arg "-o") "out.ods"))
(ouf (if (string-match (regexp "^[/~]+.*") outputfile) ;; full path?
outputfile
(begin
(debug:print 0 "WARNING: path given, " outputfile " is relative, prefixing with current directory")
(conc (current-directory) "/" outputfile)))))
(create-directory tempdir #t)
(if (eq? dmode 'ods)(ods:list->ods tempdir ouf sheets))
;; (system (conc "rm -rf " tempdir))
(let* ((tempdir (conc "/tmp/" (current-user-name) "/" (random 10000) "_" (current-process-id)))
(outputfile (or (args:get-arg "-o") "out.ods"))
(ouf (if (string-match (regexp "^[/~]+.*") outputfile) ;; full path?
outputfile
(begin
(debug:print 0 "WARNING: path given, " outputfile " is relative, prefixing with current directory")
(conc (current-directory) "/" outputfile)))))
(create-directory tempdir #t)
(ods:list->ods tempdir ouf sheets))))
;; (system (conc "rm -rf " tempdir))
))
(set! *didsomething* #t))))
;; Don't think I need this. Incorporated into -list-runs instead
;;
;; (if (and (args:get-arg "-since")
;; (launch:setup-for-run))
;; (let* ((since-time (string->number (args:get-arg "-since")))
|