HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
app.Utils.UrlParser Class Reference
Inheritance diagram for app.Utils.UrlParser:
Collaboration diagram for app.Utils.UrlParser:

Public Member Functions

def __init__ (self)
 

Static Public Member Functions

def isValidURL (url)
 
def generateDomainUrl (url)
 
def getDomain (url)
 

Detailed Description

Definition at line 508 of file Utils.py.

Constructor & Destructor Documentation

◆ __init__()

def app.Utils.UrlParser.__init__ (   self)

Definition at line 511 of file Utils.py.

511  def __init__(self):
512  pass
513 
514 
def __init__(self)
constructor
Definition: UIDGenerator.py:19

Member Function Documentation

◆ generateDomainUrl()

def app.Utils.UrlParser.generateDomainUrl (   url)
static

Definition at line 533 of file Utils.py.

533  def generateDomainUrl(url):
534  ret = ""
535  parseUrl = urlparse.urlparse(url)
536  if UrlParser.isValidURL(url):
537  ret = parseUrl.scheme + "://" + parseUrl.netloc
538  else:
539  raise UrlParseException("Empty protocol or domain name")
540  return ret
541 
542 
Here is the caller graph for this function:

◆ getDomain()

def app.Utils.UrlParser.getDomain (   url)
static

Definition at line 548 of file Utils.py.

548  def getDomain(url):
549  auth = urlparse.urlsplit(url.strip())[1]
550  ret = (re.search('([^@]*@)?([^:]*):?(.*)', auth).groups())[1]
551  return ret
552 
553 
554 # # normalization url string use base url
555 #
556 # @param base - base url string
557 # @param url - url string
558 # @param supportProtocols - support protocol list
559 # @param log - logger instance
560 # @return already normalized url string or None - in case of bad result normalization
Here is the caller graph for this function:

◆ isValidURL()

def app.Utils.UrlParser.isValidURL (   url)
static

Definition at line 520 of file Utils.py.

520  def isValidURL(url):
521  ret = False
522  parseUrl = urlparse.urlparse(url)
523  if parseUrl.scheme != None and parseUrl.netloc != None:
524  ret = True
525  return ret
526 
527 
def isValidURL(url)
Definition: Utils.py:1637

The documentation for this class was generated from the following file: