Thread: Re: [Boa Constr] Boa 0.4.0 pre release branch in CVS (Page 2)
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2005-03-04 10:37:41
|
Hi Paul, sosman wrote: > Riaan Booysen wrote: > >> Hi Paul, >> >> There are no upgrader scripts atm, sorry. >> >> Cheers, >> Riaan. >> > I have created a basic upgrader that munges the EVT macros from 2.4 to > 2.5 style. It is complete insofar is the usage of events in the app I > am trying to port goes (ie it is not complete). > > http://metrak.com/brewsta/files/upgrade.py > > The good news is that it is fairly easy to understand and quite short, > relying on pyparsing for the heavy lifting. As is, people could > potentially quite useful (as I did). > > If people are interested in this kind of thing then I could perhaps > invest some more effort into it. Please do, that would be great! I've also editited it a bit (making adding more events easier) New version is on the wiki page. It's not ideal to have to predefine all the events (there are really so many) but it's much better than not having an upgrader ;) Thanks, Riaan. |
From: sosman <sou...@me...> - 2005-03-07 10:43:33
Attachments:
upgrade.py
|
Riaan Booysen wrote: > I've also editited it a bit (making adding more events easier) > New version is on the wiki page. > > It's not ideal to have to predefine all the events (there are > really so many) but it's much better than not having an upgrader ;) Riaan - there is no technical reason why the event names must be predefined. I just took the conservative approach to change stuff that I knew needed changing, rather than change everything with the possibility of making broken code changes. Having said that, attached is an upgrade script that will match any event binding. User beware. cheers |
From: Werner F. B. <wer...@fr...> - 2005-03-07 14:24:33
|
Hi Paul and Riaan, I am working on a version with all your changes (including the latest from Paul), I also added things for class name changes and some others. In addition I did a dialog which allows to convert a whole "directory" to a "directoryupgraded". However, still have a problem with my events, I now get them to convert no problem, but the source code replacement is not quit correct. I must be doing something wrong with the pyparsing stuff but can't see it (at least not yet) - any hints appreciated. What happens: Code like this: EVT_TEXT(self.name, self.name.GetId(), self.EvtSaveData) Is changed to: EVT_TEXself.name.Bind(wx.EVT_TEXT, self.EvtSaveData, id=self.name.GetId()) Note also that the next source line is joined to it. The pyparsing instructions are: qualIdent2 = Word(alphanums+"_.()") # 3 Parameter evt macros. # specialEventCode = True required # event codes containing e.g. control.GetId() in code evt_P3a = Literal("EVT_") + uident + LPAREN +\ qualIdent + COMMA +\ qualIdent2 + COMMA +\ qualIdent +\ RPAREN evt_P3a.setParseAction(self.evt_P3aAction) def evt_P3aAction(self, s, l, t): ev, evname, win, id, fn = t return '%s.Bind(wx.%s%s, %s, id=%s)' % (win, ev, evname, fn, id) Can anyone see why the "EVT_TEX" remains in the upgraded source and why the next line is joine to it? Thanks in advance for any hints. Werner sosman wrote: > Riaan Booysen wrote: > >> I've also editited it a bit (making adding more events easier) >> New version is on the wiki page. >> >> It's not ideal to have to predefine all the events (there are >> really so many) but it's much better than not having an upgrader ;) > > > Riaan - there is no technical reason why the event names must be > predefined. I just took the conservative approach to change stuff that > I knew needed changing, rather than change everything with the > possibility of making broken code changes. > > Having said that, attached is an upgrade script that will match any > event binding. User beware. > > cheers |
From: Riaan B. <riaan@e.co.za> - 2005-03-07 14:35:31
|
Hi Werner, Werner F. Bruhin wrote: > Hi Paul and Riaan, > > I am working on a version with all your changes (including the latest > from Paul), I also added things for class name changes and some others. > In addition I did a dialog which allows to convert a whole > "directory" to a "directoryupgraded". Cool, it's quite easy to add such a dialog to the Boa Tools menu (2 or 3 lines), this can be done once all the issues are sorted out. Hope Paul can help with the rest. Cheers, Riaan. |
From: Werner F. B. <wer...@fr...> - 2005-03-07 15:30:28
|
Found it! The file had an indentation problem! See you Werner Werner F. Bruhin wrote: > Hi Paul and Riaan, > > I am working on a version with all your changes (including the latest > from Paul), I also added things for class name changes and some others. > In addition I did a dialog which allows to convert a whole > "directory" to a "directoryupgraded". > > However, still have a problem with my events, I now get them to convert > no problem, but the source code replacement is not quit correct. I must > be doing something wrong with the pyparsing stuff but can't see it (at > least not yet) - any hints appreciated. > > What happens: > Code like this: EVT_TEXT(self.name, self.name.GetId(), self.EvtSaveData) > > Is changed to: EVT_TEXself.name.Bind(wx.EVT_TEXT, self.EvtSaveData, > id=self.name.GetId()) > > Note also that the next source line is joined to it. > > The pyparsing instructions are: > qualIdent2 = Word(alphanums+"_.()") > > # 3 Parameter evt macros. > # specialEventCode = True required > # event codes containing e.g. control.GetId() in code > evt_P3a = Literal("EVT_") + uident + LPAREN +\ > qualIdent + COMMA +\ > qualIdent2 + COMMA +\ > qualIdent +\ > RPAREN > evt_P3a.setParseAction(self.evt_P3aAction) > > def evt_P3aAction(self, s, l, t): > ev, evname, win, id, fn = t > return '%s.Bind(wx.%s%s, %s, id=%s)' % (win, ev, evname, fn, id) > > Can anyone see why the "EVT_TEX" remains in the upgraded source and why > the next line is joine to it? > > Thanks in advance for any hints. > Werner > > sosman wrote: > >> Riaan Booysen wrote: >> >>> I've also editited it a bit (making adding more events easier) >>> New version is on the wiki page. >>> >>> It's not ideal to have to predefine all the events (there are >>> really so many) but it's much better than not having an upgrader ;) >> >> >> >> Riaan - there is no technical reason why the event names must be >> predefined. I just took the conservative approach to change stuff >> that I knew needed changing, rather than change everything with the >> possibility of making broken code changes. >> >> Having said that, attached is an upgrade script that will match any >> event binding. User beware. >> >> cheers > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click |
From: Riaan B. <riaan@e.co.za> - 2005-03-07 14:35:16
|
Hi Paul, sosman wrote: > Riaan Booysen wrote: > >> I've also editited it a bit (making adding more events easier) >> New version is on the wiki page. >> >> It's not ideal to have to predefine all the events (there are >> really so many) but it's much better than not having an upgrader ;) > > > Riaan - there is no technical reason why the event names must be > predefined. I just took the conservative approach to change stuff that > I knew needed changing, rather than change everything with the > possibility of making broken code changes. Good point. The old version has been checked into CVS (Scripts/wx25upgrade.py), but if no one complains about this one, I'll check it in over it. Thanks, Riaan. |