From 9135a261a3cad8492cd230125e018b038af5f0b5 Mon Sep 17 00:00:00 2001 From: manugarg Date: Fri, 10 Oct 2008 10:09:17 +0000 Subject: [PATCH] Make python module also protocol independent. --- pymod/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pymod/__init__.py b/pymod/__init__.py index dc3d447e..9b4e2dd8 100644 --- a/pymod/__init__.py +++ b/pymod/__init__.py @@ -32,7 +32,7 @@ import os import re -url_regex = re.compile('(http[s]?|ftp)\:\/\/([^\/]+).*') +url_regex = re.compile('.*\:\/\/([^\/]+).*') def init(): """ @@ -56,8 +56,8 @@ def find_proxy(url, host=None): if not m: print 'URL: %s is not a valid URL' % url return None - if len(m.groups()) is 2: - host = m.groups()[1] + if len(m.groups()) is 1: + host = m.groups()[0] else: print 'URL: %s is not a valid URL' % url return None @@ -85,8 +85,8 @@ def just_find_proxy(pacfile, url, host=None): if not m: print 'URL: %s is not a valid URL' % url return None - if len(m.groups()) is 2: - host = m.groups()[1] + if len(m.groups()) is 1: + host = m.groups()[0] else: print 'URL: %s is not a valid URL' % url return None