Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
NamedItem Class Reference

This class provides the common set of names and descriptions allowed for items in the Data API. More...

Inherited by BaseEnumerator, Calibrator, Dependency, ExpectedStateAlarm, LimitAlarm, PacketItem, Parameter, and SwitchSet.

Public Member Functions

def remove_all_attributes ( -> None ) -> def 
 Removes all attributes.
 
def remove_attribute (name: str -> None ) -> def 
 Removes the attribute by name. More...
 
Initialize / Finalize

Functions handling class initialization and destruction.

def NamedItem ( Optional[NamedItem] named_item=None -> None ) -> def 
 Class initializer. More...
 
def __eq__ (named_item: object -> bool ) -> def 
 Equality operator "==". More...
 
def copy (copy_from: object -> None ) -> def 
 Copies the contents of the provided 'copy_from' NamedItem into this NamedItem. More...
 
def initialize ( -> None ) -> def 
 Initializes the object. More...
 
Get Attributes

Functions to get the value of the NamedItem's attributes.

def add_attribute (name: str, value: str -> None ) -> def 
 Adds an attribute to the item. More...
 
def get_alias ( -> str ) -> def 
 Returns the alias of the item. More...
 
def get_attribute (name: str -> str ) -> def 
 Get the value of the specified attribute. More...
 
def get_attribute_list ( -> list[str] ) -> def 
 Gets a list of the attribute names. More...
 
def get_name ( -> str ) -> def 
 Returns the name of the item. More...
 
def get_long_description ( -> str ) -> def 
 Returns the long description of the item. More...
 
def get_short_description ( -> str ) -> def 
 Returns the short description of the item. More...
 
def get_user_description ( -> str ) -> def 
 Returns the user description of the item. More...
 
def get_owner ( -> str ) -> def 
 Returns the owner of the item. More...
 
def get_path ( -> str ) -> def 
 Returns the path for the item. More...
 
Set Attributes

Functions to set the value of the NamedItem's attributes.

def set_name (name: str -> None ) -> def 
 Sets the name of the item. More...
 
def set_alias (alias: str -> None ) -> def 
 Sets the alias of the item. More...
 
def set_short_description (description: str -> None ) -> def 
 Sets the short description of the item. More...
 
def set_long_description (description: str -> None ) -> def 
 Sets the long description of the item. More...
 
def set_user_description (description: str -> None ) -> def 
 Sets the user description of the item. More...
 
def set_owner (owner: str -> None ) -> def 
 Sets the owner of the item. More...
 
def set_path (path: str -> None ) -> def 
 Sets the path of the item. More...
 

Detailed Description

This class provides the common set of names and descriptions allowed for items in the Data API.

Constructor & Destructor Documentation

◆ NamedItem()

Member Function Documentation

◆ __eq__()

(named_item : object ) -> bool

Equality operator "==".

Note
Use 'is' operator to compare two variables are the same instance.
Returns
True if contents are equal.
# two different instances
named_item1 = NamedItem()
named_item2 = NamedItem()
if named_item1 == named_item2:
print("the items' content is the same")
if named_item1 is not named_item2:
print("and they are not the same instance")

Reimplemented in Enumerator, RangeEnumerator, and SignedEnumerator.

◆ add_attribute()

(name : str 
value : str 
) -> None

Adds an attribute to the item.

Parameters
[in]nameThe name of the attribute.
[in]valueThe value of the attribute.

◆ copy()

◆ get_alias()

() -> str

Returns the alias of the item.

Returns
Alias of the item.

◆ get_attribute()

(name : str ) -> str

Get the value of the specified attribute.

Parameters
[in]nameThe name of the attribute to retrieve.
Returns
Attribute value.

◆ get_attribute_list()

() -> list[str]

Gets a list of the attribute names.

Returns
List of attribute names.

◆ get_long_description()

() -> str

Returns the long description of the item.

Returns
Long description of the item.

◆ get_name()

() -> str

Returns the name of the item.

Returns
Name of the item.

◆ get_owner()

() -> str

Returns the owner of the item.

Returns
Owner of the item.

◆ get_path()

() -> str

Returns the path for the item.

Returns
Path of the item.

◆ get_short_description()

() -> str

Returns the short description of the item.

Returns
Short description of the item.

◆ get_user_description()

() -> str

Returns the user description of the item.

Returns
User description of the item.

◆ initialize()

◆ remove_attribute()

(name : str ) -> None

Removes the attribute by name.

Parameters
[in]nameThe name of the attribute to remove.
Exceptions
TrekError15007 - TREK_DATA_DOES_NOT_EXIST

◆ set_alias()

(alias : str ) -> None

Sets the alias of the item.

There is no restriction on the length of the alias. However, individual projects may impose length restrictions.

Parameters
[in]aliasThe new alias for the item.

◆ set_long_description()

(description : str ) -> None

Sets the long description of the item.

There is no restriction on the length of the long description. However, individual projects may impose length restrictions.

Parameters
[in]descriptionThe new long description for the item.

◆ set_name()

(name : str ) -> None

Sets the name of the item.

There is no restriction on the length of the name. However, individual projects may impose length restrictions.

Parameters
[in]nameThe new name for the item.

◆ set_owner()

(owner : str ) -> None

Sets the owner of the item.

There is no restriction on the length of the owner. However, individual projects may impose length restrictions.

◆ set_path()

(path : str ) -> None

Sets the path of the item.

There is no restriction on the length of the path. It can be used to support a path like name for the item for informational purposes.

◆ set_short_description()

(description : str ) -> None

Sets the short description of the item.

There is no restriction on the length of the short description. However, individual projects may impose length restrictions.

Parameters
[in]descriptionThe new short description for the item.

◆ set_user_description()

(description : str ) -> None

Sets the user description of the item.

There is no restriction on the length of the user description. However, individual projects may impose length restrictions.

Parameters
[in]descriptionThe new user description for the item.