Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/cgi-bin/getFile.py
blob: 64da1c1a156004c1b77c582e08dfb729172f33d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/python
import os, sys, subprocess
import shutil
import cgi, cgitb
from BeautifulSoup import BeautifulSoup
from path import path
cgitb.enable(display=True)
log = open('/tmp/logg','w')
print 'Content-Type:text/html\n\n'
form = cgi.FieldStorage()
f = form.getfirst('filename', default='none given')
print >> log, 'f', f
fin = open(f, 'r')
txt = fin.read()
fin.close()
txtout = txt
soup = BeautifulSoup(txtout)
print soup.prettify()
log.close()