@core_helper
def is_url(*args, **kw):
 if (not args):
  return False
 try:
  url = urlparse.urlparse(args[0])
 except ValueError:
  return False
 default_valid_schemes = ('http', 'https', 'ftp')
 valid_schemes = config.get('ckan.valid_url_schemes', '').lower().split()
 return (url.scheme in (valid_schemes or default_valid_schemes))

@ core_helper def is_url ( * args , ** kw ) : if ( not args ) : return False try : url = urlparse . urlparse ( args [ 0 ] ) except ValueError : return False default_valid_schemes = ( 'http' , 'https' , 'ftp' ) valid_schemes = config . get ( 'ckan.valid_url_schemes' , '' ) . lower ( ) . split ( ) return ( url . scheme in ( valid_schemes or default_valid_schemes ) )
return true if string is an http or ftp path .