comparison bin/hurl @ 9142:d0c60ac05f54

<oerjan> ` cp bin/{,h}url; sed -i \'11s/file/log/\' bin/hurl
author HackBot
date Sun, 02 Oct 2016 17:24:51 +0000
parents
children cfa55b232b54
comparison
equal deleted inserted replaced
9141:f77bdda22674 9142:d0c60ac05f54
1 #!/usr/bin/env python
2 import sys, os.path, re, urllib
3 if len(sys.argv) <= 1:
4 print "http://codu.org/projects/hackbot/fshg/"
5 else:
6 f = os.path.abspath(sys.argv[1])
7 f = re.sub(r"^/+hackenv/", "", f)
8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f):
9 sys.exit("File is outside web-viewable filesystem repository.")
10 else:
11 print ("http://codu.org/projects/hackbot/fshg/index.cgi/log/tip/" +
12 urllib.quote(f))