diff options
author | Javier Jardón <jjardon@gnome.org> | 2017-11-26 23:39:48 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2017-12-12 15:58:23 +0000 |
commit | 7df7f3b427739ff7d69da2ba218da0124822892c (patch) | |
tree | 843c75e9bede53862ab101d6a7bcd1da15a33c55 /install-files/essential-files/usr/bin/brpaste | |
parent | 7aad5150f69da42b84994c353283db5daf8e967f (diff) | |
download | definitions-7df7f3b427739ff7d69da2ba218da0124822892c.tar.gz |
Remove all .morph files and files from the old format
Diffstat (limited to 'install-files/essential-files/usr/bin/brpaste')
-rw-r--r-- | install-files/essential-files/usr/bin/brpaste | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/install-files/essential-files/usr/bin/brpaste b/install-files/essential-files/usr/bin/brpaste deleted file mode 100644 index d2f9d867..00000000 --- a/install-files/essential-files/usr/bin/brpaste +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -import urllib.request -import os -import json - -URL = 'http://paste.baserock.org/documents' - -def run(*args): - if args: - content = [open(x).read() for x in args] - extensions = [os.path.splitext(x)[1] for x in args] - else: - content = [sys.stdin.read()] - extensions = [None] - - for i, each in enumerate(content): - req = urllib.request.Request(URL, each.encode('utf-8')) - response = urllib.request.urlopen(req) - the_page = response.read().decode('utf-8') - key = json.loads(the_page)['key'] - url = "http://paste.baserock.org/%s" % key - if extensions[i]: - url += extensions[i] - print(url) - -if __name__ == '__main__': - import sys - sys.exit(run(*sys.argv[1:])) |