how to use variables collected by a plugin?
Dear opensesame users,
I'm a newbee in the opensesame world. I have a project to complet to I need to develop some plugins to achieve this. Since I have no experience with opensesame I tried first to write a minimal plugin. Here are the info.yaml and to *.py files:
author: author category: plugin essai description: un plugin d'essai controls: - label: essai name: line_edit_essai type: line_edit var: essai
from libopensesame.py3compat import * from libopensesame.oslogging import oslogger from libopensesame.item import item from libqtopensesame.items.qtautoplugin import qtautoplugin class plugin_essai(item): def reset(self): self.var.essai = u'un texte par défaut' oslogger.debug('plugin_essai has been initialized') def prepare(self): item.prepare(self) def run(self): self.set_item_onset() class qtplugin_essai(plugin_essai, qtautoplugin): def __init__(self, name, experiment, script = None): plugin_essai.__init__(self, name, experiment, script) qtautoplugin.__init__(self, __file__)
Very simple as you can see. Here is my question: A essai variable is declared in the yaml file to capture the line_edit data and is passed to var in the class plugin_essai. Up to this, it seems in line with what I understand of opensesame. However, this var.essai variable is not registered in the var inspector and, accordingly, a script that would try to use it crash with the error message No essai variable exists. Could you help me to figure how to use informations captured in a plugin?
Thanks so much for your help.