py-dtbindings  1.4.1
This python "lib" aim is to extract devicetree bindings informations.
bindings.BindingProps Class Reference

This class represent the binding properties of a Binding class. More...

Public Member Functions

def add_required (self, required)
 Init or update _required. More...
 
def add_properties (self, properties)
 Init or update _optional and _props. More...
 
def add_from_BindingProp (self, prop)
 This function meant to be called to add properties of a $ref binding to the main Binding.
 
def prop_from_name (self, name)
 Explicit : return a Prop for a given name. More...
 

Private Member Functions

def _update (self)
 Did some cleaning on _optional list after update. More...
 
def _value_analyzer (self, item)
 Analyze value type of input and process it. More...
 
def _get_type (self, key, item)
 Called by add_properties() to retrieve MainProp type. More...
 

Private Attributes

 _props
 
 _required
 
 _optional
 
 _verbose
 

Detailed Description

This class represent the binding properties of a Binding class.

Todo:
Different algorithm could be rework as they could be more clean and efficient since we had contains and getitem to MainProp

Member Function Documentation

◆ _get_type()

def bindings.BindingProps._get_type (   self,
  key,
  item 
)
private

Called by add_properties() to retrieve MainProp type.

Todo:
All case not or partially process (see TODO:):
  • Item dict with '$ref' that is not schema and no 'type'
  • Item dict with '$ref' that's not part of bindings.dtschema_types dict
  • Item that doesn't fit in any if else

◆ _update()

def bindings.BindingProps._update (   self)
private

Did some cleaning on _optional list after update.

After adding new elements to _optional, check if these elements can be found in _required, and so, remove them from _optional

◆ _value_analyzer()

def bindings.BindingProps._value_analyzer (   self,
  item 
)
private

Analyze value type of input and process it.

It should be called for extract necessary info for _props It ceate some Prop or list of Prop or simply return a var that should be added to the main Prop value

◆ add_properties()

def bindings.BindingProps.add_properties (   self,
  properties 
)

Init or update _optional and _props.

Parameters
propertiesA dict usually extracted from Binding._content

◆ add_required()

def bindings.BindingProps.add_required (   self,
  required 
)

Init or update _required.

Parameters
requiredA list usually extracted from Binding._content

◆ prop_from_name()

def bindings.BindingProps.prop_from_name (   self,
  name 
)

Explicit : return a Prop for a given name.

Parameters
nameName of the desired Prop
Returns
A Prop item or None

Member Data Documentation

◆ _optional

bindings.BindingProps._optional
private

A list of all optional properties

◆ _props

def bindings.BindingProps._props
private

A dict Contains properties formatted with Prop

◆ _required

bindings.BindingProps._required
private

A list of all required properties

◆ _verbose

bindings.BindingProps._verbose
private

Internal reference for printing debug level (0 to 3)


The documentation for this class was generated from the following file: