Static Public Member Functions | |
| get_resource_key_from_config (config) | |
| set_resource_key_in_config (config, key) | |
| get_data_file_from_config (config) | |
| set_data_file_in_config (config, file) | |
| get_human_readable (device, property) | |
| Format a property value for display. | |
| get_profiles (hardware) | |
| Read the list of hardware profiles from the "hardware" element data. | |
| get_no_profiles_message () | |
| The line printed when a lookup returned no device profiles at all. | |
| get_resource_key () | |
| get_license_key () | |
| The licence key from the environment, or an empty string. | |
| get_missing_resource_key_message () | |
| The message shown when no resource key is set, naming the variable that was wanted rather than leaving the reader to guess. | |
| get_data_file_path () | |
| get_cloud_endpoint () | |
| find_file (file_name) | |
| get_data_file_date (engine) | |
| data_file_is_old (engine) | |
| get_data_file_tier (engine) | |
| is_lite_data_file (engine) | |
| True when the engine uses the free Lite data file. | |
| has_property (engine, name) | |
| True when the engine's data file has the property. | |
| get_enterprise_value (engine, device, property) | |
| Format a property for display, or say that it needs the Enterprise data file when the engine's data file does not have it. | |
| get_enterprise_note (contact_us) | |
| Where to ask for a copy of the Enterprise data file, written after an example has shown properties that the data file in use does not have. | |
| get_enterprise_offer (contact_us) | |
| What the Enterprise data file adds and where to ask for a copy, written after an example that shows no properties has run on the free Lite data file. | |
| check_data_file (pipeline, logger) | |
| Log the data file in use, and a warning if it is old. | |
Static Public Attributes | |
| int | FIND_FILES_TIMEOUT_S = 5 |
| int | DATA_FILE_AGE_WARNING = 30 |
| str | RESOURCE_KEY_ENV_VAR = "_51DEGREES_RESOURCE_KEY" |
| str | LEGACY_RESOURCE_KEY_ENV_VAR = "resource_key" |
| str | LICENSE_KEY_ENV_VAR = "_51DEGREES_LICENSE_KEY" |
| str | LEGACY_LICENSE_KEY_ENV_VAR = "license_key" |
| str | CLOUD_ENDPOINT_ENV_VAR = "_51DEGREES_CLOUD_ENDPOINT" |
| str | ENDPOINT_ENV_VAR = "cloud_endpoint" |
| str | DD_PATH_ENV_VAR = "_51DEGREES_DD_PATH" |
| str | DATA_FILE_ENV_VAR = "51DEGREES_DD_PATH" |
| DATA_FOLDER = os.path.join("cxx", "data", "device-detection") | |
| str | DOWNLOAD_SOURCE = "examples-51degrees-python" |
| str | NEEDS_ENTERPRISE = "needs the Enterprise data file" |
Member Function Documentation
◆ check_data_file()
|
static |
Log the data file in use, and a warning if it is old.
An example run on the free Lite data file says what the Enterprise data file adds in its own output.
◆ data_file_is_old()
|
static |
◆ find_file()
|
static |
◆ get_cloud_endpoint()
|
static |
◆ get_data_file_date()
|
static |
◆ get_data_file_from_config()
|
static |
◆ get_data_file_path()
|
static |
◆ get_data_file_tier()
|
static |
◆ get_enterprise_note()
|
static |
Where to ask for a copy of the Enterprise data file, written after an example has shown properties that the data file in use does not have.
The link is tagged with the example's file, so that an enquiry can be traced to the example.
◆ get_enterprise_offer()
|
static |
What the Enterprise data file adds and where to ask for a copy, written after an example that shows no properties has run on the free Lite data file.
◆ get_enterprise_value()
|
static |
Format a property for display, or say that it needs the Enterprise data file when the engine's data file does not have it.
The value is only read when the data file has the property.
◆ get_human_readable()
|
static |
Format a property value for display.
A property can be unavailable for three reasons, and each one reads differently so the person running the example can tell them apart. The property may have a value, it may have no value with the cloud service giving a reason (most often that the resource key is not entitled to it), or it may not be in the results at all.
◆ get_license_key()
|
static |
The licence key from the environment, or an empty string.
The old name is also read in upper case, as it was before.
◆ get_missing_resource_key_message()
|
static |
The message shown when no resource key is set, naming the variable that was wanted rather than leaving the reader to guess.
◆ get_no_profiles_message()
|
static |
The line printed when a lookup returned no device profiles at all.
◆ get_profiles()
|
static |
Read the list of hardware profiles from the "hardware" element data.
An empty list is returned when the resource key has no access to the hardware aspect at all, because reading a property that is not there raises rather than returning an empty list.
◆ get_resource_key()
|
static |
◆ get_resource_key_from_config()
|
static |
◆ has_property()
|
static |
True when the engine's data file has the property.
The Lite data file leaves out the properties only the Enterprise data file has, such as HardwareVendor, HardwareName and DeviceType. The data file's own list is read, because the engine's properties are only those it was built to give.
◆ is_lite_data_file()
|
static |
True when the engine uses the free Lite data file.
◆ set_data_file_in_config()
|
static |
◆ set_resource_key_in_config()
|
static |
Member Data Documentation
◆ CLOUD_ENDPOINT_ENV_VAR
|
static |
◆ DATA_FILE_AGE_WARNING
|
static |
◆ DATA_FILE_ENV_VAR
|
static |
◆ DATA_FOLDER
|
static |
◆ DD_PATH_ENV_VAR
|
static |
◆ DOWNLOAD_SOURCE
|
static |
◆ ENDPOINT_ENV_VAR
|
static |
◆ FIND_FILES_TIMEOUT_S
|
static |
◆ LEGACY_LICENSE_KEY_ENV_VAR
|
static |
◆ LEGACY_RESOURCE_KEY_ENV_VAR
|
static |
◆ LICENSE_KEY_ENV_VAR
|
static |
◆ NEEDS_ENTERPRISE
|
static |
◆ RESOURCE_KEY_ENV_VAR
|
static |
