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.
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.
EventGhost Application Control Plugin
EventGhost Application Control Plugin
Hi guys
I wrote a small plugin which allows to access and control EventGhost application functions from macros like 'Restart Program', 'Save Configuration', 'Minimize Window' etc.
New in version 0.3.2: Log file monitoring and parsing. The new action 'Log Monitor' monitors the screen log and fires an event if a specific message occurs. Optionally, the log message can be parsed in several ways and the extracted values found can be used as event payload or a variable can be set.
Handy for example if you want to react in some way when an unexpected error occurs or in another scenario when you want to extract a value from the log stream and fire an event when it occurs.
It's easy to add additional functions, just let me know if you miss something.
have fun
I wrote a small plugin which allows to access and control EventGhost application functions from macros like 'Restart Program', 'Save Configuration', 'Minimize Window' etc.
New in version 0.3.2: Log file monitoring and parsing. The new action 'Log Monitor' monitors the screen log and fires an event if a specific message occurs. Optionally, the log message can be parsed in several ways and the extracted values found can be used as event payload or a variable can be set.
Handy for example if you want to react in some way when an unexpected error occurs or in another scenario when you want to extract a value from the log stream and fire an event when it occurs.
It's easy to add additional functions, just let me know if you miss something.
have fun
- Attachments
-
- EGAppControl_0.3.2.zip
- Log Monitor action requires EventGhost 0.4.1.r1610 or higher
- (224.1 KiB) Downloaded 733 times
Last edited by phlox on Fri Jan 25, 2013 10:02 pm, edited 4 times in total.
Re: EventGhost Application Control Plugin
phlox,
First, thanks for sharing.
I justed wanted to point out that I get several errors using the Hide/Restore the Main Window actions. I can post the errors if you like, but it is no big deal for me. The errors happen if you restore the window and try to click on any action in EventGhost tree.
Regarding additional functions, I alway like to backup my xml file when changes are made. I use the following Python script:
Again, thanks for sharing.
First, thanks for sharing.
I justed wanted to point out that I get several errors using the Hide/Restore the Main Window actions. I can post the errors if you like, but it is no big deal for me. The errors happen if you restore the window and try to click on any action in EventGhost tree.
Regarding additional functions, I alway like to backup my xml file when changes are made. I use the following Python script:
Code: Select all
import time
from datetime import date
if eg.document.isDirty:
eg.document.Save()
print "File needs to be saved"
today = date.today()
FilePath = "D:\\Software\\EventGhost\\XML Backups\\"+str(today)+".xml"
eg.document.WriteFile(FilePath)
eg.Wait(2)
Re: EventGhost Application Control Plugin
first of all, sorry for the late reply, I simply overlooked it.
I can't reproduce these errors here, could you post your config and the error log? Thx in advance, I'll look at it.
regarding the additional function: I think it's a good idea to add some 'IsDirty' action, but the rest of your script is probably too specific to pack it into a generic action - I guess your solution is best you can do for this requirement.
I can't reproduce these errors here, could you post your config and the error log? Thx in advance, I'll look at it.
regarding the additional function: I think it's a good idea to add some 'IsDirty' action, but the rest of your script is probably too specific to pack it into a generic action - I guess your solution is best you can do for this requirement.
Re: EventGhost Application Control Plugin
phlox
While I don't need this for EG itself, I still wanted to thank you for sharing!
While I don't need this for EG itself, I still wanted to thank you for sharing!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Re: EventGhost Application Control Plugin
Here's a minor update: EventGhost Application Control 0.1.1 (download in the first post)
Changes
Regarding the problem reported by @kalia: I can't reproduce. As long as nobody else confirms, I assume it was a mistake / had another cause.
Changes
Code: Select all
# Added action IsDirty
Re: EventGhost Application Control Plugin
phlox,
Don't bother about the errors I mentioned. It was probably something with my config. I don't have the plugin installed in my current config (I use scripts instead to accomplish the plugin actions). That is why I have not posted the errors.
Thanks,
kalia
Don't bother about the errors I mentioned. It was probably something with my config. I don't have the plugin installed in my current config (I use scripts instead to accomplish the plugin actions). That is why I have not posted the errors.
Thanks,
kalia
Re: EventGhost Application Control Plugin
Thank you for this. It's handy to be able to restart EventGhost on command. It would be even handier if errors and information messages could be used as triggers. That way if something goes wrong EG could be restarted automatically.
Re: EventGhost Application Control Plugin
Think that's a good idea. I could implement an action which monitors a configurable info or error message and then triggers a configurable event. I'll do that in the near future, as soon as I find some time to code again.
Re: EventGhost Application Control Plugin
I need that function too. If some program hangs, eventgost will hang also and i have to use my keyboard. So nice, if you can "fix" that one and only eventghost weak point.phlox wrote:Think that's a good idea. I could implement an action which monitors a configurable info or error message and then triggers a configurable event. I'll do that in the near future, as soon as I find some time to code again.
Re: EventGhost Application Control Plugin
I'm almost done - unfortunately the rainy Sunday was a bit too short to finalized - I need some more time
Here's a preview of the new action:
(obsolete attachment removed, see here for an example)
Here's a preview of the new action:
(obsolete attachment removed, see here for an example)
Last edited by phlox on Wed Nov 14, 2012 7:40 pm, edited 1 time in total.
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: EventGhost Application Control Plugin
It looks good.
While I have no use for it at the moment, but you never know.
I just want to ask, it will be compatible with Log redirector plugin?
Pako
While I have no use for it at the moment, but you never know.
I just want to ask, it will be compatible with Log redirector plugin?
Pako
Re: EventGhost Application Control Plugin
Hi Pako
yes, of course. The implementation is fully transparent for the rest of EG. It's actually very simple, the action has a wrapper to the existing LogCtrl API (called by 'eg.log.SetCtrl(f)').
btw, I'm using Log Redirector by myself, it's very handy.
yes, of course. The implementation is fully transparent for the rest of EG. It's actually very simple, the action has a wrapper to the existing LogCtrl API (called by 'eg.log.SetCtrl(f)').
btw, I'm using Log Redirector by myself, it's very handy.
Code: Select all
class LogWrapper:
def __init__(self):
self.egLogCtrl = eg.log.ctrl
self.logListener = []
def AddLogListener(self, listener):
if len(self.logListener) == 0:
eg.log.SetCtrl(self)
if listener not in self.logListener:
self.logListener.append(listener)
def StopAllLogListeners(self):
eg.log.SetCtrl(self.egLogCtrl)
self.logListener = []
# implements the LogCtrl API
def WriteLine(self, line, icon, wRef, when, indent):
self.egLogCtrl.WriteLine(line, icon, wRef, when, indent)
for listener in self.logListener:
listener.ProcessMsg(line, icon)
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: EventGhost Application Control Plugin
Great.
I was just worried that there might be some conflict and something might stop working.
But it is obvious that you (unlike me) a real programmer.
BTW - I've never heard of Python until I met EventGhost. And everything I've done in Python, concerns EventGhost.
I've previously programmed only single-chip microcomputers (as a hobby) and it was in assembler.
Pako
I was just worried that there might be some conflict and something might stop working.
But it is obvious that you (unlike me) a real programmer.
BTW - I've never heard of Python until I met EventGhost. And everything I've done in Python, concerns EventGhost.
I've previously programmed only single-chip microcomputers (as a hobby) and it was in assembler.
Pako
Re: EventGhost Application Control Plugin
It looks great. I look forward to trying it.phlox wrote:I'm almost done - unfortunately the rainy Sunday was a bit too short to finalized - I need some more time
Here's a preview of the new action:
Re: EventGhost Application Control Plugin
Thanks - but I have to admit that my Python knowledge is also very young and my Python horizon ends at the borders of EventGhost (but I have a Java background and the language concepts are quite similar). Many things I learned in Python was by reading Your code, Pako, my full respect!Pako wrote:Great.
But it is obvious that you (unlike me) a real programmer.