[wxPython-users] wx.lib.pubsub Calling Sequence

Werner F. Bruhin werner.bruhin at free.fr
Mon Dec 4 11:40:58 PST 2006


Hi Rich,

Rich Shepard wrote:
>   Well, while I'm almost there with what I need, I have a problem with 
> the
> listener being called too soon, so there're no data for the called 
> method to
> use. Let me try to clearly explain.
>
>   In one module/class is the OpenDB() function with the
> Publisher().sendMessage() function, and it begins like this:
>
>   def OpenDB(self, dbFileName):
>     self.con = sqlite3.connect(self.appData.dbFileName, 
> isolation_level=None)
>     self.cur = self.con.cursor()
>
>     self.appData.con = self.con
>     self.appData.cur = self.cur
>
move the following.
>     Publisher().sendMessage(self.appData.projOpen, data=None)
>
>     # policy page variables
>     self.appData.cur.execute("select comp_name from component where 
> comp_cat='natural'")
>     self.appData.polNat = self.appData.cur.fetchall()
>     print 'OpenDB: ', self.appData.polNat
to here (only after you do the execute AND fetchall is your data available):
    Publisher().sendMessage(self.appData.projOpen, data=None)

At least this is what I think.

Werner





More information about the wxpython-users mailing list