Ed Leafe wrote:
> On Jan 17, 2007, at 12:42 PM, johnf wrote:
> 
>> import dabo.ui.uiwx.dKeys
> 
>       FWIW, even though wxPython is the only UI toolkit we support, this  
> coding style is strongly discouraged. If you get errors with  
> 'dabo.ui.<some module or function>', then you need to add:
> 
> dabo.ui.loadUI("wx")

It is not only strongly discouraged, it can wind up causing hair loss in 
edge cases. Always do 'import dabo' and then when you want to access 
something like dKeys do:

keys = dabo.ui.dKeys

and if the ui hasn't been loaded yet, you'll need to add the 
dabo.ui.loadUI("wx") manually first. So, for a simple script it would be:

import dabo
dabo.ui.loadUI("wx")
print dabo.ui.dKeys


>       I'd explain why, but as it's a namespace issue, I don't want to  
> confuse you further.

I'll only add that Dabo has complicated the import of the ui namespace 
in this fashion because of the original design goal of supporting more 
than one UI toolkit. Originally we weren't going to only support 
wxPython, but also PyQt, TkInter, PyGTK, curses, etc. etc. It could 
still happen.

-- 
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to