Compare commits
2 Commits
4df55a9c28
...
27fc93915c
| Author | SHA1 | Date |
|---|---|---|
|
|
27fc93915c | 10 months ago |
|
|
f37f556e41 | 10 months ago |
@ -1,28 +0,0 @@
|
|||||||
|
|
||||||
(use-modules (artanis artanis)
|
|
||||||
(csv csv)
|
|
||||||
(git bindings)
|
|
||||||
(git clone)
|
|
||||||
(git repository)
|
|
||||||
(git remote)
|
|
||||||
(ice-9 popen)
|
|
||||||
(ice-9 regex)
|
|
||||||
(ice-9 string-fun)
|
|
||||||
(ice-9 textual-ports)
|
|
||||||
(ice-9 threads)
|
|
||||||
(srfi srfi-1)
|
|
||||||
(srfi srfi-11)
|
|
||||||
(srfi srfi-19)
|
|
||||||
(sxml simple)
|
|
||||||
(sxml transform)
|
|
||||||
(tk listlogic)
|
|
||||||
(tk mcron)
|
|
||||||
(tk short))
|
|
||||||
|
|
||||||
|
|
||||||
(include "./src/debugging.scm")
|
|
||||||
(include "./src/repo.scm")
|
|
||||||
(git:init)
|
|
||||||
(include "./src/associations.scm")
|
|
||||||
(include "./src/scheduler.scm")
|
|
||||||
(include "./src/spawn_interaction.scm")
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
;; Prevent the GC from collecting the associations
|
|
||||||
(define hr-syms '())
|
|
||||||
(define pc-syms '())
|
|
||||||
(define text-syms '())
|
|
||||||
|
|
||||||
(define-once $hr-tree
|
|
||||||
(csv->sxml (open-input-file path-hr-info)
|
|
||||||
#:record-sym (lambda x "hr")))
|
|
||||||
|
|
||||||
(define-once $pc-tree
|
|
||||||
(csv->sxml (open-input-file path-hr-pc-map)
|
|
||||||
#:record-sym (lambda x "pc")))
|
|
||||||
|
|
||||||
(define-syntax hr
|
|
||||||
(syntax-rules ()
|
|
||||||
((hr (($sym) (province $prov) (province_full $prov_text)
|
|
||||||
(province_short $prov_abbr) (health_region $hr_terse)
|
|
||||||
(health_region_esri $hr_full) $pop))
|
|
||||||
(begin (set! hr-syms (cons '$sym hr-syms))
|
|
||||||
(let (($text-sym (ssa> $prov "-" $hr_terse)))
|
|
||||||
(begin (set! text-syms (cons $text-sym text-syms))
|
|
||||||
(symbol-fset! $text-sym '$sym)))
|
|
||||||
(set-symbol-property! '$sym 'prov-code $prov_abbr)
|
|
||||||
(set-symbol-property! '$sym 'province $prov)
|
|
||||||
(set-symbol-property! '$sym 'terse $hr_terse)
|
|
||||||
(set-symbol-property! '$sym 'hr-full $hr_full)
|
|
||||||
(set-symbol-property! '$sym 'population $pop)))))
|
|
||||||
|
|
||||||
(define (hrinfo!)
|
|
||||||
(for-each (lambda (x) (eval x (interaction-environment)))
|
|
||||||
(pre-post-order
|
|
||||||
(cdr $hr-tree)
|
|
||||||
`((HR_UID . ,(lambda (l x) `(,(ssa> "HR" x))))
|
|
||||||
(pop . ,(lambda (l x) (string->number x)))
|
|
||||||
(*text* . ,(lambda (l x) x))
|
|
||||||
(*default* . ,(lambda x x))))))
|
|
||||||
|
|
||||||
(define-syntax pc
|
|
||||||
(syntax-rules ()
|
|
||||||
((pc (($pc) ($sym) (Prov $prov_num) (ENGNAME $eng_name)
|
|
||||||
(FRENAME $fre_name) (EstimatedPop $pop)))
|
|
||||||
(begin (set! pc-syms (cons '$pc pc-syms))
|
|
||||||
(symbol-fset! '$pc (cons '$sym (if-some (symbol-fref '$pc))))))))
|
|
||||||
|
|
||||||
(define (pcinfo!)
|
|
||||||
(for-each (lambda (x) (eval x (interaction-environment)))
|
|
||||||
(pre-post-order
|
|
||||||
(cdr $pc-tree)
|
|
||||||
`((FSA . ,(lambda (l x) `(,(ssa> "PC" x))))
|
|
||||||
(HR_UID . ,(lambda (l x) `(,(ssa> "HR" x))))
|
|
||||||
(*text* . ,(lambda (l x) x))
|
|
||||||
(*default* . ,(lambda x x))))))
|
|
||||||
|
|
||||||
(begin (hrinfo!)
|
|
||||||
(set! hr-syms (delq! 'HR9999 hr-syms))
|
|
||||||
(if test-mode?
|
|
||||||
(begin (display "Testing hr symbols") (newline)
|
|
||||||
(for-each (lambda (s) (run-hook test-hr s)) hr-syms)))
|
|
||||||
(pcinfo!)
|
|
||||||
(if test-mode?
|
|
||||||
(begin (display "Testing pc symbols") (newline)
|
|
||||||
(for-each (lambda (s) (run-hook test-pc s)) pc-syms))))
|
|
||||||
@ -1,12 +1,26 @@
|
|||||||
|
|
||||||
|
(define-module (yacswa git)
|
||||||
|
#:use-module (git bindings)
|
||||||
|
#:use-module (git clone)
|
||||||
|
#:use-module (git repository)
|
||||||
|
#:use-module (git remote)
|
||||||
|
|
||||||
|
#:export (path-hr-cases
|
||||||
|
path-hr-info
|
||||||
|
path-hr-pc-map
|
||||||
|
path-update-time
|
||||||
|
git:init
|
||||||
|
git:fetch)
|
||||||
|
)
|
||||||
|
|
||||||
(define %new-repo-url "https://github.com/ccodwg/CovidTimelineCanada")
|
(define %new-repo-url "https://github.com/ccodwg/CovidTimelineCanada")
|
||||||
(define %repo-url "https://github.com/ccodwg/Covid19Canada.git")
|
(define %repo-url "https://github.com/ccodwg/Covid19Canada.git")
|
||||||
(define %repo-dir "./repo")
|
(define %repo-dir "./repo")
|
||||||
|
|
||||||
(define path-hr-cases "./repo/timeseries_hr/cases_timeseries_hr.csv")
|
(define path-hr-cases (string-append %repo-dir "/timeseries_hr/cases_timeseries_hr.csv"))
|
||||||
(define path-hr-info "./repo/other/hr_map.csv")
|
(define path-hr-info (string-append %repo-dir "/other/hr_map.csv"))
|
||||||
(define path-hr-pc-map "./res/FSA_HR2018.csv")
|
(define path-hr-pc-map "./res/FSA_HR2018.csv")
|
||||||
(define path-update-time "./repo/update_time.txt")
|
(define path-update-time (string-append %repo-dir "/update_time.txt"))
|
||||||
|
|
||||||
(define (repo-exists?)
|
(define (repo-exists?)
|
||||||
(openable-repository? %repo-dir))
|
(openable-repository? %repo-dir))
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
(define-module (yacswa yacswa)
|
||||||
|
#:use-module (artanis artanis)
|
||||||
|
#:use-module (system repl server)
|
||||||
|
#:use-module (yacswa data)
|
||||||
|
#:use-module (yacswa routes))
|
||||||
|
|
||||||
|
|
||||||
|
;;(define repl-sock (make-unix-domain-server-socket #:path "./bc"))
|
||||||
|
;;(spawn-server repl-sock)
|
||||||
|
|
||||||
|
;; No SSL. Sad.
|
||||||
|
(display "Bringing server up...\n")
|
||||||
|
(run #:port 1665)
|
||||||
Loading…
Reference in new issue