This class tries to extract properties from the User-Agent string
itself. This is a completely separate step to the main JSON tree walk but
uses the results of the tree walk to optimise the property extraction.
The property extraction is done in two steps.
Step 1: Try and identify the type of User-Agent and thus the set of
property extraction rules to run. This is optimised by the properties
from the tree walk.
Step 2: Run the rules found in step 1 to try and extract the
properties.
|
__init__(self,
tree_provider)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
|
put_properties(self,
user_agent,
props_to_vals,
properties) |
|
|
|
|
|
_init_rule_sets(self,
group)
Prepare the rule set by extracting it from the current group and
counting the items in the group. |
|
|
|
__init_process_regexes(self)
Process the regexes by overriding any default ones with API specific
regexes and then compile the list of regexes. |
|
|
|
__extract_properties(self,
rules_to_run,
user_agent,
regexes,
sought,
properties)
This function loops over all the rules in rules_to_run and returns
any properties that match. |
|
|
|
__skip_ua_rules(self,
id_properties)
Check list of items that skip rules - these are typically non-mobile
boolean properties such as isBrowser, isBot, isCrawler, etc. |
|
|
|
__ua_property_rules(self,
user_agent,
id_properties,
rule_groups,
regexes)
Try and find a set of property extraction rules to run on the
User-Agent. |
|
|
|
__find_rules_by_properties(self,
groups,
user_agent,
id_properties,
regexes)
Try and find User-Agent type and thus the rules to run by using the
properties returned from the tree walk. |
|
|
|
__check_properties_match(self,
prop_list,
props_to_values)
This functions checks all the properties in the property matcher
branch of this rule group. |
|
|
|
__find_rules_by_regex(self,
groups,
user_agent,
regexes)
Search for the rules to run by checking the User-Agent with a regex. |
|
|
|
__find_rules_to_run_by_regex(self,
user_agent,
rule_set,
rule_set_count,
regexes,
type)
Loop over a set of refining rules to try and determine the User-Agent
type and so find the rules to run on it. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|