Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

EG and Stackless

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: EG and Stackless

Post by kgschlosser »

i am in complete agreement with you on the stackless thing.

there is next to no information on how to use it. and how it actually functions and the developer of stackless has pretty much moved on to developing pypi so there hasn't been much going on with it except small patches for years now.


and to be honest i have been trying to work out a solution as to how to handle the way EG opens dialogs. because of the use of the stackless channels and how a call to send will block until a receiver has picked up i have not has success in duplicating. it just keeps on crashing EG. even if i start the dialog in a separate thread.


the while panel.Affirmed() is very misleading. because it never actually loops. the call to Affirmed gets on a received line. and then it gets blocked until an event is triggered from the press of the ok, cancel, test, apply buttons.

and that event then uses the channel send to pass data to allow the while panel.Affirmed() to exit. now if that isn't screwy enough. there is also thread that initiated the dialog that is running separately and trying to iter the dialog for results and that one also gets blocked until a result comes about.

and then there are 2 versions of this setup all smooshed into one class, one runs as a modal and the other as a normal dialog. and they somewhat operate the same but the way the data is received differs.

the file where all of this takes place is in the eg\Classes\TaskletDialog.py
and also any of the "new" modules located in the eg\Classes\MainFrame\UndoHandler

there is a lot of voodoo code with this portion of EG
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: EG and Stackless

Post by kgschlosser »

and I am finding more and more that stackless and wx do not really like each other. because if i change the dialog to a panel to be added as a pane into the agw.aui it either does nothing at all and just exits. or it locks up.

and where I am stuck is that i do not want to break any code for a plugin that may use this in some fashion. for example.

if you open the ConfigDialog.py file you will see how it handles the addition of the test button. and it sends a command directly to the TaskletDialog.DispatchCommand() because the ConfigDialog is a subclass of the TaskletDialog

and the ConfigPanel is thrown in the mix also but all of the functions located in the ConfigPanel are accessible by a plugin or action Configure and I personally have in the past manipulated the eg.ConfigPanel() a bit to get it to show how I wanted. and some of the things i changed were gotten from the Config.Dialog which in turn was inherited from the TaskletDialog

it's a sticky mess. and changing anything in how it works to much could break someone's plugin.

but the whole issue i seem to run into is i do not know how to intentionally "block" without causing EG to hang. and I know this can be done with threading and using locks. but I am not that savvy yet.
If you like the work I have been doing then feel free to Image
Post Reply