mgvCom module

Mangrove Communications. Sets of tools to send commands to an opened Mangrove instance. All functions attributes are strings and apply on the current node.

Functions:
setParam(param, value): Modify a parameter value. setNode(node, param, value): Modify a parameter value of a specific node. newVersion(): Create a new version based on the current one. setVersion(value): Change the current version. setComment(value): Modify the comment of the node’s active version. exe(action): Execute an action. update(): Ask Mangrove to update the graph view. lock(): Lock the node’s active version. setData(name, value): Set or add a data to the node data dict. removeData(name): Remove a data from the node data dict. getData(name): Get a data value from the node data dict. setVersionData(name, value): Set or add a data to the active version data dict. removeVersionData(name): Remove a data from the active version data dict. getVersionData(name): Get a data value from the active version data dict.
mgvCom.exe(*args)

Execute an action of the current node.

Paramaters:
args: action name or (node name, action name)
Return (str):
“ok”
mgvCom.getData(name)

Get a data value from the current node.

Parameters:name (str) – data name
Return (str):
data value
mgvCom.getVersionData(name)

Get a data value from the current node version.

Parameters:name (str) – data name
Return (str):
data value
mgvCom.lock()

Lock the current node’s active version.

Return (str):
“ok”
mgvCom.newVersion()

Create a new version based on the current one on the current node.

Return (str):
new version id
mgvCom.removeData(name)

Remove a data from the current node data dictionnary.

Parameters:name (str) – data name
Return (str):
“ok”
mgvCom.removeVersionData(name)

Remove a data from the current node version data dictionnary.

Parameters:name (str) – data name
Return (str):
“ok”
mgvCom.sendToMgv(msg, address=None, port=None)

Send a command to a Mangrove instance.

Parameters:
  • msg (str) – Mangrove command
  • address (str) – IP address of the mangrove instance
  • port (str) – port used by the mangrove instance
Return (str):
Mangrove instance response
mgvCom.setComment(value)

Modify the comment of the current node’s active version.

Paramaters:
value (str): new comment
Return (str):
“ok”
mgvCom.setData(name, value)

Set or add a data to the current node data dictionnary.

Parameters:
  • name (str) – data name
  • value (str) – data value
Return (str):
“ok”
mgvCom.setNode(node, param, value)

Modify a parameter value of a specific node.

Paramaters:
node (str): node name param (str): parameter name value (str): parameter value
Return (str):
“ok”
mgvCom.setParam(param, value)

Modify a parameter value of the current node.

Parameters:
  • param (str) – parameter name
  • value (str) – parameter value
Return (str):
“ok”
mgvCom.setVersion(value)

Change the current version of the current node.

Parameters:value (str) – version id
Returns:“ok”
mgvCom.setVersionData(name, value)

Set or add a data to the current node version data dictionnary.

Parameters:
  • name (str) – data name
  • value (str) – data value
Return (str):
“ok”
mgvCom.update()

Ask Mangrove to update the graph view.

Return (str):
“ok”