Index: session.scm ================================================================== --- session.scm +++ session.scm @@ -159,18 +159,23 @@ (configdat (if rawconfigdat (eval rawconfigdat) '())) (sroot (s:find-param 'sroot configdat)) (logfile (s:find-param 'logfile configdat)) (dbtype (s:find-param 'dbtype configdat)) (dbinit (s:find-param 'dbinit configdat)) - (domain (s:find-param 'domain configdat))) - ;; (print "configdat: ")(pp configdat) - ;; (print "sroot: " sroot " logfile: " logfile " dbtype: " dbtype " dbinit: " dbinit " domain: " domain) + (domain (s:find-param 'domain configdat)) + (page-dir (s:find-param 'page-dir-style configdat))) (if sroot (sdat-set-sroot! self sroot)) (if logfile (sdat-set-logfile! self logfile)) (if dbtype (sdat-set-dbtype! self dbtype)) (if dbinit (sdat-set-dbinit! self dbinit)) - (if domain (sdat-set-domain! self domain)))) + (if domain (sdat-set-domain! self domain)) + (sdat-set-page-dir-style! self page-dir) + ;; (print "configdat: ")(pp configdat) + ;;(session:log self "sroot: " sroot " logfile: " logfile " dbtype: " dbtype + ;; " dbinit: " dbinit " domain: " domain " page-dir-style: " page-dir) + ) + ) ;; (let ((dbtype (sdat-get-dbtype self))) ;; (print "dbtype: " dbtype) ;; (sdat-set-dbtype! self (eval dbtype)))) (define (session:setup self) @@ -546,10 +551,22 @@ (res '())) (if (eof-object? hed) res (loop (read-line p)(append res (list hed))))))) +(define (process-port p) + (let ((e (interaction-environment))) + (map + (lambda (x) + (cond + ((list? x) x) + ((string? x) x) + (else '()))) + (port-map (lambda (s) + (eval s e)) + (lambda ()(read p)))))) + ;; May 2011, putting all pages into one directory for the following reasons: ;; 1. want filename to reflect page name (emacs limitation) ;; 2. that's it! no other reason. could make it configurable ... (define (session:call-parts self page parts) (sdat-set-curr-page! self page) @@ -578,12 +595,13 @@ (begin (load control) (session:set-called! self page))) ;; move this to where it gets exectuted only once ;; + ;;(s:log "s:b yields " (s:b "blah")) (if load-view - ;; option one.: + ;; option one: ;; ;; (let ((inp (open-input-string ;; (files-read->string "/home/matt/kiatoa/stml/sugar.scm" ;; view)))) ;; (map @@ -597,24 +615,25 @@ ;; ;; option two: ;; (let* (;; (inps (map open-input-file (list view))) ;; sugar view))) (p (open-input-file view)) ;; (apply make-concatenated-port inps)) - (dat (map - (lambda (x) - (cond - ((list? x) x) - ((string? x) x) - (else '()))) - (port-map eval (lambda ()(read p)))))) + (dat (process-port p))) + ;;(map + ;; (lambda (x) + ;; (cond + ;; ((list? x) x) + ;; ((string? x) x) + ;; (else '()))) + ;; (port-map eval (lambda ()(read p)))))) ;; (map close-input-port inps) (close-input-port p) dat) (list "
Page not found " page "
")))) -(define (session:call self page) - (session:call-parts self page 'both)) +;;(define (session:call self page) +;; (session:call-parts self page 'both)) (define (session:call self page parts) (session:call-parts self page 'both)) (define (session:load-model self model) Index: setup.scm ================================================================== --- setup.scm +++ setup.scm @@ -44,11 +44,11 @@ (define (s:delete-session) (session:delete-session s:session (sdat-get-session-key s:session))) (define (s:call page . partsl) (if (null? partsl) - (session:call s:session page) + (session:call s:session page #f) (session:call s:session page (car partsl)))) (define (s:link-to page . params) (session:link-to s:session page params))