| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 62c6137 commit 5965918
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,9 @@ def loadini(struct, configfile): | |||
| 44 | 44 | 'paste_time': 0.02, | |
| 45 | 45 | 'syntax': True, | |
| 46 | 46 | 'tab_length': 4, | |
| 47 | - 'pastebin_url': 'http://bpaste.net'}, | ||
| 47 | + 'pastebin_url': 'http://bpaste.net/xmlrpc/', | ||
| 48 | + 'pastebin_show_url': 'http://bpaste.net/show/$paste_id/', | ||
| 49 | + }, | ||
| 48 | 50 | 'keyboard': { | |
| 49 | 51 | 'clear_line': 'C-u', | |
| 50 | 52 | 'clear_screen': 'C-l', | |
@@ -87,6 +89,7 @@ def loadini(struct, configfile): | |||
| 87 | 89 | struct.last_output_key = config.get('keyboard', 'last_output') | |
| 88 | 90 | ||
| 89 | 91 | struct.pastebin_url = config.get('general', 'pastebin_url') | |
| 92 | + struct.pastebin_show_url = config.get('general', 'pastebin_show_url') | ||
| 90 | 93 | ||
| 91 | 94 | color_scheme_name = config.get('general', 'color_scheme') | |
| 92 | 95 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,8 @@ | |||
| 35 | 35 | from glob import glob | |
| 36 | 36 | from itertools import takewhile | |
| 37 | 37 | from locale import getpreferredencoding | |
| 38 | - from urlparse import urljoin | ||
| 38 | + from string import Template | ||
| 39 | + from urllib import quote as urlquote | ||
| 39 | 40 | from xmlrpclib import ServerProxy, Error as XMLRPCError | |
| 40 | 41 | ||
| 41 | 42 | from pygments.lexers import PythonLexer | |
@@ -589,8 +590,7 @@ def write2file(self): | |||
| 589 | 590 | def pastebin(self): | |
| 590 | 591 | """Upload to a pastebin and display the URL in the status bar.""" | |
| 591 | 592 | ||
| 592 | - pasteservice_url = OPTS.pastebin_url | ||
| 593 | - pasteservice = ServerProxy(urljoin(pasteservice_url, '/xmlrpc/')) | ||
| 593 | + pasteservice = ServerProxy(OPTS.pastebin_url) | ||
| 594 | 594 | ||
| 595 | 595 | s = self.getstdout() | |
| 596 | 596 | ||
@@ -601,7 +601,9 @@ def pastebin(self): | |||
| 601 | 601 | self.statusbar.message('Upload failed: %s' % (str(e), ) ) | |
| 602 | 602 | return | |
| 603 | 603 | ||
| 604 | - paste_url = urljoin(pasteservice_url, '/show/%s/' % (paste_id, )) | ||
| 604 | + paste_url_template = Template(OPTS.pastebin_show_url) | ||
| 605 | + paste_id = urlquote(paste_id) | ||
| 606 | + paste_url = paste_url_template.safe_substitute(paste_id=paste_id) | ||
| 605 | 607 | self.statusbar.message('Pastebin URL: %s' % (paste_url, ), 10) | |
| 606 | 608 | ||
| 607 | 609 | def make_list(self, items): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments