Intercept "Deleted stale lock file" message.

Hi,
using wx.SingleInstanceChecker I make this

class App(wx.App):

    def OnInit(self):

        data.OnReadData()
        self.instance = wx.SingleInstanceChecker('client_lock',
                                                 cfg.local_parameters
['client_path'])
        if self.instance.IsAnotherRunning():
            message = "Okay, Houston, we've had a problem here.
\nAnother instance is running"
            wx.MessageBox(message, cfg.appTitle)
            return False

The snip work fine except when I close and restar the application.
In fact when I try this ,'Python information' say me that

Deleted stale lock file '/home/beppe/my_huge_app/client_lock'.

How can I intercept this message?
I have read about wx.Log but I don't understand how to use this.
Thank for any suggestions.
Beppe

Hi,

The snip work fine except when I close and restar the application.
In fact when I try this ,'Python information' say me that

Deleted stale lock file '/home/beppe/my_huge_app/client_lock'.

How can I intercept this message?
I have read about wx.Log but I don't understand how to use this.
Thank for any suggestions.

Call wx.Log.EnableLogging(False) (note static method) in your startup code.

The real issue though is that you need to cleanup your single instance
checker when your app exits so this condition does not happen at all.

i.e)

def OnInit:
    self.checker = wx.SingleInstanceChecker(...)

def OnExit:
    del self.checker

Cody

···

On Mon, Dec 14, 2009 at 10:03 AM, Beppe <g.costanzi@email.it> wrote:

Thank Cody,
I think that set wx.Log.EnableLogging to False is plenty.
In my main def

def main():
    wx.SetDefaultPyEncoding('latin-1')
    wx.Log.EnableLogging(False)
    app = App(True,'client_log')
    app.MainLoop()

Beppe

···

On Dec 14, 5:47 pm, Cody Precord <codyprec...@gmail.com> wrote:

Hi,

On Mon, Dec 14, 2009 at 10:03 AM, Beppe <g.costa...@email.it> wrote:
> The snip work fine except when I close and restar the application.
> In fact when I try this ,'Python information' say me that

> Deleted stale lock file '/home/beppe/my_huge_app/client_lock'.

> How can I intercept this message?
> I have read about wx.Log but I don't understand how to use this.
> Thank for any suggestions.

Call wx.Log.EnableLogging(False) (note static method) in your startup code.

The real issue though is that you need to cleanup your single instance
checker when your app exits so this condition does not happen at all.

i.e)

def OnInit:
self.checker = wx.SingleInstanceChecker(...)

def OnExit:
del self.checker

Cody