Package importing problem

Tonguç Yumruk tonguc at tonguc.ath.cx
Sun Sep 7 03:37:12 EDT 2003


Hi,

I'm writing a plugin based application with python 2.1 but I really have
some trouble with creating a package. My directory structure is:


Skib/Server/Python/:
skib
skibserver

	Skib/Server/Python/skib:
		__init__.py
		PluginManager.py
		plugins

		Skib/Server/Python/skib/plugins:
			default
			__init__.py

			Skib/Server/Python/skib/plugins/default:
				default.py
				__init__.py

in all the __init__.py files I have the __all__=["blah","blah"]
statement. When I try it as:

from skib import PluginManager
PluginManager.init_plugins()

It works. But when I try it like that:

import skib
skib.PluginManager.init_plugins()

It raises AttributeError and complains that there is nothing called
PluginManager. Subpackages also behave like that. The __init__.py files
only contain the __all__ directive. No actual code are in them. Am I
missing a point?

Thanks.

-- 
Love, Respect, Linux
############################################################################
Whom computers would destroy, they must first drive mad.
############################################################################
Tonguç Yumruk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030907/1f80323b/attachment.sig>


More information about the Python-list mailing list