Package node_manager_fkie :: Module service_list_model :: Class ServiceGroupItem
[frames] | no frames]

Class ServiceGroupItem

source code

       object --+            
                |            
sip.simplewrapper --+        
                    |        
          sip.wrapper --+    
                        |    
PyQt5.QtGui.QStandardItem --+
                            |
                           ServiceGroupItem

The ServiceGroupItem stores the information about a group of nodes.

Nested Classes

Inherited from PyQt5.QtGui.QStandardItem: ItemType

Instance Methods
 
__init__(self, name, parent=None, is_group=False)
Initialize the ServiceGroupItem object with given values.
source code
 
get_namespace(self) source code
 
count_topics(self)
:retrun: Returns count of nodes inside this group.
source code
 
get_service_items_by_name(self, name, recursive=True)
Since the same node can be included by different groups, this method searches for all nodes with given name and returns these items.
source code
 
get_service_items(self, recursive=True)
Returns all nodes in this group and subgroups.
source code
 
get_group_item(self, group_name, is_group=True, nocreate=False)
Returns a ServiceGroupItem with given name.
source code
 
add_node(self, service)
Adds a new topic with given name.
source code
 
clearup(self, fixed_node_names=None)
Removes not running and not configured nodes.
source code
 
remove_node(self, name) source code
 
update_view(self, updated_srvs, services) source code
 
index_from_names(self, services)
Returns for given topics the list of QModelIndex in this model.
source code
 
type(self) source code
 
__eq__(self, item)
Compares the name of the group.
source code
 
__ne__(self, item)
x!=y
source code
 
__gt__(self, item)
Compares the name of the group.
source code

Inherited from PyQt5.QtGui.QStandardItem: __ge__, __le__, __lt__, accessibleDescription, accessibleText, appendColumn, appendRow, appendRows, background, checkState, child, clone, column, columnCount, data, emitDataChanged, flags, font, foreground, hasChildren, icon, index, insertColumn, insertColumns, insertRow, insertRows, isCheckable, isDragEnabled, isDropEnabled, isEditable, isEnabled, isSelectable, isTristate, model, parent, read, removeColumn, removeColumns, removeRow, removeRows, row, rowCount, setAccessibleDescription, setAccessibleText, setBackground, setCheckState, setCheckable, setChild, setColumnCount, setData, setDragEnabled, setDropEnabled, setEditable, setEnabled, setFlags, setFont, setForeground, setIcon, setRowCount, setSelectable, setSizeHint, setStatusTip, setText, setTextAlignment, setToolTip, setTristate, setWhatsThis, sizeHint, sortChildren, statusTip, takeChild, takeColumn, takeRow, text, textAlignment, toolTip, whatsThis, write

Inherited from sip.simplewrapper: __new__

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

Class Methods
 
create_item_list(self, name, parent, is_group)
Creates the list of the items for this group.
source code
Class Variables
  ITEM_TYPE = 301

Inherited from PyQt5.QtGui.QStandardItem: Type, UserType

Properties
  name
The name of this group.
  is_group

Inherited from object: __class__

Method Details

__init__(self, name, parent=None, is_group=False)
(Constructor)

source code 

Initialize the ServiceGroupItem object with given values.

:param str name: the name of the group :param parent: the parent item. In most cases this is the HostItem. The variable is used to determine the different columns of the NodeItem. :type parent: :class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html> :param bool is_group: True if this is a capability group. In other case it is a namespace group.

Overrides: object.__init__

count_topics(self)

source code 

:retrun: Returns count of nodes inside this group. :rtype: int

get_service_items_by_name(self, name, recursive=True)

source code 

Since the same node can be included by different groups, this method searches for all nodes with given name and returns these items.

:param str name: The name of the topic :param bool recursive: Searches in (sub) groups :return: The list with node items. :rtype: list(:class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html>)

get_service_items(self, recursive=True)

source code 

Returns all nodes in this group and subgroups.

:param bool recursive: returns the nodes of the subgroups :return: The list with node items. :rtype: list(:class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html>)

create_item_list(self, name, parent, is_group)
Class Method

source code 

Creates the list of the items for this group. This list is used for the visualization of group data as a table row.

:param str name: the group name :return: the list for the representation as a row :rtype: [ServiceGroupItem or QStandardItem, ...]

get_group_item(self, group_name, is_group=True, nocreate=False)

source code 

Returns a ServiceGroupItem with given name. If no group with this name exists, a new one will be created. The given name will be split by slashes if exists and subgroups are created.

:param str group_name: the name of the group :param bool is_group: True if it is a capability group. False if a namespace group. (Default: True) :param bool nocreate: avoid creation of new group if not exists. (Default: False) :return: The group with given name of None if `nocreate` is True and group not exists. :rtype: :class:`ServiceGroupItem`

add_node(self, service)

source code 

Adds a new topic with given name.

:param service: the TopicInfo of the node to create :type service: :class:`TopicInfo`

clearup(self, fixed_node_names=None)

source code 

Removes not running and not configured nodes.

:param list(str) fixed_node_names: If the list is not None, the node not in the list are set to not running!

index_from_names(self, services)

source code 

Returns for given topics the list of QModelIndex in this model.

:param [str] services: the list of service names :return: the list of QModelIndex :rtype: [QtCore.QModelIndex]

type(self)

source code 
Overrides: PyQt5.QtGui.QStandardItem.type

__eq__(self, item)
(Equality operator)

source code 

Compares the name of the group.

Overrides: PyQt5.QtGui.QStandardItem.__eq__

__ne__(self, item)

source code 

x!=y

Overrides: PyQt5.QtGui.QStandardItem.__ne__
(inherited documentation)

__gt__(self, item)
(Greater-than operator)

source code 

Compares the name of the group.

Overrides: PyQt5.QtGui.QStandardItem.__gt__

Property Details

name

The name of this group.

:rtype: str

Get Method:
unreachable.name(self) - The name of this group.
Set Method:
unreachable.name(self, new_name) - Set the new name of this group and updates the displayed name of the item.

is_group

Get Method:
unreachable.is_group(self)