From 03ab07a650b34595eae6803f41f0ce4525e3388c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 16 Jul 2010 23:10:32 +0200 Subject: [PATCH] Allow server_names with and without trailing slashes. --- scripts/lodgeit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/lodgeit.py b/scripts/lodgeit.py index 38aa0d2..ed185b9 100755 --- a/scripts/lodgeit.py +++ b/scripts/lodgeit.py @@ -17,7 +17,7 @@ open_browser=true/false encoding=fallback_charset - :authors: 2007-2008 Georg Brandl , + :authors: 2007-2010 Georg Brandl , 2006 Armin Ronacher , 2006 Matt Good , 2005 Raphael Slinckx @@ -108,7 +108,7 @@ def get_xmlrpc_service(): import xmlrpclib if _xmlrpc_service is None: try: - _xmlrpc_service = xmlrpclib.ServerProxy(_server_name + '/xmlrpc/', + _xmlrpc_service = xmlrpclib.ServerProxy(_server_name + 'xmlrpc/', allow_none=True) except Exception, err: fail('Could not connect to Pastebin: %s' % err, -1) @@ -286,6 +286,8 @@ def main(): # The global available server name _server_name = opts.server_name + if not _server_name.endswith('/'): + _server_name += '/' # special modes of operation: # - paste script version