Load the whole database.
This commit is contained in:
parent
88768aae8c
commit
ff272c3a75
1 changed files with 22 additions and 15 deletions
|
@ -325,14 +325,17 @@
|
|||
;; parsed month for later processing of student/suspend periods.
|
||||
(define (process-member-line d k v)
|
||||
(let ((ss (split-start/stop-symbol k)))
|
||||
(cond (ss
|
||||
(let ((pk (car ss))
|
||||
(pd (cadr ss)))
|
||||
(dict-set d pk
|
||||
(cons (cons pd (string->month v))
|
||||
(dict-ref d pk '())))))
|
||||
(else
|
||||
(dict-set d k v)))))
|
||||
(if ss
|
||||
(let ((pk (car ss))
|
||||
(pd (cadr ss))
|
||||
(vl (string-split v " ")))
|
||||
(if (null? vl)
|
||||
(error 'process-member-line "Missing date for start/stop symbol" k)
|
||||
(let ((ds (car vl)))
|
||||
(dict-set d pk
|
||||
(cons (cons pd (string->month ds))
|
||||
(dict-ref d pk '()))))))
|
||||
(dict-set d k v))))
|
||||
|
||||
;; Converts given key in member info dictionary from period markers
|
||||
;; list to periods.
|
||||
|
@ -410,18 +413,20 @@
|
|||
(cons 'file dfn))
|
||||
ds))))))
|
||||
|
||||
;; Adds the 'info key to all expanded index entries by loading
|
||||
;; appropriate 'file key file from the members directory.
|
||||
(define (load-members-from-expanded-index ei)
|
||||
(let loop ((ei ei)
|
||||
(mdb '()))
|
||||
(if (null? ei)
|
||||
mdb
|
||||
(let ((mi (car ei)))
|
||||
(print mi)
|
||||
(loop (cdr ei)
|
||||
(cons (dict-set mi
|
||||
'info
|
||||
(load-member-file (dict-ref mi 'file)))
|
||||
mdb))))))
|
||||
(let ((mid (load-member-file (dict-ref mi 'file))))
|
||||
(loop (cdr ei)
|
||||
(cons (dict-set mi
|
||||
'info
|
||||
mid)
|
||||
mdb)))))))
|
||||
|
||||
;; Loads all member information from given members database.
|
||||
(define (load-members)
|
||||
|
@ -453,6 +458,8 @@
|
|||
(newline)
|
||||
|
||||
;; Perform requested action
|
||||
(load-members-from-expanded-index (expand-members-raw-index (load-members-raw-index)))
|
||||
(define mdb (load-members-from-expanded-index (expand-members-raw-index (load-members-raw-index))))
|
||||
|
||||
(print mdb)
|
||||
|
||||
(print (load-member-file "trimen"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue