papi.data package

Submodules

papi.data.DConfiguration module

Contributors Sven Knuth

class papi.data.DConfiguration.DConfiguration[source]

Bases: papi.data.DObject.DObject

add(args)[source]

papi.data.DCore module

Contributors Sven Knuth

class papi.data.DCore.DCore[source]

Bases: builtins.object

DCore contains and manages the internal data structure

add_plugin(process, pid, own_process, queue, plugin, id)[source]

Add plugin with necessary information.

Parameters:
  • process – Plugin is running in this process
  • pid – Process ID of the process in which the plugin is running
  • queue – Event queue needed for events which should be received by this plugin
  • plugin – Plugin object
  • plugin_id – ID of this plugin
  • id – ID for the new DPlugin
Returns:

Returns the data object DPlugin

Return type:

DPlugin

create_id()[source]

Creates and returns unique IDs

Returns:unique ID
Return type:int
get_all_plugins()[source]

Returns a dictionary of all known dplugins

Returns:
Return type:{}
get_dplugin_by_id(plugin_id)[source]

Returns DPlugin object by ID

Parameters:plugin_id – ID of an DPlugin object
Return DPlugin:
Return type:DPlugin
get_dplugin_by_uname(plugin_uname)[source]

Returns DPlugin object by uname

Parameters:plugin_name – uname of an DPlugin object
Return DPlugin:
Return type:DPlugin
get_dplugins_count()[source]

Returns count of known plugins in this data structure

Returns:
Return type:int
rm_all_subscribers(dplugin_id)[source]

This function is used to remove all subscribers of all DBlocks, which are hold by the DPlugin with the dplugin_id.

Parameters:dplugin_id – dplugin identifed by dplugin_id whose subscribers should be removed.
Returns:
rm_all_subscribers_of_a_dblock(dplugin_id, dblock_name)[source]
rm_dplugin(dplugin_id)[source]

Removes DPlugin with dplugin_id

Parameters:dplugin_id
Returns:
Return type:bool
subscribe(subscriber_id, target_id, dblock_name)[source]

Used to create a subscription.

Parameters:
  • subscriber_id – DPlugin which likes to subscribes dblock
  • target_id – DPlugin which contains the dblock for subscribtion
  • dblock_name – DBlock identified by its unique name for subscribtion
Returns:

subscribe_signals(subscriber_id, target_id, dblock_name, signals)[source]

This function is used to subscribe a bunch of signals.

Parameters:
  • subscriber_id – DPlugin which likes to subscribes signals of the chosen dblock
  • target_id – DPlugin which contains the dblock for subscribtion
  • dblock_name – DBlock identified by its unique name for subscribtion
  • signals – List of signals which are needed to be added
Returns:

unsubscribe(subscriber_id, target_id, dblock_name)[source]

Used to remove a subscription.

Parameters:
  • subscriber_id – DPlugin which likes to unsubscribes dblock
  • target_id – DPlugin which contains the dblock for subscribtion
  • dblock_name – DBlock identified by its unique name for unsubscribtion
Returns:

Rtype boolean:
unsubscribe_all(dplugin_id)[source]

This function is used to cancel all subscription of the DPlugin with the dplugin_id.

Parameters:dplugin_id – dplugin identifed by dplugin_id whose subscription should be canceled.
Returns:
unsubscribe_signals(subscriber_id, target_id, dblock_name, signals)[source]

This function is used to unubscribe a bunch of signals.

Parameters:
  • subscriber_id – DPlugin which likes to unsubscribes signals of the chosen dblock
  • target_id – DPlugin which contains the dblock for subscribtion
  • dblock_name – DBlock identified by its unique name for subscribtion
  • signals – List of signals which are needed to be added
Returns:

papi.data.DGui module

Contributors: Stefan Ruppin

class papi.data.DGui.DGui[source]

Bases: papi.data.DCore.DCore

papi.data.DObject module

Contributors Sven Knuth

class papi.data.DObject.DObject[source]

Bases: builtins.object

static create_unique_id()[source]
get_id()[source]
remove()[source]

papi.data.DOptionalData module

Contributors: Stefan Ruppin

class papi.data.DOptionalData.DOptionalData(DATA=None, pluginID=None)[source]

Bases: builtins.object

papi.data.DParameter module

Contributors Sven Knuth

class papi.data.DParameter.DParameter(name, default=0, Regex=None, OptionalObject=None)[source]

Bases: papi.data.DObject.DObject

DParameter is used for the internal description of a parameter which are provided by a plugin. Parameters are used to interact with plugin.

connect(function_handler)[source]
update_meta(parameter)[source]

papi.data.DPlugin module

Contributors Sven Knuth

