HTTP Server for Tux Droid
util.misc.URLTools Namespace Reference

Functions

def URLCheckConnection (urlToCheck="http://www.kysoh.com")
 
def URLCheck (urlToCheck, timeout=5.0)
 
def URLGetInfos (url, timeout=5.0)
 
def URLDownloadToString (url, timeout=5.0)
 
def URLTestRequestGet (host, port, request, expectedCode=200, timeout=5.0)
 
def URLDownloadToFile (url, filePath, timeout=5.0)
 

Variables

 __author__
 
 __date__
 
 __version__
 
 __licence__
 

Function Documentation

◆ URLCheck()

def util.misc.URLTools.URLCheck (   urlToCheck,
  timeout = 5.0 
)
Check connection to an url.
@param urlToCheck: Check this url.
@param timeout: Connection timeout.
@return: The connection result.

◆ URLCheckConnection()

def util.misc.URLTools.URLCheckConnection (   urlToCheck = "http://www.kysoh.com")
Check the internet connection.
@param urlToCheck: Check connection with this url.
@return: The internet connection state.

◆ URLDownloadToFile()

def util.misc.URLTools.URLDownloadToFile (   url,
  filePath,
  timeout = 5.0 
)
Download a file from an URL.
@param url: URL of the file.
@param filePath: Output file path.
@param timeout: Connection timeout.
@return: The success result.

◆ URLDownloadToString()

def util.misc.URLTools.URLDownloadToString (   url,
  timeout = 5.0 
)
Download a file from an URL to a string.
@param url: URL.
@param timeout: Connection timeout.
@return: The data as string or None.

◆ URLGetInfos()

def util.misc.URLTools.URLGetInfos (   url,
  timeout = 5.0 
)
Retrieve informations from url.
@param url: URL.
@param timeout: Connection timeout.
@return: Informations as dictionary or None.
         ['Last-Modified', 'Content-Length']

◆ URLTestRequestGet()

def util.misc.URLTools.URLTestRequestGet (   host,
  port,
  request,
  expectedCode = 200,
  timeout = 5.0 
)
Send a request to a http server and check the result.
@host: Server host.
@port: Server port.
@request: Request.
@expectedCode: Expected server code.
@timeout: Connection timeout.
@return: A boolean.

Variable Documentation

◆ __author__

util.misc.URLTools.__author__
private

◆ __date__

util.misc.URLTools.__date__
private

◆ __licence__

util.misc.URLTools.__licence__
private

◆ __version__

util.misc.URLTools.__version__
private