File: util.py

package info (click to toggle)
sagemath 7.4-9
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 108,312 kB
  • ctags: 72,147
  • sloc: python: 800,328; sh: 10,775; cpp: 7,154; ansic: 2,301; objc: 1,372; makefile: 889; lisp: 1
file content (18 lines) | stat: -rw-r--r-- 323 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18



def is_url(url):
    """
    Test whether argument is url
    """
    url = url.rstrip()
    if len(url.splitlines()) > 1:
        return False
    if url.find(' ') >= 0:
        return False
    return (
        url.startswith('http://') or
        url.startswith('https://') or
        url.startswith('ftp://')
    )