summaryrefslogtreecommitdiff
path: root/im/cgi-bin/imditherconf.cgi
blob: 8e7b7f27e26b6bb02881694b7fcc9c6495d6fe61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();