summaryrefslogtreecommitdiffstats
path: root/list.cgi
blob: 92dd7e296eeb0c210f86bb025a542bb3a11c3146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python

import cgi, cgitb, os, time, urllib, sch, stat
cgitb.enable()

def list_files():
    d = os.listdir(sch.repository_directory)

    for f in d:

        if f[0] == '.':
            continue
        
        st = os.stat(sch.repository_directory + "/" + f)

        if not stat.S_ISREG(st.st_mode):
            continue
        
        print '<tr><td class="checkbox"><input type="checkbox" name="fname" value="%s"></td>' % cgi.escape(f)
        print '<td class="filename"><a href="info.cgi?fname=%s">%s</a></td>' % (urllib.quote_plus(f), cgi.escape(f))
        print '<td class="filedate">%s</td></tr>' % time.strftime("%c", time.localtime(st.st_mtime))


sch.print_header("File Listing")

print '<form action="diff.cgi" method="get"><table><tr><th></th><th>File name</th><th>Modification date</th></tr>'

list_files()

print '<tr><td colspan="3" class="buttons">'

print '<input name="diff" type="submit" value="SYREP Diff"/>'

print '</td></tr></table></form>'

sch.print_footer()