nexxT.services.SrvConfiguration module

This module provides the basic Configuration services of the nexxT framework.

class nexxT.services.SrvConfiguration.ConfigurationModel(configuration, parent)[source]

Bases: QAbstractItemModel

This class encapsulates a next Configuration item in a QAbstractItemModel ready for usage in a QTreeView.

Internally, item-trees are constructed which duplicate the relevant information from the python classes.

class Item(parent, content)[source]

Bases: object

An item instance for creating the item tree. Items have children, a parent and arbitrary content.

__init__(parent, content)[source]
row()[source]
Returns:

the index of this item in the parent item.

class NodeContent(subConfig, name)[source]

Bases: object

A node in a subconfig, for usage within the model

__init__(subConfig, name)[source]
class PropertyContent(name, propertyCollection)[source]

Bases: object

A property in a propertyCollection, for usage within the model.

__init__(name, propertyCollection)[source]
class SubConfigContent(subConfig)[source]

Bases: object

A subConfiguration, for usage within the model.

__init__(subConfig)[source]
class VariableContent(name, variables)[source]

Bases: object

A variable definition in a Variables instance, for usage within the model.

__init__(name, variables)[source]
__init__(self, /, parent: PySide6.QtCore.QObject | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

appActivated(name, app)[source]

This slot is called when an application has been activated.

Parameters:
  • name – the name of the application

  • app – the Application instance

Returns:

columnCount(parent)[source]

Returns the number of columns of the given model index

Parameters:

parent – a QModelIndex instance

Returns:

data(index, role)[source]

Generic data query

Parameters:
  • index – a QModelIndex instance

  • role – the data role (see QAbstractItemModel)

Returns:

flags(index)[source]

Returns teh item flags of the given index

Parameters:

index – a QModelIndex instance

Returns:

headerData(section, orientation, role)[source]

Overwritten from QAbstractItemModel. Provide header names for the columns.

index(row, column, parent=<PySide6.QtCore.QModelIndex(-1, -1, 0x0, QObject(0x0))>)[source]

Creates a model index according to QAbstractItemModel conventions.

Parameters:
  • row – the row index

  • column – the column index

  • parent – the parent index

Returns:

indexOfNode(subConfig, node)[source]

Returns the index of the given node inside a subconfig.

Parameters:
  • subConfig – a SubConfiguration instance

  • node – a node name

Returns:

a QModelIndex instance

indexOfProperty(nodeItem, propName)[source]

Returns the model index of the specified property

Parameters:
  • nodeItem – a NodeItem instance

  • propName – a property name

Returns:

a QModelIndex instance

indexOfSubConfig(subConfig)[source]

Returns the index of the given subConfig

Parameters:

subConfig – a SubConfiguration instance

Returns:

a QModelIndex instance.

indexOfSubConfigParent(subConfig)[source]

Returns the index of the given subConfig’s parent

Parameters:

subConfig – a SubConfiguration instance

Returns:

a QModelIndex instance.

indexOfVariable(vitem)[source]

Returns the index of the given variable by full-recursive searching.

Parameters:

vitem – the variable item to be search for.

static isApplication(index)[source]

Returns true, if this index relates to an applications, false otherwise.

Parameters:

index – a QModelIndex instance

Returns:

bool

isSubConfigParent(index)[source]

Returns CONFIG_TYPE_COMPOSITE if the index refers to the group composite, CONFIG_TYPE_APPLICATION if the index refers to the group applications, None otherwise.

Parameters:

index – a QModelIndex instance

Returns:

mimeData(indices)[source]

Overwritten from QAbstractItemModel, provide the mime data for copy/pasting (note that this doesn’t work across processes.

mimeTypes()[source]

Overwritten from QAbstractItemModel, provide a mime type for copy/pasting

nodeAdded(subConfig, node)[source]

This slot is called when a node is added to a subConfig

Parameters:
  • subConfig – a SubConfiguration instance

  • node – the node name.

Returns:

nodeDeleted(subConfig, node)[source]

This slot is called when a node is removed from a subConfig

Parameters:
  • subConfig – a SubConfiguration instance

  • node – the node name.

Returns:

nodeRenamed(subConfig, oldName, newName)[source]

This slot is called when a node is renamed in a subConfig

Parameters:
  • subConfig – a SubConfiguration instance

  • oldName – the original name.

  • newName – the new name

Returns:

parent(index)[source]

Returns the indice’s parent according to QAbstractItemModel convetions.

Parameters:

index – a QModelIndex instance.

Returns:

propertyAdded(parentItem, propColl, name)[source]

Slot called when a property was added.

Parameters:
  • parentItem – a NodeItem instance

  • propColl – the PropertyCollection instance

  • name – the name of the new property.

Returns:

propertyChanged(item, propColl, name)[source]

Slot called when a property has been changed.

Parameters:
  • item – a PropertyItem instance

  • propColl – a PropertyCollection instance

  • name – the name of the changed property

Returns:

propertyRemoved(parentItem, propColl, name)[source]

Slot called when a property has been removed.

Parameters:
  • parentItem – a NodeItem instance

  • propColl – a PropertyCollection instance

  • name – the name of the removed property

Returns:

rowCount(parent)[source]

Returns the number of children of the given model index

Parameters:

parent – a QModelIndex instance

Returns:

setData(index, value, role)[source]

Generic data modification (see QAbstractItemModel for details)

Parameters:
  • index – a QModelIndex instance

  • value – the new value

  • role – the role to be changed

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("ConfigurationModel" inherits "QAbstractItemModel": Methods:   #76 type=Slot, signature=subConfigAdded(PyObject), parameters=PyObject   #77 type=Slot, signature=subConfigRenamed(PyObject), parameters=PyObject   #78 type=Slot, signature=subConfigRemoved(QString,int), parameters=QString, int   #79 type=Slot, signature=appActivated(QString,PyObject), parameters=QString, PyObject )
subConfigAdded(subConfig)[source]

This slot is called when a subconfig is added to the configuration instance. It inserts a row as needed.

Parameters:

subConfig – a SubConfiguration instance

Returns:

subConfigByNameAndType(name, sctype)[source]

Returns a SubConfiguration instance, given its name and type

Parameters:
  • name – the name as a string

  • sctype – either CONFIG_TYPE_APPLICATION or CONFIG_TYPE_COMPOSITE

Returns:

a SubConfiguration instance

subConfigRemoved(name, sctype)[source]

This slot is called when a subconfig is removed from the configuration

:param name. the name of the removed subConfig :param sctype: the type ( either CONFIG_TYPE_APPLICATION or CONFIG_TYPE_COMPOSITE) :return:

subConfigRenamed(subConfig, oldName)[source]

This slot is called when a subconfig is renamed in the configuration instance.

Parameters:
  • subConfig – a SubConfiguration instance

  • oldName – the old name of this subConfig

Returns:

variableAddedOrChanged(parentItem, key, variables)[source]

Slot which is called when variables of parentItem are added or changed.

Parameters:
  • parentItem – an instance of VariableContent

  • key – the key which is changed or added

  • variables – the Variables instances managing the variables of parentItem

variableDeleted(vitem, key)[source]

Slot which is called when variables of vitem are deleted.

Parameters:
  • vitem – an instance of VariableContent

  • key – the key which is deleted

class nexxT.services.SrvConfiguration.MVCConfigurationBase(configuration)[source]

Bases: QObject

Base class for the configuration service. Might be used as a console service. The GUI service inherits from this class.

__init__(self, /, parent: PySide6.QtCore.QObject | None = None, *, objectName: str | None = None) None[source]

Initialize self. See help(type(self)) for accurate signature.

activate()[source]

Call this slot to activate the current application

Returns:

appActivated(name, app)[source]

Called when the application is activated. This is overwritten in the GUI class.

Parameters:
  • name – the application name

  • app – An ActiveApplication instance.

Returns:

changeActiveApp(app)[source]

Call this slot to activate an application

Parameters:

app – can be either an Application instance or the name of an application

Returns:

configuration()[source]

Return this service’s configuration object

Returns:

a Configuration instance

deactivate()[source]

Call this slot to deactivate the current application

Returns:

loadConfig(cfgFileName)[source]

Call this slot to load a configuration

Parameters:

cfgFileName – the filename of the configuration

Returns:

newConfig(cfgFileName)[source]

Call this slot to create a new configuration

Parameters:

cfgFileName – the filename of the configuration

Returns:

reload()[source]

Reloads all python modules of the current configuration.

Similar to close(), open() and loading the currently actuve sequence.

saveConfig()[source]

Call this slot to save the configuration (the gui state in the config will not be changed)

Returns:

saveConfigAs(filename)[source]

Call this slot to save the configuration

Returns:

saveConfigWithGuiState()[source]

Call this slot to save the configuration and synchronize the gui state.

Returns:

staticMetaObject = PySide6.QtCore.QMetaObject("MVCConfigurationBase" inherits "QObject": Methods:   #4 type=Slot, signature=activate()   #5 type=Slot, signature=deactivate()   #6 type=Slot, signature=loadConfig(QString), parameters=QString   #7 type=Slot, signature=saveConfig()   #8 type=Slot, signature=saveConfigWithGuiState()   #9 type=Slot, signature=saveConfigAs(QString), parameters=QString   #10 type=Slot, signature=newConfig(QString), parameters=QString   #11 type=Slot, signature=changeActiveApp(QString), parameters=QString )