[Yum-devel] [PATCH 1/3] Add "re_remote_url()" for testing if a url is "remote"
Mike Bonnet
mikeb at redhat.com
Tue Nov 17 17:16:49 UTC 2009
On 11/16/2009 03:08 PM, James Antill wrote:
> ---
> yum/misc.py | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/yum/misc.py b/yum/misc.py
> index ee1da35..2d0ed0f 100644
> --- a/yum/misc.py
> +++ b/yum/misc.py
> @@ -125,6 +125,11 @@ def re_full_search_needed(s):
> return True
> return False
>
> +def re_remote_url(s):
> + """ Tests if a string is a "remote" URL, http, https, ftp. """
> + return (s.startswith("http://") or s.startswith("https://") or
> + s.startswith("ftp://"))
> +
> ###########
> # Title: Remove duplicates from a sequence
> # Submitter: Tim Peters
It might be easier to pass any string containing "://" to urlgrabber. I
believe it does the right thing with local and remote urls.
More information about the Yum-devel
mailing list