diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-02-13 01:33:31 -0800 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-02-13 01:33:31 -0800 |
| commit | 4100860d10e2fb015db01d22bbf3f4735bcf10ec (patch) | |
| tree | 995b51fe3f8a6fe7fb58938c83463f3b09b5ee7c /impattern/im/cgi-bin/imditherconf.cgi | |
first
Diffstat (limited to 'impattern/im/cgi-bin/imditherconf.cgi')
| -rwxr-xr-x | impattern/im/cgi-bin/imditherconf.cgi | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/impattern/im/cgi-bin/imditherconf.cgi b/impattern/im/cgi-bin/imditherconf.cgi new file mode 100755 index 0000000..8e7b7f2 --- /dev/null +++ b/impattern/im/cgi-bin/imditherconf.cgi @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +from subprocess import * +import re +print "Content-type: text/html\n\n" +DITHERDIR = "/home/pepper/im/imdither/dithers"; + + +def get_ditherfiles(): + filesString = Popen(["ls", DITHERDIR], stdout=PIPE).communicate()[0] + files = filesString.split("\n"); + #javascript = "var ditherfiles = [" + javascript = "[" + for i in files: + if not i: + continue + javascript += "\"%s\", " % (i); + + javascript = javascript[:-2] + javascript += "]"; + return javascript +print get_ditherfiles(); + |
