Package mobi :: Package mtld :: Package da :: Package device :: Module post_walk_rules :: Class PostWalkRules
[hide private]
[frames] | no frames]

Class PostWalkRules

object --+
         |
        PostWalkRules
Known Subclasses:

Nested Classes [hide private]
  PostWalkRulesException
The PostWalkRulesException exception is raised by this class when the init_get_matcher_propery_ids() or init_rule_sets() are called before they have been replaced by any new implementation from a child class.
Instance Methods [hide private]
 
__init__(self, tree_provider, type)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__init_get_rule_property_ids(self, sets, rule_prop_ids)
Find all the properties that are used in the final rules.
 
_init_get_matcher_propery_ids(self, group, prop_ids)
Find all the properties that are used for matching.
 
_init_rule_sets(self, group)
Prepare the rule set

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  KEY_MATCHER_PROP_IDS_IN_USE = u'mpids'
  KEY_OPERATOR = u'o'
  KEY_PROPERTY_MATCHER = u'p'
  KEY_PROPERTY_VALUE = u'v'
  KEY_RULE_ARR = u'r'
  KEY_RULE_GROUPS = u'rg'
  KEY_RULE_PROP_IDS_IN_USE = u'rpids'
  KEY_RULE_SET = u't'
  KEY_RULE_SET_COUNT = u'tc'
  __prop_matcher_ids_in_use = []
  __rule_prop_ids_in_use = []
  branch = {}
  tree_provider = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tree_provider, type)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__init_get_rule_property_ids(self, sets, rule_prop_ids)

 

Find all the properties that are used in the final rules. This is needed to optimize the Api.getProperty() function.

Parameters:
  • sets - The rule set from the main rule group.
  • rule_prop_ids - The list of found property IDs.
Returns:
an updated set of property IDs.

_init_get_matcher_propery_ids(self, group, prop_ids)

 

Find all the properties that are used for matching. This is needed in case the DeviceApi.properties function is called as we need these properties for the rules to work correctly.

Parameters:
  • group - The rule group that can contain a property matcher.
  • prop_ids - The list of found property IDs.
Returns:
an updated set of property IDs.

_init_rule_sets(self, group)

 

Prepare the rule set

Parameters:
  • group - The current parent group.
Returns:
a list of all rule sets.