]> TLD Linux GIT Repositories - tld-ftp-admin.git/blob - modules/wwwcmds.py
- non-integer releases are ok in TLD
[tld-ftp-admin.git] / modules / wwwcmds.py
1 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
2
3 import wwwiface, ftpio
4
5
6 def handlecmds(options):
7     def chkbox(pkgname, value):
8         retval='<input type="checkbox" name="%s"' % pkgname
9         if value:
10             retval=retval+' checked="yes"'
11         retval=retval+'>'
12         return retval
13
14     if 'action' in options and options['action'] in actions:
15         pass
16     else:
17         wwwiface.addcontent('<form action="index.py" method="post"><table border="1">')
18         wwwiface.addcontent('<tr><td>Mv</td><td>Rm</td><td>Package</td></tr>')
19         for pkg in ftpio.gettree():
20             wwwiface.addcontent('<tr><td>%s</td><td>%s</td><td>%s</td></tr>' % (chkbox(pkg[0], pkg[1]), chkbox(pkg[0], pkg[2]), pkg[0]))
21         wwwiface.addcontent('<tr><td>&nbsp;</td><td>&nbsp;</td><td><input type="submit" value="Commit"></td></tr>')
22         wwwiface.addcontent('</table></form>')
23
24
25 actions={}
26