class papi.data.DPlugin.DBlock(name)[source]

Bases: papi.data.DObject.DObject

DBlock is used for the internal description of a block. Contains a bunch of signals of a the same data source.

add_signal(signal)[source]

Add Signal for this DBlock

Parameters:signal
Returns:
add_subscribers(dplugin)[source]

Add dplugin as subscriber for this dblock.

Parameters:dplugin
Returns:
Rtype boolean:
get_name()[source]

Returns the name of this block.

Return block_name:
 
get_signal_by_uname(uname)[source]

Returns a signal object by a signal’s uname.

Parameters:uname
Return DSignal:
get_signals()[source]

Returns a copy of the internal signal names

Returns:
get_subscribers()[source]

Returns all subscribers of this plugin. Returns a copy that means changes have no effect on the PaPI data structure.

Returns:
Rtype []:
rm_signal(signal)[source]

Remove Signal for this DBlock

Parameters:signal
Returns:
rm_subscriber(dplugin)[source]

Remove dplugin as subscriber of this dblock.

Parameters:dplugin
Returns:
Rtype boolean:
class papi.data.DPlugin.DEvent(name)[source]

Bases: papi.data.DPlugin.DBlock

class papi.data.DPlugin.DPlugin[source]

Bases: papi.data.DObject.DObject

DPlugin is used for the internal description of a plugin.

add_dblock(dblock)[source]

Used to add a block for this plugin. Returns true if parameter doesn’t existed and was deleted, returns false if parameter already exists.

Parameters:dblock – Block which should be added.
Returns:
Rtype boolean:
add_parameter(parameter)[source]

Used to add a parameter for this plugin. Returns true if parameter doesn’t existed and was added, returns false if parameter already exists.

Parameters:parameter
Returns:
Rtype boolean:
get_dblock_by_name(dblock_name)[source]

Returns a single block by its unique name of all parameters.

Parameters:dblock_name – Uniqueder identifier for this block.
Returns:
get_dblocks()[source]

Returns a list of all blocks.

Returns:
Rtype {}:
get_devent()[source]
get_meta()[source]
Returns:
Rtype DPlugin:
get_parameters()[source]

Returns a list of all parameters.

Returns:
Rtype {}:
get_subscribtions()[source]

Returns a reference to a dictionary of all subscribtions.

:return {}{} of DPlugin ids to DBlock names : :rtype: {}{}

rm_dblock(dblock)[source]

Used to remove a block for this plugin. Returns true if block existed and was deleted, returns false if block doesn’t exist.

Parameters:dblock
Returns:
Rtype boolean:
rm_parameter(parameter)[source]

Used to remove a parameter for this plugin. Returns true if parameter existed and was deleted, returns false if parameter doesn’t exist.

Parameters:parameter – Parameter which should be removed.
Returns:
Rtype boolean:
subscribe(dblock)[source]

This plugin subscribes a ‘dblock’ by remembering the dblock id.

Parameters:dblock – DBlock which should be subscribed
Returns:
Rtype boolean:
subscribe_signals(dblock, signals)[source]

This function is used to subscribe a bunch of signals.

Parameters:
  • dblock
  • signals
Returns:

Rtype DSubscription:
 
unsubscribe(dblock)[source]

This plugin unsubscribes a ‘dblock’ by forgetting the dblog id.

Parameters:dblock – DBlock which should be unsubscribed
Returns:
Rtype boolean:
unsubscribe_signals(dblock, signals)[source]

This function is used to unsubscribe a bunch of signals.

Parameters:
  • dblock
  • signals
Returns:

Rtype DSubscription:
 
update_meta(meta)[source]
Parameters:meta – of type DPlugin
Returns:
class papi.data.DPlugin.DSubscription(dblock)[source]

Bases: papi.data.DObject.DObject

DSubscription is used for the internal description of a subscription.

add_signal(signal)[source]

Add Signal for this Subscription

Parameters:signal
Returns:
attach_signal(signal)[source]
get_dblock()[source]

Returns the block whose signals are subscribed.

Returns:
Return type:DBlock
get_signals()[source]

Returns a copy of all signals which are subscribed.

Returns:
Return type:[]
remove_signal(signal)[source]
rm_signal(signal)[source]

Remove Signal for this Subscription

Parameters:signal
Returns:
update_meta(subscription)[source]

papi.data.DSignal module

Contributors Sven Knuth

class papi.data.DSignal.DSignal(uname, dname=None)[source]

Bases: papi.data.DObject.DObject

DSignal is used for the internal description of a signal.

get_name()[source]

Returns the name of this signal.

Return name:Unique name

Module contents

Contributors Sven Knuth