diff --git a/cgi-bin/gopher.py b/cgi-bin/gopher.py index bfe010d..cdb710c 100644 --- a/cgi-bin/gopher.py +++ b/cgi-bin/gopher.py @@ -26,5 +26,15 @@ def figlet(tex,**opts): ct.append("-"+k) ct.append(opts[k]) ct.append(tex) - for line in subprocess.check_output(ct).decode("ascii").split("\n"): - text(line) + out(ct) + +def command_lines(ct): + for l in subprocess.check_output(ct).decode("ascii").split("\n"): + yield l + +def out(ct,f=text): + for l in command_lines(ct): + f(l) + +def command_t(ct): + out(ct) diff --git a/cgi-bin/libtest b/cgi-bin/libtest index 9f1409e..081d62f 100755 --- a/cgi-bin/libtest +++ b/cgi-bin/libtest @@ -6,3 +6,6 @@ text("") text("libgopher is a python lib for making") text("gopher CGI scripts. it defines functions") text("which allow for easy formatting of output.") +text("") +text("uptime") +command_t(["/usr/bin/uptime"])