annotate bin/url @ 10000:20ae0b28393e
<izabera> ` echo \'sed "s/./& /g;s/.*/20k&p/" <<< "$*" | dc\' > bin/unaryrpn; chmod +x bin/unaryrpm; unaryrpm 111+/
author |
HackBot |
date |
Tue, 20 Dec 2016 23:17:40 +0000 |
parents |
c989a1669243 |
children |
bae4827d5de8 |
rev |
line source |
9075
|
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/file/tip/" +
|
|
12 urllib.quote(f))
|