User:Kevin Reid/Task list updater.e: Difference between revisions
m (lil bugfix for when it has no work to do) |
m (oops, hardcoded) |
||
Line 6: | Line 6: | ||
def unimpURL := <http>[`//rosettacode.org/wiki/Reports:Tasks_not_implemented_in_$lang`] |
def unimpURL := <http>[`//rosettacode.org/wiki/Reports:Tasks_not_implemented_in_$lang`] |
||
def catURL := <http>[`//rosettacode.org/mw/index.php?title=User:Kevin_Reid/ |
def catURL := <http>[`//rosettacode.org/mw/index.php?title=User:Kevin_Reid/${lang}_tasks&action=raw`] |
||
def unimpText := unimpURL.getText() |
def unimpText := unimpURL.getText() |
Revision as of 02:17, 31 January 2011
<lang e>#!/usr/bin/env rune pragma.syntax("0.9") pragma.enable("accumulator")
def [lang] := interp.getArgs()
def unimpURL := <http>[`//rosettacode.org/wiki/Reports:Tasks_not_implemented_in_$lang`] def catURL := <http>[`//rosettacode.org/mw/index.php?title=User:Kevin_Reid/${lang}_tasks&action=raw`]
def unimpText := unimpURL.getText() def catText := catURL.getText()
- kludgy...
def unimps := accum [].asSet() for rx`.*?
.*` in unimpText.split("id=\"Not_Considered\"")[0].split("\n") { _.with(title) } def catOut := stdout var toAdd := unimps.sort() var completed := [].asSet() var inCompleted := false var inClassifySection := false for line in catText.split("\n") { switch (line) { match rx`\* \[\[(@title.*?)\]\](@note.*)` { toAdd without= title if (!unimps.contains(title) && note.startOf("improve") == -1 && note.startOf("omit") == -1) { # now implemented, so don't print completed with= line } else { if (inClassifySection && toAdd.size().aboveZero()) { var add := toAdd.getElements()[0] if (add < title) { catOut.println(`* $add`) toAdd without= add } } if (inCompleted && completed.size().aboveZero()) { var add := completed.getElements()[0] if (add < line) { catOut.println(line) completed without= add } } catOut.println(line) } } match rx`\s*\s*` { inCompleted := true completed sort= () catOut.println(line) } match rx`\s*\s*` { inCompleted := false for line in completed.sort() { catOut.println(line) } completed := [].asSet() catOut.println(line) } match rx`` { inClassifySection := true catOut.println(line) } match rx`` { inClassifySection := false for title in toAdd.sort() { catOut.println(`* $title`) } catOut.println(line) } match _ { catOut.println(line) } } }</lang>