johnf wrote:
> OK I have been attempting use
> "import dabo.ui.dKeys" and not "import dabo.ui.uiwx.dKeys"
> But I can't figure out how too. I have checked all of dabo for any location
> where you used dabo.ui.dKeys. I did not find any in dabo. I did find "from
> dabo.ui import dKeys" in daboide.
>
> Using "from dabo.ui import dKeys" appears to work. This really blows my
> mind.
> what is the diff between
> "import dabo.ui.dKeys"
> and
> "from dabo.ui import dKeys"
To show the difference, take this interpreter session:
>>> import dabo
>>> dabo.ui.loadUI("wx")
Dabo Info Log: Thu Jan 18 06:47:00 2007: PyOpenGL not present, so
dGlWindow is not loaded.
True
>>> import dabo.ui.dKeys
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named dKeys
>>> from dabo.ui import dKeys
>>>
Now, why does "import dabo.ui.dKeys" not work while "from dabo.ui import
dKeys" work? It is a side-effect of the namespace-mangling we are doing.
dKeys.py exists in dabo.ui.uiwx, not in dabo.ui. Don't worry about it,
just use the "from dabo.ui import dKeys". Actually, once you have dabo
and dabo.ui loaded, you don't need to import it at all, just refer to it:
>>> import dabo
>>> dabo.ui.loadUI("wx")
Dabo Info Log: Thu Jan 18 06:52:16 2007: PyOpenGL not present, so
dGlWindow is not loaded.
True
>>> dabo.ui.dKeys
<module 'dabo.ui.uiwx.dKeys' from
'/home/pmcnett/projects/dabo/dabo/ui/uiwx/dKeys.py'>
>>>
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev