Page 2 of 2

Re: EG and Stackless

Posted: Thu Sep 29, 2016 4:19 am
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

Re: EG and Stackless

Posted: Thu Sep 29, 2016 4:30 am
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.