The Utils functions deals with many tasks, like splitting/joining an URI, save a page, etc.
Functions List
Function Name: def utils_randstr(drift = 10, chars = None)
Parameters: drift, chars
Return: String
Abstract: Returns a string with the specified length (drift)
and the specified chars (chars). If chars is not specified this function will
select the characters randomly.
Function Name: def utils_get_dir(mydir = None)
Parameters: mydir
Return: String
Abstract: Splits a URI and gives back the directory.
Function Name: def utils_port_open(host = None, port = None)
Parameters: host, port
Return: 1 (YES) if port is open, 0 (zero/NO) if port is
close.
Abstract: Checks if port is open on host.
Function Name: def utils_split_uri(uri = None, hr = None)
Parameters: uri, hr
Return: List
Abstract: Splits a URI into several components and puts them
into a list.
Function Name: def utils_lowercase_keys(href = None)
Parameters: href
Return: Nothing
Abstract: Lower case the headers. (keys)
Function Name: def utils_find_lowercase_key(href = None,
key = None)
Parameters: href, key
Return: None on error, and a list on success
Abstract: Returns a list with the data of the key used to do
the search.
Function Name: def utils_join_uri(res = [])
Parameters: res
Return: None on error, and a string on success
Abstract: Joins the splitted URI into a string and returns
it.
Function Name: def utils_save_page(file = None, hr = None)
Parameters: file, hr
Return: 0 (NO) on error, 1 (YES) on success
Abstract: Saves the HTML page to a file.
Function Name: def utils_split_dir(uri = None, mode = 1)
Parameters: uri, mode
Return: None on error, and a list on success
Abstract: Splits a URI into a list of directories.
Function Name: def utils_join_tag(name = None, href = None)
Parameters: name, href
Return: String
Abstract: Joins a HTML tag and returns it as a string.
Function Name: def utils_dmkdir(newdir)
Parameters: newdir
Return: Nothing
Abstract: Creates a directory.
Function Name: def utils_pathjoin(*paths)
Parameters: *paths
Return: String
Abstract: Joins the path of directories and files.