Mercurial > repo
comparison bin/edit @ 11240:634fd0064603
<shachaf> sled bin/edit//s/http/https/g
author | HackBot |
---|---|
date | Wed, 08 Nov 2017 23:19:18 +0000 |
parents | ace1c1f6c46e |
children | c54ea57faa7a |
comparison
equal
deleted
inserted
replaced
11239:b832d00bc5dc | 11240:634fd0064603 |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 import sys, os.path, re, urllib | 3 import sys, os.path, re, urllib |
4 | 4 |
5 if len(sys.argv) < 2: | 5 if len(sys.argv) < 2: |
6 sys.exit('https://hackego.esolangs.org/edit/') | 6 sys.exit('httpss://hackego.esolangs.org/edit/') |
7 | 7 |
8 f = os.path.realpath(sys.argv[1]) | 8 f = os.path.realpath(sys.argv[1]) |
9 f = re.sub(r"^/+hackenv/", "", f) | 9 f = re.sub(r"^/+hackenv/", "", f) |
10 if re.match(r"/|\.hg(?:/|ignore$|$)",f): | 10 if re.match(r"/|\.hg(?:/|ignore$|$)",f): |
11 sys.exit("File is not editable.") | 11 sys.exit("File is not editable.") |
12 print 'https://hackego.esolangs.org/edit/' + urllib.quote(f) | 12 print 'httpss://hackego.esolangs.org/edit/' + urllib.quote(f) |