A __stop__ and __close__ method also for eg.ActionClass???
-
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
A __stop__ and __close__ method also for eg.ActionClass???
Hi,
I'm currently working on a plugin for a scheduler based on ideas and code structure from Bartman's Timer plugin.
I think it would be a good thing to have a __stop__(self) and a __close__(self) method also for egActionClass.
You can see this in Bartman's Timer plugin when you have defined and started some timers. If you delete or stop them, they still keep running and you have to abort them separatly. Also it would be good to have a method to start/run when you apply/save the settings.
Best regards, Walter
I'm currently working on a plugin for a scheduler based on ideas and code structure from Bartman's Timer plugin.
I think it would be a good thing to have a __stop__(self) and a __close__(self) method also for egActionClass.
You can see this in Bartman's Timer plugin when you have defined and started some timers. If you delete or stop them, they still keep running and you have to abort them separatly. Also it would be good to have a method to start/run when you apply/save the settings.
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: A __stop__ and __close__ method also for eg.ActionClass???
Hi,
I'm also missing these functions. For a specific plugin I'm writing I need a __stop__ function in eg.ActionBase.
What is actually called when a action item is disabled?
CoderX
I'm also missing these functions. For a specific plugin I'm writing I need a __stop__ function in eg.ActionBase.
What is actually called when a action item is disabled?
CoderX
Re: A __stop__ and __close__ method also for eg.ActionClass???
Actually nothing is called.CoderX wrote:I'm also missing these functions. For a specific plugin I'm writing I need a __stop__ function in eg.ActionBase.
What is actually called when a action item is disabled?
An action has no concept of running, stopping ot other means in that direction. It is just called when appearing in a macro. The time an action is running is just the execution time of call function.
It didn't bothered me while coding the Timer plugin
Re: A __stop__ and __close__ method also for eg.ActionClass???
Hi Bartman,Bartman wrote:It didn't bothered me while coding the Timer plugin
I studied the timer plugin code, you used another action to abort the timer. This is perfectly fine. I'm currently writing a cron plugin, I could also add an action to abort the cron job.
I think for the end-user it is more logical that if "disable item" is selected for an action the execution of the action really stops. Thus in my case the cron job is canceled and is scheduled again if the user enables the action.
So strictly __stop__ it is not needed for programming but I think to be able to disable an action is more logical for the end-user and would fit perfectly in the EventGhost concept.
~CoderX
Re: A __stop__ and __close__ method also for eg.ActionClass???
action are continously disabled when using the very central "enable exclusive" action.
Keeping track of that would certainly screw my mind in a larger config.
Keeping track of that would certainly screw my mind in a larger config.
Re: A __stop__ and __close__ method also for eg.ActionClass???
Don't know what this means, but sounds like "can not be implemented"Bartman wrote:action are continously disabled when using the very central "enable exclusive" action.
Keeping track of that would certainly screw my mind in a larger config.

~CoderX
Re: A __stop__ and __close__ method also for eg.ActionClass???
If you disable the folder in the tree the action is also considered disabled.
Re: A __stop__ and __close__ method also for eg.ActionClass???
I see now, this gives different thoughts about implementing the plug-in. The problem I created was that I wanted to disable the cron job within the action. In this situation there must be something that tells the action that it is disabled
. Better way is to tell the plug-in to disable a cron job (by an action). A cron plugin could be programmed as following:
Within eg.PluginBase the cron scheduler process runs. Two actions are defined, one to start a schedule, one to stop a schedule. The action's can access the scheduler trough "self.plugin".
So the cron job is disabled by executing a "job disable action" and not by disabling the the action.
No more need for __stop__
~CoderX

Within eg.PluginBase the cron scheduler process runs. Two actions are defined, one to start a schedule, one to stop a schedule. The action's can access the scheduler trough "self.plugin".
So the cron job is disabled by executing a "job disable action" and not by disabling the the action.
No more need for __stop__

~CoderX