Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Experiences with OS4 (plugin adventures)

edited May 2023 in OpenSesame

Hi Sebastiaan:

My experieces with using "my" plugins on OS4: My plugins are a set of plugins I wrote mainly to connect OS to hardware we use for synchronising OS with EEG recording systems and Buttonboxes at the University of Groningen.

OpenSesame 4.0.0a33 Melodramatic Milgram

the installation goes well:

!pip install evtplugins
Collecting evtplugins
 Using cached EvtPlugins-0.99.34-py3-none-any.whl (51 kB)
Requirement already satisfied: pyEVT in c:\program files (x86)\opensesame4\lib\site-packages (from evtplugins) (0.99.32)
Requirement already satisfied: hidapi in c:\program files (x86)\opensesame4\lib\site-packages (from pyEVT->evtplugins) (0.13.1)
Requirement already satisfied: setuptools>=19.0 in c:\program files (x86)\opensesame4\lib\site-packages (from hidapi->pyEVT->evtplugins) (67.7.2)
Installing collected packages: evtplugins
Successfully installed evtplugins-0.99.34


using the EVTxx plugin give the following trace and fails:


Traceback (most recent call last):
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 736, in dropEvent
  self.drop_event_item_new(data, e)
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 638, in drop_event_item_new
  item, new_items = self.drop_get_item_snippet(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 525, in drop_get_item_snippet
  item = self.experiment.items.new(item_dict[u'item-type'],
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtitem_store.py", line 105, in new
  item = super(qtitem_store, self).new(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\item_store.py", line 158, in new
  item = self.experiment.plugin_manager[_type].build(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtplugin_manager.py", line 98, in build
  return plugins.load_plugin(self.name, *args, prefix='qt', **kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\plugins.py", line 420, in load_plugin
  item = item_class(item_name, experiment, string)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\share\opensesame_plugins\EVTxx\EVTxx.py", line 78, in __init__
  qtautoplugin.__init__(self, __file__)
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\items\qtplugin.py", line 68, in __init__
  self.init_item_icon()
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\items\qtplugin.py", line 77, in init_item_icon
  icon = self.plugin_manager[self.item_type].icon
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\plugin_manager.py", line 216, in __getitem__
  return self._plugins[name]
      ~~~~~~~~~~~~~^^^^^^
KeyError: 'e_v_txx'


The Responsebox pluging yeilds the same (?) error:


Traceback (most recent call last):
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 736, in dropEvent
  self.drop_event_item_new(data, e)
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 638, in drop_event_item_new
  item, new_items = self.drop_get_item_snippet(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 525, in drop_get_item_snippet
  item = self.experiment.items.new(item_dict[u'item-type'],
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtitem_store.py", line 105, in new
  item = super(qtitem_store, self).new(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\item_store.py", line 158, in new
  item = self.experiment.plugin_manager[_type].build(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtplugin_manager.py", line 98, in build
  return plugins.load_plugin(self.name, *args, prefix='qt', **kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\plugins.py", line 420, in load_plugin
  item = item_class(item_name, experiment, string)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\share\opensesame_plugins\ResponseBox\ResponseBox.py", line 110, in __init__
  qtautoplugin.__init__(self, __file__)
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\items\qtplugin.py", line 68, in __init__
  self.init_item_icon()
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\items\qtplugin.py", line 77, in init_item_icon
  icon = self.plugin_manager[self.item_type].icon
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\plugin_manager.py", line 216, in __getitem__
  return self._plugins[name]
      ~~~~~~~~~~~~~^^^^^^
KeyError: 'response_box'


When I rename the EVTxx plugin to evtxx (directory and filenames....) I get another errormessage:


Traceback (most recent call last):
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 736, in dropEvent
  self.drop_event_item_new(data, e)
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 638, in drop_event_item_new
  item, new_items = self.drop_get_item_snippet(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 525, in drop_get_item_snippet
  item = self.experiment.items.new(item_dict[u'item-type'],
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtitem_store.py", line 105, in new
  item = super(qtitem_store, self).new(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\item_store.py", line 158, in new
  item = self.experiment.plugin_manager[_type].build(
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libqtopensesame\misc\qtplugin_manager.py", line 98, in build
  return plugins.load_plugin(self.name, *args, prefix='qt', **kwargs)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Program Files (x86)\OpenSesame4\Lib\site-packages\libopensesame\plugins.py", line 419, in load_plugin
  item_class = getattr(item_module, prefix + plugin)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'evtxx' has no attribute 'qtevtxx'


because this module has a class qtEvtxx(Evtxx, qtautoplugin) i rename that to qtevtxx and now I can drag the plugin 

to the tree and I get the interface.


When I run a simple test, opensesame crashes hard with a message:


AttributeError: module 'evtxx' has no attribute 'evtxx'


leading me to rename the object (the plugin class) to evtxx...


And now it all works.....


So my "problems" are caused by capitalisation of filenames and


I assume at this moment this is probably an artifact of my hacking way of programming, but maybe this could help others to get the transision to OS4 as smooth as possible.

Can you give me some pointers on how to make my plugins follow the style guidelines better?

Comments

  • Hi @MarkS ,

    Thanks for reporting this. Indeed, it's because of the changed naming conventions in the new 4.0 plugin API. (Which now follows the PEP8 naming conventions.) However, it's still a bug because backwards compatibility with older plugins should have been preserved. I pushed a fix for this in 4.0.0a40. If you update, which you can do through the built-in updater, then the plugins should work again. If not, let me know.

    — Sebastiaan

  • Works as a charm now. Thank you Sebastiaan.

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games