CPEComponent class

class cpe.comp.cpecomp.CPEComponent(comp_str)

Represents a generic component of CPE Name, compatible with the components of all versions of CPE specification.

__contains__(item)

Returns True if item is included in set of values of self.

Parameters:item (CPEComponent) – component to find in self
Returns:True if item is included in set of self, otherwise False
Return type:boolean
__eq__(other)

Returns True if other (first element of operation) and self (second element of operation) are equal components, false otherwise.

Parameters:other (CPEComponent) – component to compare
Returns:True if other == self, False otherwise
Return type:boolean
__init__(comp_str)

Store the value of component.

Parameters:comp_str (string) – value of component value
Returns:None
__ne__(other)

Returns True if other (first element of operation) and self (second element of operation) are not equal components, false otherwise.

Parameters:other (CPEComponent) – component to compare
Returns:True if other != self, False otherwise
Return type:boolean
__repr__()

Returns a unambiguous representation of CPE component.

Returns:Representation of CPE component as string
Return type:string
__weakref__

list of weak references to the object (if defined)

classmethod is_valid_attribute(att_name)

Check if input attribute name is correct.

Parameters:att_name (string) – attribute name to check
Returns:True is attribute name is valid, otherwise False
Return type:boolean

TEST: a wrong attribute

>>> from .cpecomp import CPEComponent
>>> att = CPEComponent.ATT_PRODUCT
>>> CPEComponent.is_valid_attribute(att)
True