Thuban/UI/main.py : import problem
bernhard.herzog at intevation.de
Tue Aug 1 19:39:32 CEST 2006
On Tuesday 01 August 2006 18:47, Didrik Pinte wrote:
> When subclassing ThubanApplication in order to customize Thuban
> (splashscreen etc.), I'm facing a little problem of imports
If you'd like to have some example code for this, have a look at
> line 37, in ?
> import mainwindow
> line 18, in ?
> from application import ThubanApplication
> ImportError: cannot import name ThubanApplication
> I don't understand where is the problem exactly.
There's a recursive import. Why it fails is described in some detail here:
> According to PEP-8, it is best to have only absolute imports.
Absolute imports have nothing to do with this.
> Finallly, I got it to work by changing the imports and the code like
> this :
In main.py, I guess.
> < from application import ThubanApplication
> > import application
> < app = ThubanApplication(0)
> > app = application.ThubanApplication(0)
Looks good. Could you apply this change and check it in?
>  What is the best way to allow the subclassing of ThubanApplication ?
I'm not sure exactly what you are asking here. Can you elaborate a bit?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://intevation.de/pipermail/thuban-devel/attachments/20060801/94bd4ca8/attachment.bin
More information about the Thuban-devel