Package src :: Package com :: Package deviceatlas :: Package device :: Module device_data :: Class DeviceData
[frames] | no frames]

Class DeviceData

Instance Methods
 
__init__(self, json_data_string)
Parses the data from the JSON file.
 
get_start_version(self, component_node, version_specific_children)
 
get_end_version(self, component_node, version_specific_children)
 
get_version_specific_children(self, component_index, component_node, component_to_version_specific_children)
Extract the version-specific children:
 
property_names(self)
Get a list of all possible property names.
 
property_name_by_id(self, property_id)
Get an individual property name from the following stucture:...
 
property_value_by_id(self, value_id)
 
data_version(self)
Returns the device data (JSON file) version.
 
data_creation_iso8601(self)
The creation date/time of the loaded data file in ISO 8601 format.
 
get_token_trie_walker(self)
 
get_max_component_type_id(self)
 
get_max_stock_child_level(self)
 
get_inputs(self)
 
get_component_by_index(self, component_index)
 
get_component_type_by_id(self, component_type_id)
 
has_include_language(self)
 
has_include_language_locale(self)
Method Details

__init__(self, json_data_string)
(Constructor)

 

Parses the data from the JSON file.
  
Parse and prepare the device data from the JSON.

 {
   "$": [object]       $==Meta data                    [mandatory]
   "p": [array]        p==Property names               [mandatory]
   "v": [array]        v==Values                       [mandatory]
   "d": [array]        d==Codepoint delimiters         [mandatory]
   "t": [array]        t==Component Types              [mandatory]
   "e": [array]        e==Dynamic value extractors     [optional]
   "cg": [array]       cg==Constraint Groups           [optional]
   "c": [array]        c==Components                   [mandatory]
   "tr":[Object]      tr==Token Trie                   [mandatory]
   "i": [array]        i==Inputs                      [mandatory]
}

IMPORTANT: The above keys are ordered by the JSON Generator to be in a
predictable and optimal order. This is helpful as certain objects are
required by other objects which are loaded later.

:param json_data_string:

get_version_specific_children(self, component_index, component_node, component_to_version_specific_children)

 

Extract the version-specific children:

"vc": {
    "p": integer                           (p == property name id   [mandatory])
    "m": integer,                          (m == max version parts  [mandatory])
    "c": [ordered array],   (c == version-specific child components [optional] )
}
:param component_index:
:param component_node:
:param component_to_version_specific_children:
:return:

property_names(self)

 

Get a list of all possible property names. Note that the client side properties are not included in this list.

Returns:
A list of all possible device property names as PropertyName objects. A PropertyName object holds a property-name and its data-type.

property_name_by_id(self, property_id)

 

Get an individual property name from the following stucture:
{
 "n": string            n==Property Name         [mandatory]
"t": char-string       t==Property Type         [mandatory]
}
:param property_id:
:return:

data_version(self)

 

Returns the device data (JSON file) version.

Returns:
The version of the data file.

data_creation_iso8601(self)

 

The creation date/time of the loaded data file in ISO 8601 format.

Returns:
The creation date/time of the loaded data file in ISO 8601 format.