"""Configuration for pywasp, saved as an ini file"""
from ._cfg import _config
from ._cfg import update_license_server as _update_license_server, _runs_left
[docs]
def update_license_server(
host=None, license_id=None, activation_token=None, port=None, ca_filepath=None
):
"""Update the license server configuration
Parameters
----------
host : str, optional
Hostname or IP address with "http://" preceeding it in the case of a local license server,
or a license domain without "https://" preceding it in case of a tier license server. By
default it will not be updated
port : str or int, optional
Port number, by default it will not be updated
license_id : str, optional
License id in case of using a tier license server
activation_token: str, optional
Activation token in case of using a tier license server
ca_filepath: str, optional
filepath to a custom root CA certificate if needed.
Raises
------
ValueError
Invalid URL if it cannot be parsed or doesn't contain "http://"
ValueError
Invalid Port if it can't be represented as a digit between 0 and 65,535
"""
_update_license_server(
host, license_id, activation_token, port, _config, ca_filepath
)
[docs]
def view():
"""View the current configuration"""
print(_config)
[docs]
def get_config_filepath():
"""get path to config file
Returns
-------
pathlib.Path
Path to configuration file
"""
return _config.config_path
[docs]
def check_remaining_runs():
"""
Print details about the remaining runs for active license
"""
_runs_left()