Megatest

Check-in [a492699b81]
Login
Overview
Comment:Better control over processing #{} vs. [] in config files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: a492699b815bd82a8e8c6b93f86b267ffeb03ef4
User & Date: matt on 2014-10-19 21:53:56
Other Links: branch diff | manifest | tags
Context
2014-10-20
00:23
Added capture and display of top script pid check-in: 4911da85d8 user: matt tags: v1.60
2014-10-19
21:53
Better control over processing #{} vs. [] in config files check-in: a492699b81 user: matt tags: v1.60
19:59
first pass attempt to do a better job on lazy loading of config files check-in: 01d8fffe0f user: mrwellan tags: v1.60
Changes

Modified configf.scm from [fd9e5911cc] to [3684e66c72].

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
				(else "(lambda (ht)(print \"ERROR\") \"ERROR\")"))))
		;; (print "fullcmd=" fullcmd)
		(if (or allow-system
			(not (member cmdtype '("system" "shell"))))
		    (with-input-from-string fullcmd
		      (lambda ()
			(set! result ((eval (read)) ht))))
		    (set! result cmd))
		(loop (conc prestr result poststr)))
	      res))
	res)))

;; Run a shell command and return the output as a string
(define (shell cmd)
  (let* ((output (cmd-run->list cmd))
	 (res    (car output))







<
|







88
89
90
91
92
93
94

95
96
97
98
99
100
101
102
				(else "(lambda (ht)(print \"ERROR\") \"ERROR\")"))))
		;; (print "fullcmd=" fullcmd)
		(if (or allow-system
			(not (member cmdtype '("system" "shell"))))
		    (with-input-from-string fullcmd
		      (lambda ()
			(set! result ((eval (read)) ht))))

		    (set! result (conc "#{(" cmdtype ") "  cmd "}")))		(loop (conc prestr result poststr)))
	      res))
	res)))

;; Run a shell command and return the output as a string
(define (shell cmd)
  (let* ((output (cmd-run->list cmd))
	 (res    (car output))
132
133
134
135
136
137
138
139
140

141

142


143
144
145
146
147
148
149
      (if cont-line ;; last character is \ 
	  (let ((nextl (read-line p)))
	    (if (not (eof-object? nextl))
		(loop (string-append (if cont-line 
					 (string-take inl (- (string-length inl) 1))
					 inl)
				     nextl))))
	  (if (and allow-processing 
		   (not (eq? allow-processing 'return-string)))

	      (configf:process-line inl ht allow-processing)

	      inl)))))



;; read a config file, returns hash table of alists

;; read a config file, returns hash table of alists
;; adds to ht if given (must be #f otherwise)
;; envion-patt is a regex spec that identifies sections that will be eval'd
;; in the environment on the fly







|
|
>
|
>
|
>
>







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
      (if cont-line ;; last character is \ 
	  (let ((nextl (read-line p)))
	    (if (not (eof-object? nextl))
		(loop (string-append (if cont-line 
					 (string-take inl (- (string-length inl) 1))
					 inl)
				     nextl))))
	  (case allow-processing ;; if (and allow-processing 
	    ;;	   (not (eq? allow-processing 'return-string)))
	    ((#t #f)
	     (configf:process-line inl ht allow-processing))
	    ((return-string)
	     inl)
	    (else
	     (configf:process-line inl ht allow-processing)))))))

;; read a config file, returns hash table of alists

;; read a config file, returns hash table of alists
;; adds to ht if given (must be #f otherwise)
;; envion-patt is a regex spec that identifies sections that will be eval'd
;; in the environment on the fly

Modified dashboard.scm from [f6eb70a199] to [28c632df2d].

974
975
976
977
978
979
980
981
982
983
984
985
986
987
988

;;======================================================================
;; S U M M A R Y 
;;======================================================================
;;
;; General info about the run(s) and megatest area
(define (dashboard:summary db)
  (let ((rawconfig        (read-config (conc *toppath* "/megatest.config") #f 'return-string)))
    (iup:vbox
     (iup:split
      #:value 500
      (iup:frame 
       #:title "General Info"
       (iup:vbox
	(iup:hbox







|







974
975
976
977
978
979
980
981
982
983
984
985
986
987
988

;;======================================================================
;; S U M M A R Y 
;;======================================================================
;;
;; General info about the run(s) and megatest area
(define (dashboard:summary db)
  (let ((rawconfig        (read-config (conc *toppath* "/megatest.config") #f #f))) ;; changed to #f since I want #{} to be expanded by [system ...] to NOT be expanded. WAS: 'return-string)))
    (iup:vbox
     (iup:split
      #:value 500
      (iup:frame 
       #:title "General Info"
       (iup:vbox
	(iup:hbox