comparison bin/hurl @ 10395:c1a6de70613d

<oerjan> sled bin/hurl//s,http,https,g
author HackBot
date Sat, 11 Mar 2017 01:30:40 +0000
parents cfa55b232b54
children 5a1e15fb9528
comparison
equal deleted inserted replaced
10394:ace1c1f6c46e 10395:c1a6de70613d
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 import sys, os.path, re, urllib 2 import sys, os.path, re, urllib
3 if len(sys.argv) <= 1: 3 if len(sys.argv) <= 1:
4 print "http://hackego.esolangs.org/fshg/" 4 print "https://hackego.esolangs.org/fshg/"
5 else: 5 else:
6 f = os.path.abspath(sys.argv[1]) 6 f = os.path.abspath(sys.argv[1])
7 f = re.sub(r"^/+hackenv/", "", f) 7 f = re.sub(r"^/+hackenv/", "", f)
8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f): 8 if re.match(r"/|(?:\.hg|tmp)(?:/|$)",f):
9 sys.exit("File is outside web-viewable filesystem repository.") 9 sys.exit("File is outside web-viewable filesystem repository.")
10 else: 10 else:
11 print ("http://hackego.esolangs.org/fshg/index.cgi/log/tip/" + 11 print ("https://hackego.esolangs.org/fshg/index.cgi/log/tip/" +
12 urllib.quote(f)) 12 urllib.quote(f))