Howdy, Stranger!

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

Supported by

OS4-style plugin with GUI loading problem

Dear Sebastiaan,

I am trying to load your OS4 example plugin from your personal git as a starting point for my new plugin. This code contains a GUI class.

When loading, it complains about the class name:

AttributeError: module 'example_plugin' has no attribute 'qtexample_plugin'


Then I tried the old style naming:

'class qtexample_plugin(ExamplePlugin, QtAutoPlugin):'


Now the plugin loads with the following error:

Traceback (most recent call last):

 File "D:\opensesame_4.0.5\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 749, in dropEvent

   self.drop_event_item_new(data, e)

 File "D:\opensesame_4.0.5\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 730, in drop_event_item_new

   item.open_tab()

 File "D:\opensesame_4.0.5\Lib\site-packages\libqtopensesame\items\qtitem.py", line 129, in open_tab

   self.tabwidget.add(self.widget(), self.item_icon(), self.name)

                      ^^^^^^^^^^^^^

 File "D:\opensesame_4.0.5\Lib\site-packages\libqtopensesame\items\qtitem.py", line 39, in inner

   self.init_edit_widget()

 File "C:\Users\xxxx\Documents\OS_Plugins\opensesame-plugin-example\opensesame_plugins\example\example_plugin\example_plugin.py", line 74, in init_edit_widget

   super().init_edit_widget()

 File "D:\opensesame_4.0.5\Lib\site-packages\libqtopensesame\items\qtautoplugin.py", line 64, in init_edit_widget

   for c in self.plugin_attribute('controls'):

TypeError: 'NoneType' object is not iterable


It looks like 'controls' is not passed to the init widget. I am using exactly the same as your __init__.py script.

Do you have a hint what is wrong with the plugin example code?

Comments

  • Hi @MartinS ,

    Good to hear that you're making your own plugin! I'm not sure what example you're using, but the up-to-date example is here:

    I noticed that the link is incorrect on the documentation site, so I'll fix that.

    A GUI class is not necessary in principle, unless you have specific GUI elements that you want to implement (beyond the default GUI controls that the plugin creates automatically). Is that the case?

    — Sebastiaan

  • edited October 2023

    Hi Sebastiaan,

    Thanks for your reply. I am using the same code as yours from the git you mention.

    Yes, I want to make use of GUI elements. I assume that the plugin example is the bare minimum that should load in OS4 out of the box. Am I assuming this correct? When I load the example, it comes with the error:

    AttributeError: module 'example_plugin' has no attribute 'qtexample_plugin'
    

    OS4 is expecting a class name other than:

    QtExamplePlugin
    

    according to the Creating a (4.0) Plugin tutorial.

    Best,

    Martin

  • Hi @MartinS ,

    I assume that the plugin example is the bare minimum that should load in OS4 out of the box. Am I assuming this correct?

    Yes but there's also a dummy GUI class by way of example.

    When I load the example, it comes with the error:

    Based on this error it seems that you're not running the example plugin (or perhaps an older version of the example). Can you try again with the latest snapshot from GitHub? You'll see that it works and then you can take it from there.

    — Sebastiaan

  • Hi @MartinS ,

    I just ried it again, and the updated example plugin does (also) work. One thing that comes to mind though, is that you haven't installed the plugin as a Python package but rather using the old-style way of specifying a plugin folder, in which case OpenSesame tries to load it as an old-style plugin.

    In your case, the following folder should be in the Python path so that OpenSesame can find the plugin: C:\Users\xxxx\Documents\OS_Plugins\opensesame-plugin-example

    — Sebastiaan

  • Hi Sebastiaan,

    Great! The example plugin works now, by adding the plugin path to the python path. This is nice for future releasing of plugins as a python package for seamless integration.

    Thanks a lot!

    Best,

    Martin

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