|schedule add to .sched

Demo suggestion:
- vim :set autoread, :e pier/home/pub/test.sched (TODO: rename)
- http://zod.local/home/pub/test -- ordered
- add an element in vim -- still ordered
- +cat %/pub/test -- data structure, hash order
- |schedule %/pub/test ~2016.5.5..07.30.00 'new event' -- vim now ordered, reloaded alongside web
- +cat it again for good measure?
This commit is contained in:
Anton Dyudin 2015-06-17 10:54:25 -07:00
parent 8a8055ba3a
commit 60f5becaa7
6 changed files with 22 additions and 9 deletions

View File

@ -88,6 +88,7 @@
++ poke-kiln-cp (wrap poke-cp):from-kiln
++ poke-kiln-rm (wrap poke-rm):from-kiln
++ poke-kiln-mv (wrap poke-mv):from-kiln
++ poke-kiln-schedule (wrap poke-schedule):from-kiln
++ poke-will (wrap poke-will):from-helm
++ mere-kiln (wrap take-mere):from-kiln
++ mere-kiln-sync (wrap take-mere-sync):from-kiln

View File

@ -820,6 +820,8 @@
++ keel :: apply mutations
|= [cof=cafe suh=vase yom=(list (pair wing vase))]
^- (bolt vase)
%+ cool => |=([a=wing b=type *] [a b])
|.(leaf/"ford: keel {<p.suh>} {<(turn yom +)>}")
%^ maim cof
%+ slop suh
|- ^- vase
@ -960,8 +962,8 @@
=* for p.i.all
=+ raf=(fang cof for)
?: ?=(%2 -.q.raf)
%- (slog 0 leaf/"! {<`mark`for>} build failed, ignoring:" q.q.raf)
(fine cof lil)
=. q.q.raf :_(q.q.raf leaf/"! {<`mark`for>} build failed, ignoring.")
((slog 0 (flop q.q.raf)) (fine cof lil))
%+ cope `(bolt vase)`raf
|= [cof=cafe vax=vase]
%+ fine cof
@ -1023,11 +1025,12 @@
++ link :: translate
|= [cof=cafe too=mark for=mark vax=vase]
^- (bolt vase)
:: %+ cool |.(leaf/"ford: link {<too>} {<for>} {<p.vax>}")
?: =(too for) (fine cof vax)
?: |(=(%noun for) =(%$ for))
((lake too) cof vax)
%+ cope (fang cof for)
|= [cof=cafe pro=vase]
|= [cof=cafe pro=vase] ^- (bolt vase)
?: &((slob %grow p.pro) (slob too p:(slap pro [%cnzy %grow])))
%+ cope (keel cof pro [[%& 6]~ vax]~)
|= [cof=cafe pox=vase]

View File

@ -1030,7 +1030,8 @@
=+ dir=((hard arch) .^(%cy pax))
?~ q.dir [%ins val]
=+ for=((hard mark) -:(flop pax))
[%mut [for [%atom %$] .^(%cx pax)] val]
?> =(for p.val)
[%mut [for p.q.val .^(%cx pax)] val]
::
++ file :: simple file load
|= pax=path

View File

@ -0,0 +1 @@
|=([^ [where=path tym=@da eve=@t ~] ~] kiln-schedule/[where tym eve])

View File

@ -101,23 +101,30 @@
abet:abet:(merge:(work syd) ali sud gim)
::
++ do-info
|= [mez=tape pax=path tor=toro]
|= [mez=tape tor=toro]
abet:(emit:(spam leaf/mez ~) %info /kiln our tor)
::
++ poke-rm |=(a=path (do-info "removed" a (fray a)))
++ poke-rm |=(a=path (do-info "removed" (fray a)))
++ poke-cp
|= [input=path output=path]
%^ do-info "copied" input
%+ do-info "copied"
?> =(-:(flop input) -:(flop output))
(foal output -:(flop input) %noun .^(%cx input)) :: XX type
::
++ poke-mv
|= [input=path output=path]
%^ do-info "moved" input
%+ do-info "moved"
?> =(-:(flop input) -:(flop output))
%+ furl (fray output)
(foal output -:(flop input) %noun .^(%cx input))
::
++ poke-schedule
|= [where=path tym=@da eve=@t]
=. where (welp where /sched)
%+ do-info "scheduled"
=+ old=;;((map ,@da cord) (fall (file where) ~))
(foal where %sched !>((~(put by old) tym eve)))
::
++ take |=(way=wire ?>(?=([@ ~] way) (work i.way))) :: general handler
++ take-mere ::
|= [way=wire are=(each (set path) (pair term tang))]

View File

@ -3,7 +3,7 @@
::
|_ dat=(map ,@da cord)
++ grow :: convert to
|% ++ mime `^mime`[/text/x-sched (tact tape)]
|% ++ mime [/text/x-sched (tact tape)]
++ tape
(zing `wall`(turn sorted-list |=([a=@da b=cord] "{<a>} {(trip b)}\0a")))
++ elem =< ;list: *{(turn sorted-list .)}