Commit 64522f07 authored by Valentin Valls's avatar Valentin Valls
Browse files

Create objectref

parent f50eae1e
"""Test related module to share controllers
This module is intended to be used by unittest and other projects.
Any API changes have to be done precociously, including changes in the master
branch.
"""
from bliss.config.beacon_object import BeaconObject
class ObjectRef(BeaconObject):
"""
Define a BLISS object referring another BLISS object.
.. code-block::
- name: objectref1
plugin: bliss
package: bliss.controllers.test.objectref
class: ObjectRef
ref: $roby
- name: objectref2
plugin: bliss
package: bliss.controllers.test.objectref
class: ObjectRef
ref: !!null
This is mostly used for unit tests.
"""
def __init__(self, name, config):
BeaconObject.__init__(self, config=config, name=name)
ref = BeaconObject.config_obj_property_setting(name="ref")
def __info__(self):
if self.ref is None:
ref = "None"
else:
ref = f"${self.ref.name}"
info_str = f"{self.name} references {ref}\n"
return info_str
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment