OnExit can't access app's attributes

I'm creating a XMLRPC server in my application object's OnInit and I wanted to shut it down in OnExit, but it would appear that OnExit doesn't have access to the attributes of the object it is defined in.

In the attached example I would expect OnExit to print 8, but it prints 7 as though the value was never changed.

Is this by design?

Windows XP SP2
wxPython 2.8.0.1
Python 2.4.2

app.py (390 Bytes)

Hi Eli,

actually the value has changed… from 8 to 7 :wink:
you see… the OnInit method is called when you init the app
wx.App.init(…)
and it does sets the momo to 8 but after this… you set the momo to 7 in your App’s ini

another way to look at it is: if you replace the line
self.momo = 7
with
print self.momo
you will not get an error… the momo is already set :wink:

Peter

···

On 2/7/07, Eli Golovinsky gooli@tuzig.com wrote:

I’m creating a XMLRPC server in my application object’s OnInit and I
wanted to shut it down in OnExit, but it would appear that OnExit
doesn’t have access to the attributes of the object it is defined in.

In the attached example I would expect OnExit to print 8, but it prints
7 as though the value was never changed.

Is this by design?

Windows XP SP2
wxPython 2.8.0.1

Python 2.4.2


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org


There is NO FATE, we are the creators.

Oh.. silly me.
Thanks!

Peter Damoc wrote:

···

Hi Eli,

actually the value has changed... from 8 to 7 :wink:
you see.... the OnInit method is called when you init the app
wx.App.__init__(...)
and it does sets the momo to 8 but after this... you set the momo to 7 in your App's __ini__

another way to look at it is: if you replace the line
self.momo = 7
with
print self.momo
you will not get an error... the momo is already set :wink:

Peter

On 2/7/07, *Eli Golovinsky* <gooli@tuzig.com <mailto:gooli@tuzig.com>> > wrote:

    I'm creating a XMLRPC server in my application object's OnInit and I
    wanted to shut it down in OnExit, but it would appear that OnExit
    doesn't have access to the attributes of the object it is defined in.

    In the attached example I would expect OnExit to print 8, but it prints
    7 as though the value was never changed.

    Is this by design?

    Windows XP SP2
    wxPython 2.8.0.1 <http://2.8.0.1>
    Python 2.4.2

    ---------------------------------------------------------------------
    To unsubscribe, e-mail:
    wxPython-users-unsubscribe@lists.wxwidgets.org
    <mailto:wxPython-users-unsubscribe@lists.wxwidgets.org>
    For additional commands, e-mail:
    wxPython-users-help@lists.wxwidgets.org
    <mailto:wxPython-users-help@lists.wxwidgets.org>

--
There is NO FATE, we are the creators.