Megatest

Diff
Login

Differences From Artifact [021f48e586]:

To Artifact [cf8a5ae239]:


359
360
361
362
363
364
365

366
367
368
369
370
371







372
373
374
375
376
377
378
		    ))))))
(define help
  (conc "Usage: refdb action params ...

Note: refdbdir is a path to the directory containg sheet-names.cfg

  import filename.gnumeric refdbdir   : Import a gnumeric file into a txt db directory

  edit   refdbdir                     : Edit a refdbdir using gnumeric.
  ls refdbdir                         : List the keys for specified level 
  lookup refdbdir sheetname row col   : Look up a value in the text db   
  getrownames refdb sheetname         : Get a list of row titles
  getcolnames refdb sheetname         : Get a list of column titles  








Part of the Megatest tool suite. Learn more at http://www.kiatoa.com/fossils/megatest

Version: " megatest-fossil-hash))

(define (list-sheets path)
  ;; (cond
  ;;  ((and path (not sheet)(not row)(not col))







>




|

>
>
>
>
>
>
>







359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
		    ))))))
(define help
  (conc "Usage: refdb action params ...

Note: refdbdir is a path to the directory containg sheet-names.cfg

  import filename.gnumeric refdbdir   : Import a gnumeric file into a txt db directory
  export refdbdir filename.gnumeric   : Export a refdb to a gnumeric file
  edit   refdbdir                     : Edit a refdbdir using gnumeric.
  ls refdbdir                         : List the keys for specified level 
  lookup refdbdir sheetname row col   : Look up a value in the text db   
  getrownames refdb sheetname         : Get a list of row titles
  getcolnames refdb sheetname         : Get a list of column titles

To export to other formats; first export to gnumeric then use ssconvert.

e.g. 

refdb export mydata mydata.gnumeric
ssconvert -T Gnumeric_html:html40 mydata.gnumeric mydata.html 
  
Part of the Megatest tool suite. Learn more at http://www.kiatoa.com/fossils/megatest

Version: " megatest-fossil-hash))

(define (list-sheets path)
  ;; (cond
  ;;  ((and path (not sheet)(not row)(not col))
463
464
465
466
467
468
469


470
471
472
473
474
475
476

477
478
479
480
481
482
483
     ((eq? num-params 1)
      (case action
	((edit)
	 (edit-refdb (car param)))
	((ls)
	 (map print (list-sheets (car param))))))
     ((eq? num-params 2)


      (case action
	((getrownames)(print (string-intersperse (get-rowcol-names (car param)(cadr param) car)  " ")))
	((getcolnames)(print (string-intersperse (get-rowcol-names (car param)(cadr param) cadr) " ")))
	((import)
	 (let ((fname     (car param))
	       (targname  (cadr param)))
	   (import-gnumeric-file fname targname)))))

     ((eq? num-params 4)
      (case action
	((lookup)               ;; path    section     row          col 
	 (let ((res (lookup (car param)(cadr param)(caddr param)(cadddr param))))
	   (if res 
	       (print res)
	       (begin







>
>
|
|
|
|
|
<
<
>







471
472
473
474
475
476
477
478
479
480
481
482
483
484


485
486
487
488
489
490
491
492
     ((eq? num-params 1)
      (case action
	((edit)
	 (edit-refdb (car param)))
	((ls)
	 (map print (list-sheets (car param))))))
     ((eq? num-params 2)
      (let ((param1 (car param))
	    (param2 (cadr param)))
	(case action
	  ((getrownames) (print (string-intersperse (get-rowcol-names param1 param2 car)  " ")))
	  ((getcolnames) (print (string-intersperse (get-rowcol-names param1 param2 cadr) " ")))
	  ((import)      (import-gnumeric-file param1 param2)) ;; fname targname
	  ((export)      (refdb-export param1 param2))


	  (else (print "Unrecognised command " action)(print help)))))
     ((eq? num-params 4)
      (case action
	((lookup)               ;; path    section     row          col 
	 (let ((res (lookup (car param)(cadr param)(caddr param)(cadddr param))))
	   (if res 
	       (print res)
	       (begin