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.

Clear log - python command?

If you have a question or need help, this is the place to be.
Post Reply
JohnieBraaf
Posts: 2
Joined: Thu Jul 28, 2011 11:24 pm

Clear log - python command?

Post by JohnieBraaf »

Hi,

I'm trying to clear the log from python.

The best I can come up with:

Code: Select all

eg.log.data.clear()
eg.MainFrame.LogCtrl.OnCmdClearLog()
but it tells me that there is no LogCtrl attribute :?:

Regards
JohnieBraaf
Posts: 2
Joined: Thu Jul 28, 2011 11:24 pm

Re: Clear log - python command?

Post by JohnieBraaf »

Without having to much knowledge of the internal working of EventGhost, I assume that OnCmdClearLog() is a private method of the LogCtrl class.

Code: Select all

def OnCmdClearLog(self, dummyEvent=None):
        self.SetItemCount(0)
        self.DeleteAllItems()
        self.data.clear()
        eg.log.data.clear()
        self.ScrollList(0, 1000000)
        self.Refresh()
In the class its getting referenced by self.OnCmdClearLog.

So to rephrase my question, is there a way to call this private method from a python scipt? Can I start a new instance? And how to go about this?
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Clear log - python command?

Post by jinxdone »

You can clear the rows from the log pane with eg.log.ctrl.data.clear()
Post Reply