Python Component API: class PropertyCollection

The following methods are available for Python class PropertyCollection.

This page discusses:

Description

This class is a wrapper around swigpython3.iPropertyCollection. It is is part of the pilotpython module, which is available in the Python (on Server) component.

class PropertyCollection(builtins.object)

PropertyCollection.__init__(propertyCollection)
Description Constructor.
Input parameters param propertyCollection: iPropertyCollection to wrap

type propertyCollection: swigpython3.iPropertyCollection

Return value None
PropertyCollection.define(name, value=None)
Description Defines the given property with the optional pilotpython.Value.
Input parameters param name: Name of property

type name: str

param value: Value to attach to property

type value: pilotpython.Value

Return value None
PropertyCollection.defineBoolArrayProperty(name, value)
Description Creates a new property holding a BooleanArrayValue, and returns it.
Input parameters param name: Name of property

type name: str

param value: List of bools. Non-bool list elements are ignored

type value: list

Return value returns: The new property

rtype: Property

PropertyCollection.defineBoolProperty(name, value)
Description Creates a new boolean property, and returns it.
Input parameters param name: Name of property

type name: str

param value: Value of property

type value: str

Return value returns: The new property

rtype: Property

PropertyCollection.defineByteArrayProperty(name, value)
Description Creates a new property holding a ByteArrayValue, and returns it. This involves copying(!) the data, as opposed to sharing it between C++ and Python.
Input parameters param name: name of property

type name: str

param value: byte array to set

type value: bytearray

Return value returns: the new property

rtype: Property

PropertyCollection.defineDateTimeProperty(name, value)
Description Defines a DateTimeValue property.
Input parameters param name: Name of property

type name: str

param value: Date/time as an object

type value: datetime.datetime, datetime.date, datetime.time

Return value returns: The new property

rtype: Property

PropertyCollection.defineFloatArrayProperty(name, value)
Description creates a new property holding a DoubleArrayValue property, and returns it.
Input parameters param name: Name of property

type name: str

param value: List of floats. Non-float list elements are ignored

type value: list

Return value returns: The new property

rtype: Property

PropertyCollection.defineFloatProperty(name, value)
Description Creates a new floating point property, and returns it.
Input parameters param name: Name of property

type name: str

param value: Value of property

type value: float

Return value returns: The new property

rtype: Property

PropertyCollection.defineHashTableProperty(name, data)
Description Converts the given data to a HashTableValue.
Input parameters param name: Name of property

type name: str

param data: Data to convert

type data: dict

Return value returns: The new property

rtype: Property

PropertyCollection.defineIntArrayProperty(name, value)
Description Creates a new property holding an IntegerArrayValue, and returns it.
Input parameters param name: Name of property

type name: str

param value: List containing integers. Non-integer list elements are ignored

type value: list

Return value returns: The new property

rtype: Property

PropertyCollection.defineIntProperty(name, value)
Description Creates a new property holding an integer, and returns it.
Input parameters param name: Name of property

type name: str

param value: Value of property

type value: int

Return value returns: The new property

rtype: Property

PropertyCollection.defineNullProperty(name)
Description Defines a NullValue property.
Input parameters param name: Name of property
Return value returns: The new property

rtype: Property

PropertyCollection.defineStringArrayProperty(name, value)
Description Creates a new property holding a StringArrayValue, and returns it.
Input parameters param name: Name of property

type name: str

param value: Value to assign. Non-string list elements are ignored

param type: list

Return value returns: The new property

rtype: Property

PropertyCollection.defineStringProperty(name, value)
Description Creates a new string property and returns it.
Input parameters param name: Name of property

type name: str

param value: Value of property

type value: str

Return value returns: The new property

rtype: Property

PropertyCollection.find(name)
Description Retrieves a property by name. If a property is not found with the name, returns None.
Input parameters param name: Name of property to find

type name: str

Return value returns: Property, or None

rtype: Property

PropertyCollection.get(name)
Description Retrieves a property by name. If a property is not found with the name, an exception is thrown.
Input parameters param name: Name of property to find

type name: str

Return value returns: Property

rtype: Property

PropertyCollection.getByIndex(index)
Description Gets the property at the given index.
Input parameters param index: Index of property

type inde: int

Return value returns: Property

rtype: Property

PropertyCollection.getRawCollection()
Description Returns the raw swigpython3 iPropertyCollection
Input parameters None
Return value returns: Raw SWIG-generated iPropertyCollection

rtype: swigpython3.iPropertyCollection

PropertyCollection.getSize()
Description Gets the number of properties in the collection.
Input parameters None
Return value returns: Size of collection

rtype: int

PropertyCollection.isDefined(name)
Description Determines if a property is defined.
Input parameters param name: Name of property to check

type name: str

Return value returns: True if property exists, False otherwise

rtype: bool

PropertyCollection.remove(prop)
Description Removes the given property from the collection.
Input parameters param prop: Name or index of property

type prop: int or str

Return value None

Data descriptors defined here

PropertyCollection.__dict__
Description dictionary for instance variables (if defined)
PropertyCollection.__weakref__
Description list of weak references to the object (if defined)