Tekuila¶
This is the base class which all ISP implementations inherit from.
-
class
tekuila.tekuila.
Tekuila
(apikey=None, cap=None, warn_ratio=None, verbose=False)[source]¶ Base class for parsing the ISP quota API and act upon the results.
Construct a new fetch/parser to check cap and warn levels.
Parameters: - apikey – API key for ISP
- cap – Your cap in GB
- warn – The ratio you would like a warning to be returned from check_cap in 0.0 to 1.0 ratio.
- verbose – Boolean, True to print output.
-
check_cap
(verbose=False)[source]¶ Check if cap exists, if so check if download total has been exceeded based on fetched results.
Parameters: verbose – Force print and warnings or errors. Returns: True if exceeded False otherwise.
-
check_warn
(verbose=False)[source]¶ If cap and warn limit are set, check if the user has passed the set threshold set in the config file.
Parameters: verbose – Force print any warnings or errors. Returns: True if exceeded, False otherwise.
-
fetch_data
()[source]¶ Child class must implement. Fetches the data from the ISPs API URI and set’s appropriate values see set_download_data.