Mercurial > repo
comparison bin/edit @ 10394:ace1c1f6c46e
<oerjan> sled bin/edit//s,http,https,g
author | HackBot |
---|---|
date | Sat, 11 Mar 2017 01:28:38 +0000 |
parents | 8c93629c5394 |
children | 634fd0064603 |
comparison
equal
deleted
inserted
replaced
10393:5fe5f3058da2 | 10394:ace1c1f6c46e |
---|---|
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('http://hackego.esolangs.org/edit/') | 6 sys.exit('https://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 'http://hackego.esolangs.org/edit/' + urllib.quote(f) | 12 print 'https://hackego.esolangs.org/edit/' + urllib.quote(f) |